Consider the following information about a university database:   Each project is managed by one professor. And each project is worked on by one or more professors. but professors can manage and/or work on multiple projects.   Each project is worked on by one or more graduate students. When graduate students work on a project, a professor must supervise their work on the project. Graduate students can work on multiple projects, in which case they will have a supervisor for each one.   Departments have a professor who runs the department. professors work in one or more departments, and for each department that they work in, a time percentage is associated with their job. Graduate students have one major department. Each graduate student has another, more senior graduate student who advises him or her on what courses to take(advisor). Professors have an SSN, a name, an age, a rank, and a research specialty. Projects have a project number, a sponsor name (e.g., NSF), a starting date, an ending date, and a budget. Graduate students have an SSN, a name, an age, and average degrees Departments have a department number, a department name, and a main office.                       Create user smith with privilege that allow him to create tables and DB.   Write DDL statements to create the tables.                                           Write Queries for the following: insert the sample data shown above into the tables Find all information of projects who have managed by each professor Find the names and degrees of graduate students whose degree is better than some graduate students called ali. write a query to retrieve the name of graduate student and student advisor name of all graduate student. Find the number of graduate students who have the same average degrees, average degrees and display new column as average_degrees*average_degrees/2 for each graduate student, and list in the order of age. Write a query to retrieve name of professor, department name and project, for all projects whose budget is greater than 400. Select all those professors who age in the range 30 to 40 and don't have any rank. List all professors whose name begins with 'A' or ‘L’ and age large than 30. List full details of departments that don't have any graduate students. Find the name and the age of the youngest professors Count the number of different professors names. Find the names of student who have work in all projects. Find the name and the age of the youngest graduate student (use subquery). Find the names of professors supervising graduate students that age >22. Find the ids of professors who have work in an IT department or Science department. Find the names of graduate students who have works on projects with budget >300, and list in the order of budget. Find the ids and names of professors who have work in two different department on the same time. Find the ids and names of professors who managed two different project on the same start date. Find the names of professors who have works in at least one project. Change the name of professor ‘Alex’ to Ali. Delete the record for the student whose name is ‘Ali’ and age 22. add new column to project table with constraint unique and add a default value for it then create view that view names of professors and name of project   Identify the entities, relationships, key attributes and other attributes and then design the ER diagram:   There are many hotels in a country. Each hotel is identified by its id, name and star rate. Each hotel provides many rooms. Rooms are identified by Room no. and type. Each room is rented for a cost. Cost is identified by its id and amount. A hotel has many facilities available with it. Facilities are identified by its id and name. A hotel is located at a particular location. Location is identified by street, town and pincode.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Consider the following information about a university database:

 

  • Each project is managed by one professor. And each project is worked on by one or more professors. but professors can manage and/or work on multiple projects.

 

  • Each project is worked on by one or more graduate students. When graduate students work on a project, a professor must supervise their work on the project. Graduate students can work on multiple projects, in which case they will have a supervisor for each one.

 

  • Departments have a professor who runs the department. professors work in one or more departments, and for each department that they work in, a time percentage is associated with their job.
  • Graduate students have one major department. Each graduate student has another, more senior graduate student who advises him or her on what courses to take(advisor).

Professors have an SSN, a name, an age, a rank, and a research specialty. Projects have a project number, a sponsor name (e.g., NSF), a starting date, an ending date, and a budget. Graduate students have an SSN, a name, an age, and average degrees

