I am reading SQL and Relational Theory by C. J. Date. Baron Schwartz wrote a nice review for it. I am reading the online version, about half way through, so am not sure if it has an accompanying CD with source code. In any case, if you want to play with some SQL code listed in the book, here is the script to generate the tables and rows (or should I say relations at a certain point in time with tuples?)
CREATE TABLE S ( SNO VARCHAR(5) NOT NULL , SNAME VARCHAR(25) NOT NULL , STATUS INTEGER NOT NULL , CITY VARCHAR(20) NOT NULL , UNIQUE ( SNO ) ) ; CREATE TABLE P ( PNO VARCHAR(6) NOT NULL , PNAME VARCHAR(25) NOT NULL , COLOR CHAR(10) NOT NULL , WEIGHT NUMERIC(5,1) NOT NULL , CITY VARCHAR(20) NOT NULL , UNIQUE ( PNO ) ) ; CREATE TABLE SP ( SNO …[Read more]