Relational Database Design
Relational Database Design
Step 2: Gather Data, Organize in tables and Specify the Primary Keys
Once you have decided on the purpose of the database, gather the data that are
needed to be stored in the database. Divide the data into subject-based tables.
Choose one column (or a few columns) as the so-called primary key, which uniquely
identify the each of the rows.
Stages of Design
Once you understand the basic structure of a relational database, you can begin the
database design process. Designing a database is a process that involves developing and
refining a database structure based on the requirements of your business.
Database design includes the following three stages:
1Conceptual Database Design
2Logical Database Design
3Physical Database Design
Conceptual Design
The first step in the database design cycle is to define the data requirements for your
business. Answering these types of questions helps you define the conceptual design:
•What types of information does my business currently use?
•What types of information does my business need?
•What kind of information do I want from this system?
•What are the assumptions on which my business runs?
•What are the restrictions of my business?
•What kind of reports do I need to generate?
•What will I do with this information?
•What kind of security does this system require?
•What kinds of information are likely to expand?
Identifying the goals of your business and gathering information from the different sources
who will use the database is an essential process. With this information you can effectively
define your tables and columns.
Logical Design
Logical database design helps you further define and assess your business’ information
requirements. Logical database design involves describing the information you need to
track and the relationships among those pieces of information.
Once you create a logical design, you can verify with the users of the database that the
design is complete and accurate. They can determine if the design contains all of the
information that must be tracked and that it reflects the relationships necessary to comply
with the rules of your business.
Table Relationships
In a relational database, tables relate to one another by sharing a common column. This
column, existing in two or more tables, allows you to join the tables. There are three types
of table relationships: one-to-one, one-to-many, and many-to-many.
A one-to-one relationship exists when each row in one table has only one related row in a
second table. For example, a university may decide to assign one faculty member to one
room. Thus, one room can only have one instructor assigned to it at a given time. The
university may also decide that a department can only have one Dean. Thus, only one
individual can be the head of a department.
A one-to-many relationship exists when each row in one table has many related rows in
another table. For example, one instructor can teach many classes.
A many-to-many relationship exists when a row in one table has many related rows in a
second table. Likewise, those related rows have many rows in the first table. A student can
enroll in many courses, and courses can contain many students.