I am making a query in Access from three tables. The first table is client and h
ID: 3872769 • Letter: I
Question
I am making a query in Access from three tables.
The first table is client and has the following attributes: client#, cname, gender, dob, state_of_residence, phone, address
The second table is product and it has the attributes: prod#, product_type, premium
The third table is payments and has the attributes: client#, product#, date_paid, amt_paid
I need to type a SQL query that lists client#, client name, product type, amount paid and date paid.
I have tried the following query:
SELECT Client.[client#], cname, product_type, amt_paid, date_paid
FROM Client, product, payments
WHERE Client.[client#] = payments.[client#]
The query is close but not quite what it is supposed to look like. I need help explaining where I am messing up. I think it is in the WHERE line.
Explanation / Answer
SELECT
[Order Details].OrderID, [Order Details].ProductID, Products.ProductName, [Order Details].UnitPrice, [Order Details].Quantity, [Order Details].Discount,
CCur([Order Details].UnitPrice*[Quantity]*(1-[Discount])/100)*100 AS ExtendedPrice
FROM Products
INNER JOIN [Order Details]
ON Products.ProductID=[Order Details].ProductID
ORDER BY [Order Details].OrderID;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.