Professional Documents
Culture Documents
CC 14.1 Activity7 - Physical Database Design
CC 14.1 Activity7 - Physical Database Design
Learning Outcomes
Topics Covered
Open access materials available through Elearn and the web, and other text references
Instructions
This is a group activity. You need to work with your assigned group to complete this task.
1. Develop a relational schema for the logical data model for the MySQL relational DBMS and
decide on the representation and properties of the base relations, including:
a. Name of relation.
b. A list of simple attributes in brackets.
c. The primary key (PK), and where appropriate, alternate keys (AK), and foreign keys (FK)
d. Integrity constraints for any foreign keys identified.
e. For each attribute, identify its domain, consisting of data type, length and any constraints
on the domain, an optional default value for the attribute, whether the attribute can hold
nulls, and whether the attribute is derived and, if so, how it should be computed.
f. Indexes for efficient retrieval, if any,
2. Report format:
Use A4 size document
Font Times New Roman, size 12, bold, for headings, and size 11 for body texts
Line Spacing is 1.15
Margin: Left and Right: 0.8” on all sides
2. Save file as Activity7_Group#.
3. Upload soft copy of your output to eLearn.
4. As a guide, you may refer to the attached example on the next page.
5. Perform peer evaluation. No peer evaluation means zero for peer evaluation score (see scoring tool
below).
Scoring Tool
______________________________________________________________________________________________________
Activity 7 Example
Company Database:
An Example Database Application
(Source: Fundamentals of Database Systems, 2nd edition, Elmasri & Navathe)
dept_locations (
dnumber int (11) NOT NULL default '0',
dlocation varchar (15) NOT NULL default '0',
PRIMARY KEY (dnumber,dlocation),
FOREIGN KEY dnumber REFERENCES department(dnumber) on delete SET NULL on update CASCADE
)
employee (
fname varchar (15) NOT NULL default '',
minit char (1) default NULL,
lname varchar (15) NOT NULL default '',
ssn varchar (9) NOT NULL default '',
bdate date default NULL,
address varchar (30) default NULL,
sex char (1) default NULL,
salary decimal (10,2) default NULL,
superssn varchar (9) default NULL,
dno int (11) NOT NULL default '0',
PRIMARY KEY (ssn),
FOREIGN KEY superssn REFERENCES employee(ssn) on delete SET NULL on update CASCADE,
FOREIGN KEY dno REFERENCES department(dnumber) on delete SET NULL on update CASCADE
) INDEX on lname
department (
dname varchar(15) NOT NULL default '',
dnumber int(11) NOT NULL default '0',
mgrssn varchar(9) NOT NULL default '',
mgrstartdate date default NULL,
PRIMARY KEY (dnumber),
UNIQUE KEY dname (dname),
FOREIGN KEY mgrssn REFERENCES employee(ssn) on delete SET NULL on update CASCADE
) INDEX on dname
dependent (
essn varchar(9) NOT NULL default '',
dependent_name varchar(15) NOT NULL default '',
sex char(1) default NULL,
bdate date default NULL,
relationship varchar(8) default NULL,
PRIMARY KEY (essn,dependent_name),
FOREIGN KEY essn REFERENCES employee(ssn) on delete CASCADE on update CASCADE
)
works_on (
essn char(9) NOT NULL default '',
pno int(11) NOT NULL default '0',
hours decimal(3,1) default '0.0',
PRIMARY KEY (essn,pno),
FOREIGN KEY essn REFERENCES employee(ssn) on delete NO ACTION on update CASCADE,
FOREIGN KEY pno REFERENCES project(pnumber) on delete ACTION on update CASCADE
)