Appendix A

The Schema

Every query in this volume runs against the same eleven-table schema — a generic operations database: people, money, products, orders, the usual. Click through to see columns and relationships in full.

  1. Table 0110 cols

    employees

    PK · emp_id

    FK · dept_id, manager_id

  2. Table 025 cols

    departments

    PK · dept_id

    no foreign keys

  3. Table 036 cols

    salary_history

    PK · history_id

    FK · emp_id

  4. Table 047 cols

    projects

    PK · project_id

    FK · dept_id

  5. Table 056 cols

    project_assignments

    PK · assign_id

    FK · emp_id, project_id

  6. Table 066 cols

    customers

    PK · cust_id

    no foreign keys

  7. Table 076 cols

    products

    PK · product_id

    FK · cat_id

  8. Table 086 cols

    orders

    PK · order_id

    FK · cust_id

  9. Table 096 cols

    order_items

    PK · item_id

    FK · order_id, product_id

  10. Table 103 cols

    categories

    PK · cat_id

    FK · parent_id

  11. Table 115 cols

    suppliers

    PK · sup_id

    no foreign keys