Schema 1:
Suppliers(S_ID, S_Name, pincode, mobile_no )
Parts(P_ID, P_Name, colour)
Catalog(S_ID, P_ID, price)
Catalog[S_ID] ⊆ Suppliers[S_ID]
Catalog[P_ID] ⊆ Parts[P_ID]
Q1. If S_ID is a key for the Suppliers relation, could it be a key for the Catalog relation?
Write relational algebra and sql for the below questions:
Q2. Find the names of all blue and green and black parts.
Q3. Find all prices for parts that are red or green and display the highest price part’s name among them.
Q4. Find the S_IDs of all suppliers who supply a part that is blue or black.
Q5. Find the names of all suppliers who supply a part that is not blue or white.
Schema 2:
Employees(E_ID, E_name, E_age, E_salary)
Supervises(boss, employee)
Supervises[boss] ⊆ Employees[E_ID]
Supervises[employee] ⊆ Employees[E_ID]
Q6. Find the names and salaries of all bosses who have an employee earning more than 500000.
Q7. Display the age of the highest paid salary.
Q8. Show the names of all employees who were born in a specific year.