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.
Consider the following information about a university
- 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.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images