SQL Project Query #3

Questions ArchiveCategory: QuestionsSQL Project Query #3
Maggie Jackson asked 2 years ago

I am trying to join the encounter and salesperson tables to the customer table for query 3. It is telling me that “sales” and “encid” are unknown. From my understanding those are the correct column names in the dataset. 
Here is what I am entering for query #3:

SELECT cfirstname, clastname, annualincome
FROM customer
INNER JOIN encounter ON customer.encid = encounter.encid
INNER JOIN salesperson ON customer.salesid = salesperson.salesid
WHERE annualincome > 80000
AND salesperson.salesid = “Katie”

What do I need to change the column names to?

enlibrari replied 1 day ago

2 mmol in methanol 150 ml was added glacial acetic acid 15 ml, 262 mmol at ambient temperature kamagra on line

1 Answers
Justis answered 2 years ago

You’re on the right track here Maggie, your joins are the things giving you the problems you’re having. Is there encid in the customer table? is there salesid in customer table? Go ahead and look at the erd above the questions. Do you see how each table is linked to each other? That’s the way that you join tables. Creditrating.creditid = customer.creditid, Customer.customerid = encounter.customerid, encounter.salesid = salesperson.salesid. Hopefully that helps.
P.S. go ahead and read the question VERY carefully again, does the question ask for just anyone who has an income over 80000 and met with Katie? Or does it ask for anyone who has an income over 80000, met with Katie, AND bought a car from her

Your Answer

12 + 9 =