6. Display all supplier name and food description (if no food is available then display null) – Hint use outer join between l_suppliers and l_foods
Is this right?
SELECT DESCRIPTION, SUPPLIER_NAME FROM L_FOODS OUTTER JOIN L_SUPPLIERS on L_SUPPLIERS.SUPPLIER_ID = L_FOODS.SUPPLIER_ID;
7. Display Lunch ID, Lunch date and employees name order by employee name (ascending)
Join employee and lunch table on employee id, orded by asc name
8. Display Lunch id, cost of food ordered (quantity * food price) (Join l_lunch_items, l_foods)
9. Display food description which is not order in any lunches (use Not exists on l_lunch_items)
10.Display Lunch ID, employee name , Food description, quantity (join l_lunches, l_lunch_items, l_foods, l_employees
Expert Answer
6. Display all supplier name and food description (if no food is available then display null) – Hint use outer join between l_suppliers and l_foods
Is this right?
SELECT DESCRIPTION, SUPPLIER_NAME FROM L_FOODS OUTTER JOIN L_SUPPLIERS on L_SUPPLIERS.SUPPLIER_ID = L_FOODS.SUPPLIER_ID;
this concept is related to joins ..
so know about something that..
7. Display Lunch ID, Lunch date and employees name order by employee name (ascending)
Join employee and lunch table on employee id, orded by asc name
8. Display Lunch id, cost of food ordered (quantity * food price) (Join l_lunch_items, l_foods)
9. Display food description which is not order in any lunches (use Not exists on l_lunch_items)
10.Display Lunch ID, employee name , Food description, quantity (join l_lunches, l_lunch_items, l_foods, l_employees