Question: 3. (a) Define Super Key, Candidate Key, Primary Key and Foreign Key with example data. (b) Consider the following relations: (Note: ID is the primary

 3. (a) Define Super Key, Candidate Key, Primary Key and Foreign

3. (a) Define Super Key, Candidate Key, Primary Key and Foreign Key with example data. (b) Consider the following relations: (Note: ID is the primary key of each entity. x(FK[r]) idicates x a foreign key referencing entity r): [07] [18] persons(ID, Name, DOB, Address) schools(ID, Name, Establish Year) companies(ID, Name, Location) students(ID, PersonID (FK[persons), gpa, schoolID(FK[schools])) emp(ID, PersonID(FK[persons)), Salary) Now write the standard SQL for the following queries: i. List the persons Name, ID and Address according to their age (i.e. Oldest will appear first) ii. List each student's information as following: Student ID, Student Name, Name of School, gpa iii. List the school's summary as : School Name, Total Students, average gpa iv. List top 5 schools based on the average gpa (as obtained in iii) v. List employees name, his/her company name, salary vi. Update each employees salary by 20% for those who currently get less than the average salary of his/her company's employees salary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!