Professional Documents
Culture Documents
Relational Database
Design Concepts
Ramkumar
Lakshminarayanan
www.rajaramsystems.com
Question
Q…Explain the difference between
system objects and user objects.
Q…Describe normalization.
Q…What is the difference between a
DDL trigger and a DML trigger?
Database Basics
A client-server system is made up of
two components: an application that is
used to present the application's data,
and a database system that is used to
store it.
An application may be designed in
Visual Studio 2005, J2EE, or some
other graphical user interface.
For the purpose of this course, a database
is a collection of objects stored on a SQL
Server.
This collection of objects includes all the
tables, views, stored procedures, functions,
and other objects necessary to build a
database system.
If tables relate to one another, they should
generally be in the same database.
System Versus User Objects
System databases
include Master, Model,
MSDB, Resource,
TempDB, and
Distribution. SQL
Server creates these
databases during the
installation process.
System objects include databases, tables,
stored procedures, functions, and other
types of system objects.
User Objects
System objects are part of the SQL Server
system, you create user objects.
User objects include the databases, stored
procedures, functions, and other database
objects that you build.
You can add and drop user objects as
necessary. This course is dedicated to
showing you how to create and work with
user objects, as well as how to administer
your SQL Server.
Table Basics
Tables are generally the first thing that you
add to a SQL Server database
Each table contains information about a
subject. For example, one table may
contain information about customers,
whereas another table may contain
information about orders. Each table in a
database must have a unique name.
A table is made up of rows and columns.
Relational Database Design
Concepts
Just as a house without a foundation
will collapse, a database with poorly
designed tables and relationships will
fail to meet the needs of the users.
The History of Relational Database
Design
Dr. E.F. Codd first introduced formal
relational database design in 1969.
He based it on set theory and predicate
logic. Relational theory applies to both
databases and database applications.
Codd developed 12 rules that determine
how well an application and its data adhere
to the relational model.
12 rules are now grown further in to 100 of
rules.
Rules of Relational Database
Design
The Rules of Tables
Each table in a system must store data about a
single entity.
Example : customers, employees, and inventory
items.
The Rules of Uniqueness and Keys
Tables are composed of rows and columns.
To adhere to the relational model, each table
must contain a unique identifier.
You guarantee uniqueness in a table by
designating a primary key.
Foreign Keys and Domains
A foreign key in a table is the field that
relates to the primary key in a second
table.
For example, the CustomerID is the primary
key in the Customers table. It is the foreign
key in the Orders table.
Normalization and Normal Forms
One of the most difficult decisions
that you face as a developer is what
tables to create and what fields to
place in each table, as well as how to
relate the tables that you create.
First Normal Form