Monday, May 2, 2011

relational databases

two problems with non-relational, non-normalized databases.

primary key: field that uniquely identifies a record

foreign key: points to the primary key of a different (thus foreign) table

SQL statement:

SELECT Customers.First, Customers.Last, ItemDescription From Customers, Orders

will give me the Cartesian product of the two tables

SELECT Customers.First, Customers.Last, ItemDescription From Customers, Orders
WHERE Customers.CusId = Orders.CusID

called an INNER JOIN ON Customers.CusId = Orders.CusID

No comments:

Post a Comment