0% found this document useful (0 votes)
59 views16 pages

Chapter 06-1 Relational Model

The document describes how to transform an entity-relationship (ER) data model into a relational database model. It discusses mapping ER diagrams to relational tables, defining data types and lengths, table and column naming conventions, handling reserved words and keys, and using notations like primary keys, foreign keys, and optionality in table diagrams. The goal is to take the logical ER model and produce a physical relational schema tailored for a specific database management system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views16 pages

Chapter 06-1 Relational Model

The document describes how to transform an entity-relationship (ER) data model into a relational database model. It discusses mapping ER diagrams to relational tables, defining data types and lengths, table and column naming conventions, handling reserved words and keys, and using notations like primary keys, foreign keys, and optionality in table diagrams. The goal is to take the logical ER model and produce a physical relational schema tailored for a specific database management system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Relational Model

Transforming ER Model to Relational (Physical) Model


Relational Model
• A Relational Model is the result of transforming the ER data
model into a table structure that resembles the physical
structure of the specific DBMS relational database being
implemented

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

• First row of table contains the table name:


– Table name is the plural of the entity name
– All Capitals and Bold

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

• Column name contains the database column name


– Identical to attribute names except special characters and spaces are
replaced with underscores
– Sometimes, column names use abbreviations. For example, employee
id might be defined as employee_id or emp_id

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

• What about NULL capable columns?


16

You might also like