Chapter 06-1 Relational Model
Chapter 06-1 Relational Model
2
Entity Relationship Diagram
3
Terminology Mapping
4
Define Data Types/Lengths
• Can be completed:
– During the construction of the ER diagram
– During the transformation from the ER diagram to Relational model
5
6
Relational (Physical) Model
7
Table Diagram Notations
8
Table and Column Names
• Table and column names:
– Must start with an alpha character
– Can contain up to 30 alphanumeric characters
– Cannot contain spaces
– Special characters such as "!," but "$," "#," and "-" are permitted, but
not recommended
– Column names must be unique within a table
9
Reserved Words
• Every database and SQL language have words that have a special
meaning:
– Called "reserved" words
– Avoid using reserved words
• Examples of reserved words:
– table
– number
– state
– order
– A search can provide a complete list of reserved words 10
Table Diagram Notations
• Key Type contains:
– "pk" for the primary key
– "uk" for unique key
– "fk" for foreign key
• Non-key columns are blank
11
Table Diagram Notations
• Optionality contains:
– Asterisk ( * ) if the column is mandatory
– Letter O if the column is optional
12
Table Diagram Notations
13
Short Names
• A unique short table name may be useful in the naming of
foreign-key columns
14
Table Diagram Notations
• Data Type:
– Identifies the data type of the data
– Specific to the DBMS where the database is being implemented
• Length specifies the length of the data
15
Table Diagram Notations