Tuesday, November 22, 2011


Read ch 7 in book. quickchecks.

last time: relational database. basic SQL.
w3schools.com

SELECT Customers.CusID, First, Last, Street, Apt, City, OrderId, Descrip, Price, Qnty, [Total Price], Orders.CusID From Customers, Orders

Select * From Customers, Orders

Cartesian product of the rows of both tables

Select * From Customers, Orders
WHERE Customers.CusID = Orders.CusID

That is called an INNER JOIN. (There is also a right and a left join.)

import vs export

Layout view is WYSIWYG

Select Title, LastName, PubName
from Book, Author, Publisher
WHERE Book.AuthorCode = Author.AuthorID And
Book.PubID = Publisher.PubID And
Book.PubID = "Prentice-Hall"
ORDER BY Title

Oops!

SELECT Book.Title, Author.LastName, Publisher.PubName
FROM Publisher INNER JOIN (Author INNER JOIN Book ON Author.[AuthorID] = Book.[AuthorCode]) ON Publisher.[PubID] = Book.[PubID]
WHERE (((Publisher.PubName)="Prentice-Hall"))
ORDER BY Book.Title;

This was auto-generated by Access query designer.

No comments:

Post a Comment