Department and Dept - Locations Table and
Department and Dept - Locations Table and
Create Tables and Insert Data 8. Create relationship between the two
tables.
We are going to create a relation database a. Click Relationships under the Tool
according to the logical schema below. But
menu
to save time, we will just create the
Department and Dept_Locations table and b. Select the two tables, click Add,
their relationship. and then Close
c. Select DepNo in the
1. Double-click Create table in Design Dept_Locations table, hold the
view
mouse left key, drag it onto the
2. Type DName as the Field Name, and DepNo in the Department table,
choose Text as the Data Type and release the left key.
d. Check Enforce Referential
3. In the General tab Integrity
a. Change Field Size to 15
e. Check Cascade Delete Related
b. Select Yes for Required
(Not Null) Records
c. Select Yes (No Duplicates) f. Click Create and you should be
for Indexed (Unique) able to the window below
Constra
Attribute Data Type Primary Foreign
int
Department VARCHAR(15) NOT NULL
Name
Department INT NOT NULL
UNIQUE
Number 9. Double-click to open the Department
Manager SSN CHAR(9) NOT NULL table, enter the following records:
Manage Start DATE
5. Right-click the DepNo field and select DName DepNo MgrSSN MgrDate
Primary Key Manufacture 1 888665555 19-JUN-71
Administratio 2 543216789 04-JAN-99
6. Save the table as Department and close n
the table.
10. Close the Department table and enter
7. Create the dept_locations table similar the following records for Dept_Locations
according the requirements below. table.