sql - MySQL multi table join query -


Result Required: Registration number of cars used by trainers in Glasgow, Beerson Office I have 3 relevant tables; (I have left the non-incidental table information to simplify it. The database is called easy drdiv.

No, this is not a school or uni assignment, this is a question from the text book, our If this is given to do so, then how can we learn, no marks are given for this, so you are not doing my homework for me.

  ** ++ Staff ++ ** (PK) Staff ID (FK) Address ID (F) K) Office (FK) Car Allocation Number First Name Last Name Status / Title Office ** +++ CarAllocation ++ ** (PK) Car Allocation Number (FK) Staff ID (FK) Car ID ** ++++++ ++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ Choose from +++ P> 
  car.rego car where staff.office = 'glasgow' or 'beerson'  

if someone can fill an empty space Can I learn how to do this, do I need to create a new table

You most likely ask something like this:

  Choose first_name, last_name, car_rego employee Join carallocation (carallocation.staff_id = staff.staff_id) Join the car (car.car_id = carallocation.car_id) WHERE staff.office = 'Glasgow' or employee. Office = 'beersen';  

Note that JOIN is a synonym for MySQL.


Comments