-- This is PostgreSQL solution of Homework 1 -- -- The following are few details/comments: -- used MONEY type -- pay attention to how constants of money type are represented -- pay attention to how you put ' in a string (character array) CREATE TABLE CDs ( author VARCHAR(30), title VARCHAR(50), year SMALLINT, company VARCHAR(50), rating SMALLINT -- the following enforces the rating range (not required) CHECK (rating >=0 and rating <= 10), list_price MONEY, actual_price MONEY ); INSERT INTO CDs VALUES ( 'Barenaked Ladies', 'Rock Spectacle', 1996, 'Reprise Records', 8, '$20.00', '$15.99' ); -- in the followint line there is a string with ' INSERT INTO CDs VALUES ( 'U2', 'All that you can\'t leave behind', 2000, 'Universal International Music', 8, '$22.00', '$16.99' ); INSERT INTO CDs VALUES ( 'Grant Lee Philips', 'Mobilize', 2001, 'Zoe Records', 9, '$20.00', '$20.00' ); INSERT INTO CDs VALUES ( 'ABBA', 'Greatest Hits', 1992, 'Polygram Records', 9, '$20.00', '$10.99' ); INSERT INTO CDs VALUES ( 'Author2000', 'Title2000', 2000, 'Company2000', 2, '$2000.00', '$0.20' ); SELECT title, author FROM CDs WHERE year = 2000; DROP TABLE CDs;