Murach’s SQL for SQL Server – Exercise 9 – Guaranteed 100% Score
1. Design a database diagram for a product orders database with four tables. Indicate
the relationships between tables and identify the primary key and foreign keys in
each table. Explain your design decisions.
OrderID
CustomerID
OrderDate
ShipAddress
ShipDate
.
.
.
CustomerID
CustomerName
CustomerAddress
CustomerPhone
.
.
.
Customers Orders
OrderID
OrderSequence
ProductID
Quantity
UnitPrice
OrderLineItems
ProductID
ProductName
QtyPerUnit
UnitPrice
InStock
OnOrder
.
.
.
Products
STATUS
2. Add the two tables below into the design for exercise 1. Create additional tables and
columns, if necessary. Explain your design decisions.
Shipper ID
ShipperName
ShipperAddress
ShipperPhone
.
.
.
Shippers
EmployeeID
FirstName
LastName
SSN
HireDate
.
.
.
Employees
3. Modify your design for exercise 2 to identify the columns that should be indexed,
and explain your decision.
4. Design a database diagram that allows individuals to be assigned membership in one
or more groups. Each group can have any number of individuals and each individual
can belong to any number of groups. Create additional tables and columns, if
necessary. Explain your design decisions.
GroupID
GroupName
Groups
IndividualID
FirstName
LastName
Address
Phone
.
.
.
Individuals
5. Modify your design for exercise 4 to keep track of the role served by each individual
in each group. Each individual can only serve one role in each group. Each group has
a unique set of roles that members can fulfill. Create additional tables and columns,
if necessary. Explain your design decisions.