Departments have a department number, a department name, and a main office.

 

 

 

 

 

 

 

 

 

 

 

  1. Create user smith with privilege that allow him to create tables and DB.

 

  1. Write DDL statements to create the tables.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Write Queries for the following:
  2. insert the sample data shown above into the tables
  3. Find all information of projects who have managed by each professor
  4. Find the names and degrees of graduate students whose degree is better than some graduate students called ali.
  5. write a query to retrieve the name of graduate student and student advisor name of all graduate student.
  6. Find the number of graduate students who have the same average degrees, average degrees and display new column as average_degrees*average_degrees/2 for each graduate student, and list in the order of age.
  7. Write a query to retrieve name of professor, department name and project, for all projects whose budget is greater than 400.
  8. Select all those professors who age in the range 30 to 40 and don't have any rank.
  9. List all professors whose name begins with 'A' or ‘L’ and age large than 30.
  10. List full details of departments that don't have any graduate students.
  11. Find the name and the age of the youngest professors
  12. Count the number of different professors names.
  13. Find the names of student who have work in all projects.
  14. Find the name and the age of the youngest graduate student (use subquery).
  15. Find the names of professors supervising graduate students that age >22.
  16. Find the ids of professors who have work in an IT department or Science department.
  17. Find the names of graduate students who have works on projects with budget >300, and list in the order of budget.
  18. Find the ids and names of professors who have work in two different department on the same time.
  19. Find the ids and names of professors who managed two different project on the same start date.
  20. Find the names of professors who have works in at least one project.
  21. Change the name of professor ‘Alex’ to Ali.
  22. Delete the record for the student whose name is ‘Ali’ and age 22.
  23. add new column to project table with constraint unique and add a default value for it then create view that view names of professors and name of project

 

  1. Identify the entities, relationships, key attributes and other attributes and then design the ER diagram:

 

There are many hotels in a country. Each hotel is identified by its id, name and star rate. Each hotel provides many rooms. Rooms are identified by Room no. and type. Each room is rented for a cost. Cost is identified by its id and amount. A hotel has many facilities available with it. Facilities are identified by its id and name. A hotel is located at a particular location. Location is identified by street, town and pincode.

 

professors
Projects
SSN name
age R specialty rank
pnumber
ending Date budget ssn_pro
starting
Date
1/3/2020
20/3/2020
1/4/2020
1/3/2020
20/3/2020
name
Alexandra 30 Science
English
Assistant Professor
2
Alex
35
Assistant Professor
Analysis 1
9/4/2020
20/4/2020
29/4/2020
9/4/2020
29/5/2020
1
300
1
Lesbon
smith
Professor
3
40
Mathmatic
Translate
400
2
4
32
Science
null
3
3
Calculation
Analysis_2
algorithm
600
Loai
42
Computer
Professor
4
200
1
5
320
5
Work_In
departments
work_dept
Ssn dnumber time
3:00pm
pnumber
dnumber name
Office
San pro
ssn
1 1
3
1
1
1
IT
New York
3
2
12:30am
2
2
3
2
Science
Boston
3
1:00pm
Engineering
Health sciences
Accounting
Boston
New York
Chicago
2
3:00am
1
2
4
2
1
3
5
1
4
4
11:00am
work proj
Gradute
SSN
Gradute_NO
pnumber
SSN
Avg degree age
dnumber advise
name
2
3
1
2
1
Laila
85
24
1
1
3
2
Ali
90
22
1
2
4
1
4
3
Ahmed
95
null
26
2
1
4
Sami
30
2
3
1
2
1
Amany
85
32
33
2
2
3
2
6
Andre
95
3
3
Transcribed Image Text:professors Projects SSN name age R specialty rank pnumber ending Date budget ssn_pro starting Date 1/3/2020 20/3/2020 1/4/2020 1/3/2020 20/3/2020 name Alexandra 30 Science English Assistant Professor 2 Alex 35 Assistant Professor Analysis 1 9/4/2020 20/4/2020 29/4/2020 9/4/2020 29/5/2020 1 300 1 Lesbon smith Professor 3 40 Mathmatic Translate 400 2 4 32 Science null 3 3 Calculation Analysis_2 algorithm 600 Loai 42 Computer Professor 4 200 1 5 320 5 Work_In departments work_dept Ssn dnumber time 3:00pm pnumber dnumber name Office San pro ssn 1 1 3 1 1 1 IT New York 3 2 12:30am 2 2 3 2 Science Boston 3 1:00pm Engineering Health sciences Accounting Boston New York Chicago 2 3:00am 1 2 4 2 1 3 5 1 4 4 11:00am work proj Gradute SSN Gradute_NO pnumber SSN Avg degree age dnumber advise name 2 3 1 2 1 Laila 85 24 1 1 3 2 Ali 90 22 1 2 4 1 4 3 Ahmed 95 null 26 2 1 4 Sami 30 2 3 1 2 1 Amany 85 32 33 2 2 3 2 6 Andre 95 3 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Transaction Processing
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education