I have 3 data tables…
People
Person ID, Lastname, Firstname
Cars (a record for each car color)
CarTypeID, CarColor
Musical_Instruments (a record for each instrument type)
InstrumentID, InstrumentName
I then have 2 relating tables to keep track of what Cars People own and what Instruments People Play
Peoples_Cars
PersonID, CarTypeID
Peoples_Musical_Instruments
PersonID, CarTypeID
Here is my question…..
What is the best SQL statement to get a list of PEOPLE who have a CarTypeID = 1 AND a CarTypeID = 3 (they own 2 cars) AND have an InstrumentID = 4 AND have an InstrumentID = 5 (they play 2 instruments) ??????
People
Person ID, Lastname, Firstname
Cars (a record for each car color)
CarTypeID, CarColor
Musical_Instruments (a record for each instrument type)
InstrumentID, InstrumentName
I then have 2 relating tables to keep track of what Cars People own and what Instruments People Play
Peoples_Cars
PersonID, CarTypeID
Peoples_Musical_Instruments
PersonID, CarTypeID
Here is my question…..
What is the best SQL statement to get a list of PEOPLE who have a CarTypeID = 1 AND a CarTypeID = 3 (they own 2 cars) AND have an InstrumentID = 4 AND have an InstrumentID = 5 (they play 2 instruments) ??????