Professional Documents
Culture Documents
Converting An ERD To DDL
Converting An ERD To DDL
Example
Custom er
Customer_id
FirstName
LastName
Nickname
Gender
Order
Order_id
OrderDate
ShortDescription
Price
ShippingMethod
Purchases
Custom er
Customer_id
FirstName
LastName
Nickname
Gender
Order
Purchases
Order_id
OrderDate
ShortDescription
Price
ShippingMethod
Order
Order_id
OrderDate
ShortDescription
Price
ShippingMethod
Figure 2: Script
Child table orders has a foreign key referencing customer table Line 23. Line 11 is
the definition of the customer primary key. Line 22 is the definition of orders primary
key.