The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Exercise 3.8 Answer each of the following questions briefly. The questions are based on the following relational schema:
Â
![]()
Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, pct time: integer)
![]()
Dept(did: integer, dname: string, budget: real, managerid: integer)
![]()
Â
1.   Give an example of a foreign key constraint that involves the Dept relation. What are the options for enforcing this constraint when a user attempts to delete a Dept tuple?
Â
2.   Write the SQL statements required to create the above relations, including appro- priate versions of all primary and foreign key integrity constraints.
3.   Define the Dept relation in SQL so that every department is guaranteed to have a manager.
4.   Write an SQL statement to add ‘John Doe’ as an employee with eid = 101,
age = 32 and salary = 15, 000.
5.   Write an SQL statement to give every employee a 10% raise.
6.   Write an SQL statement to delete the ‘Toy’ department. Given the referential integrity constraints you chose for this schema, explain what happens when this statement is executed.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll