L Department(Dept_code(PK), Department_Name) L Employee(Employee_ID(PK), First_N
ID: 3639398 • Letter: L
Question
L Department(Dept_code(PK), Department_Name)
L Employee(Employee_ID(PK), First_Name, Last_Name, Dept_code(FK), Hire_Date, Credit_limit, Phone_Number, Manager_ID(FK))
L Foods(Supplier_id(PK), Product_Code(PK or FK?), Menu_item, Description, Price, Price_increase)
L Lunches(Lunch_id(PK), Lunch_date, Employee_ID(FK))
L Suppliers(Supplier_ID(PK), Supplier_Name)
L Lunch_items(Lunch_ID(PK), Item_number, Supplier_ID(FK), Product_code(FK), Quantity)
Given the following 6 tables above,
Write an SQL code that does:
Explanation / Answer
select LEmployee.First_Name, LEmployee.Last_Name from LEmployee GROUPBY Manager_ID FULL JOIN LLunches where Employee_ID = {select Employee_ID,DATE_SUB (Lunch_Date, INTERWAL2DAY) AS SubtractDate from LLunches} ON LEmployee.Employee_ID = LLunches.Employee_ID;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.