So i'm supposed to make a query that outputs something, now we have been given a already made database + some info inside it.
It has to output who worked at bar ID 8 on the event at 01-MAY-16, with the students name rather than the ID.
The 2 tables needed for this query are
STUDENTS: ID,NAME,ADRESS,BSN,ADRESS2, BANK, SEX
ORDERS: ID, DATEORDER, BARS_ID, STUDENTS_ID
SELECT ORDERS.ID, STUDENTS.NAME, ORDERS.DATEORDER
INNER JOIN STUDENTS
WHERE (BARS_ID = '8') AND (DATEORDER = '01-MAY-16')
ORDER BY STUDENTS.NAME;
SELECT STUDENTS.NAME, count(*) FROM ORDERS INNER JOIN STUDENTS ON ORDERS.STUDENTS_ID = STUDENTS.ID WHERE BARS_ID = '8' AND DATEORDER = '01-MAY-16' GROUP BY STUDENTS.NAME;