3. Define the key-value-pair tables that would be needed for a Web site that sells custom shirts. Customers choose colors, sizes, and can enter text to be printed on the back, front, or sleeves.
Customer( *CustomerID, LastName, FirstName, Phone, Address, City, State, ZIP)
Order( *CustomerID, *OrderDate, Color, Size,
TextLocation map<text, text>, Quantity, PriceAmount )
TextLocation map entries include things such as:
'front', 'Call Me'
'back', 'Irresponsible'
Optional, lookup tables:
ColorList (*Colors)
SizeList (*Size)
Note how these tables are quite different from the relational model,
and all basic order data is retrievable with just two queries based
only on key values. But there are few options for sophisticated
searches. And basically, each shirt is a separate order.
If you want to allow multiple shirts per order, you would change the
Order to a different map:
Order( *CustomerID, *OrderDate, ShirtOrder map<text, text>)
Which contains entries for:
'color'
'size'
'frontText'
'backText'
'sleeveText'
'price'
'quantity'