Chapter Two – Introduction to Structured Query Language
Page 2-79
❖ MARCIA’S DRY CLEANING CASE QUESTIONS
Marcia Wilson owns and operates Marcia’s Dry Cleaning, which is an upscale dry cleaner in a
well-to-do suburban neighborhood. Marcia makes her business stand out from the competition
by providing superior customer service. She wants to keep track of each of her customers and
their orders. Ultimately, she wants to notify them that their clothes are ready via e-mail. To
provide this service, she has developed an initial database with several tables. Three of those
tables are as follows:
In this database schema, the primary keys are underlined and the foreign keys are shown in
italics. Note that CUSTOMER contains a recursive relationship between ReferredBy and
CustomerID, where ReferredBy contains the CustomerID value of the existing customer who
referred the new customer to Marcia’s Dry Cleaning. The database that Marcia has created is
named MDC, and the three tables in the MDC database schema are shown in Figure 2-47.
FIGURE 2-47 – The MDC Database
The column characteristics for the tables are shown in Figures 2-48, 2-49, and 2-50. The
relationship between CUSTOMER and INVOICE should enforce referential integrity, but not
cascade updates or deletions, while the relationship between INVOICE and INVOICE_ITEM
should enforce referential integrity and cascade both updates and deletions. The data for these
tables are shown in Figures 2-51, 2-52, and 2-53.