Professional Documents
Culture Documents
DB Topic 9
DB Topic 9
Databases
Topic 9:
Database Design
Learning Outcomes
By the end of this topic, students will be able to:
• Understand the process of requirements gathering
• Design a set of database tables from an entity
model
• Document the tables, columns and domains in a
database using a data dictionary
• Understand the use of Case tools
Systems Analysis
• The art of understanding and documenting the
requirements of a given set of users within the
context of an organisation.
Systems Development
• The development of the whole system from
beginning to end. This might include a database,
applications, a network etc.
Approaches
• Traditional systems development lifecycle (SDLC)
or ‘waterfall’ approach
• Iterative approaches
Feasibility Study
Systems Analysis
• Analyst misunderstood
• Omission
Iteration
Evaluation
Design and Analysis
Prototyping
Design and
Analysis Prototyping
Evaluation
Database Design - 1
D t b
Database D
Developer
l
Database Design - 2
Moving from a set of requirements
• Logical design
• Physical design
I what
In h t format
f t
is the data?
What data is held? How is this
the data
used?
Logical Design
• Data is investigated and design is undertaken
without regard to the DBMS product that will be
used, but that data model (usually the relational
model) is known.
Design transactions
Physical Design
• From entities to tables
• Designing the base relations
Indexing D
Denormalisation
li ti
Query tuning
View creation
• Physical design
Entities to Tables -1
• Most entities will have a one-to-one mapping of
entity to table.
Student Students
Entities to Tables - 2
• Decompose any many-to-many relationships
A doctor has appointments
Doctor Patient with many patients. A patient
can have many
appointments.
Entities to Tables - 3
• Some domains will become separate tables
Data Dictionary
Domains
Domain StudentType varchar, length 30, must be ‘Overseas’,’Home’
Domain City varchar length 30
Base Relations
Students(StudentID Number NOT NULL,
Address_line1 Varchar (30) NOT NULL
Address_line2 Varchar (30) NOT NULL
City City
StudentType StudentType NOT NULL DEFAULT ‘Home’
PRIMARY KEY (StudentID)
FOREIGN KEY (City) REFERENCES City (City_name));
Case Tools
• Computer Aided Software Engineering
• Design tools
• Documentation
Doc mentation tools
• Code generators
References
• Connolly, T. & Begg, C. (2004). Database Systems:
A Practical Approach to Design, Implementation,
and Management, 4th Edition. Addison Wesley.
Chapters 15, 16 & 17.
Any Questions?