Professional Documents
Culture Documents
DDD Topic 6 - Physical Design
DDD Topic 6 - Physical Design
DDD Topic 6 - Physical Design
Learning Outcomes
By the end of this topic students will be able to:
• Understand the purpose of physical design
• Map a logical database design to a physical
database design
• Design tables for the chosen database product
• Budget
• Support available
• Strength of vendor
Step 3
3.1 Design Base Tables (covered in this
lecture)
Step 4
4.1 Analyse transactions (covered in Unit 9)
Steps 5 to 8
• Step 5 Design User Views (Covered in Unit 8 and 9)
1 0...* 0...* 1
Customer CustomerItem Item
0...*
Supplier
1 0...* 0...* 1
Customer CustomerItem Item
0...*
Supplier
(SupplierID, SupplierName)
Primary Key SupplierID
Data Definition - 1
Create table customers
(CustomerID char not null,
CustomerName varchar(20) not null,
Street char(20) not null,
PostCode char(8) not null,
primary key CustomerID);
Data Definition - 2
The table name
Create table customers
(CustomerID char not null,
CustomerName varchar(20) not null,
Street char(20) not null, Here the columns are defined.
The datatypes
PostCode char(8) not null, are specfied along with the
length in brackets.
primary key CustomerID); If a columns is specified as
NOT NULL then it
is mandatory and must be
populated when a
new row is created.
CASE Tools
• Computer Aided Software Engineering
Primary Key
Create table customers Create table customers
(CustomerID char not null
(CustomerID char not null, primary key,
CustomerName varchar(20) CustomerName varchar(20)
not null, not null,
Street char(20) not null, Street char(20) not null,
PostCode char(8) not null, PostCode char(8) not null);
primary key CustomerID);
Primary Key
defined in
different
places
Foreign Key
Item
(ItemID, ItemName, Price, SupplierID)
Create table Item
Primary Key (ItemID (ItemID char (5) not null,
Supplier
ItemName char(30),
(SupplierID, SupplierName) Price float (3),
Primary Key SupplierID)
SupplierID number(5),
primary key ItemID,
foreign key (SupplierID) references
Supplier(SupplierID));
Create Domain
• Explicitly create a domain:
• Budget
• Support available
• Strength of vendor
Learning Outcomes
By the end of this unit students will be able to:
• Understand the purpose of physical design
• Map a logical database design to a physical
database design
• Design tables for the chosen database product
References
• Connolly, Thomas and Begg, Carolyn Database
Solutions: A step-by-step guide to building database
Addison-Wesley 2nd Edition 2004 Chapter 12
• Choosing a database
http://databases.about.com/od/administration/a/cho
osing_a_db.htm
Accessed 1st June 2011
• Examples of different vendor’s SQL syntax
http://www.1keydata.com/sql/sql-foreign-key.html
Accessed 5th June 2011