Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started