Question: Suppose that there are four tables in a database, i . e . , Staff, Project, Participation, Department. Staff ( ID , name, email, no
Suppose that there are four tables in a database, ie Staff, Project, Participation, Department.
Staff ID name, email, no
Project no name, budget
Participation ID no hours
Department no name, managerID
The Staff table stores information about the ID name, email address and the department
number which the staff belongs to
The Project table stores information about the number, name and budget of a project.
The Participation table stores information about the participation of staffs in the projects, and
the number of hours that a staff uses for a particular project.
The Department table stores information about the number, the name of each department, and
the staff ID of the manager of the department. The manager of a department is also a staff
belonging to this department.
a Decide the primary keys and foreign keys of each table. For a foreign key, you need to
specify which table it refers to
marks
b Write data definition language DDL to create the table Participation and Department. You
can choose the proper data type for each attribute by yourself.
marks
c Write a SQL statement to add an extra column age in table Staff. You can decide a proper
data type for this new column by yourself.
marks
d Write a SQL statement to list out the no of each department and the total amount of hours of
all its staff working for all the projects.
marks
e Write a SQL statement to delete all the data recorded in Participation for the staff who are the
managers of some departments.
marks
f Write a SQL statement to list out the names of all managers who are in charge of a
department in which at least one staff participates in a project with the budget not smaller
than The same name must appear only once.
marks
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
