The Database Design

In Hour 16, I had to create some flat files to use for data storage. Those flat files will no longer be used; instead, I’ve created tables in a relational database that will house all the data associated with the online store. Before I can get into the changes I’ve made to the programs, I need to explain the database design, and provide you with the SQL queries I used to create those tables.

The two data files I used in Hour 16 were products.txt and cart.txt. The products.txt file contained a list of products sold by the online store. I’ve replaced it with a table named products. The cart.txt file, which was used to save session information for users with products in their shopping cart, has been replaced with a table named ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.