Lesson 2
Lesson 2
Database Design
Database Design is a collection of processes that facilitate the designing, development, implementation
and maintenance of enterprise data management systems. Properly designed database are easy to
maintain, improves data consistency and are cost effective in terms of disk storage space. The database
designer decides how the data elements correlate and what data must be stored.
The main objectives of database design in DBMS are to produce logical and physical designs models of the
proposed database system.
The logical model concentrates on the data requirements and the data to be stored independent of physical
considerations. It does not concern itself with how the data will be stored or where it will be stored
physically.
The physical data design model involves translating the logical DB design of the database onto physical
media using hardware resources and software systems such as database management systems (DBMS).
Database design process in DBMS is crucial for high performance database system. Note that the genius
of a database is in its design. Data operations uses SQL.
Database development life cycle
The database development life cycle has a number of stages that are followed when developing database
systems.
The steps in the development life cycle do not necessarily have to be followed religiously in a sequential
manner.
On small database systems, the process of database design is usually very simple and does not involve a
lot of steps.
In order to fully appreciate the above diagram, let’s look at the individual components listed in each step for
overview of design process in DBMS.
Requirements analysis
▪ Planning – This stages of database design concepts are concerned with planning of entire
Database Development Life Cycle. It takes into consideration the Information Systems strategy of
the organization.
▪ System definition – This stage defines the scope and boundaries of the proposed database
system.
Database designing
▪ Logical model – This stage is concerned with developing a database model based on
requirements. The entire design is on paper without any physical implementations or specific
DBMS considerations.
▪ Physical model – This stage implements the logical model of the database taking into account the
DBMS and physical implementation factors.
Implementation
▪ Data conversion and loading – this stage of relational databases design is concerned with
importing and converting data from the old system into the new database.
▪ Testing – this stage is concerned with the identification of errors in the newly implemented system.
It checks the database against requirement specifications.
▪ Normalization - is a database design technique that reduces data redundancy and eliminates
undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules
divides larger tables into smaller tables and links them using relationships. The purpose of
Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored logically.
▪ ER Modeling - Entity Relationship Model (ER Modeling) is a graphical approach to database
design. It is a high-level data model that defines data elements and their relationship for a specified
software system. An ER model is used to represent real-world objects.
Data Models
Elements of Database
Database elements are the group of objects or entities that makes up a database. They include tables,
indexes, data elements, database schemas, fields, columns, records, rows, keys, relationships, and data
types.
1. Table
The table is the simplest and primary unit of organization and storage of data in a database. You
need this database element to modify and check for stored data.
When there is more than one table containing a database, they are always connected by what we
call a relationship.
The relationship between the related tables makes it easy to link them together and figure out what
they have in common. A table is a composition of related data items, usually with a unique identity.
A table is usually in rows (horizontal) and columns (vertical), all arranged physically in a grid model.
Every row and column intersect at a point called a cell. Each cell contains data of unique identity as
every data can only be accessed by their names.
2. Column/Fields
A column, commonly called a field, is a particular type of data on a table. It is believed that a
column only exists in a table, while an attribute exists in an entity.
On the contrary, attributes can be columns, and entities can form a table against the previous
immediate claim when a business model transforms into a database model.
A column is the smallest storage element in any database and depicts related records of a table. A
unique data type is given to every column. The data entered into the table will be dependent on the
table's data types.
3. Schema
A database schema represents groups of related objects in a database. Some objects might be
related to one another in a schema.
This database element gives access to just a single owner who has exclusive access to modify,
reclassify and manipulate the makeup of objects found within a schema. It is always linked to a
particular or unique user account in a database for specific purposes.
▪ The Conceptual Model. The conceptual model is otherwise known as the logical model. It
is referred to as the fundamental model in a database. A conceptual model is
characterized by organizational and physical structures usually used to understand
database structures like views, indexes, and constraints.
▪ The Internal Model. The internal model is also known as the physical model. Just as its
name implies, it majors on the physical storage in a database. Additionally, the internal
model regulates access to data in a database. Finally, it helps distinguish between the
hardware's physical specifications and the OS (Operating System) initiated by the
database model.
▪ The External Model. The external model is commonly known as the application interface.
With the application interface, users might be able to access schema in many ways, like
the data input. It makes establishing a relationship between the database model and user
application feasible.
4. Row
A row is the collection of vertical records in a database. The population of rows in a table is not
constant. A collection of data in a row is also known as a tuple.
5. Data types
Data types control the type of data you can enter in a column. The following are the available data
types:
▪ Numeric data types can only be used to store numeric values, that is, numbers.
▪ Alphanumeric data types consist of alphabetical characters, numerical values, and a
combination of both. However, the alphanumeric data type only considers stored numeric
data values as alphabetical characters, not numbers.
▪ Date and Time data types enable the storage of data and time. This data type varies with
the Relational Database Management System (RDBMS) employed.
▪ Other types
6. Keys
A key is an entity of a database that is used to identify or point out desired data in a table. This
database element is usually most associated with just a single column and could be more than one
column at times.
▪ Primary Keys. Primary Keys combine single or multiple-column values obtained from a
table. Moreover, a primary key will not allow duplicate entries even if the table does not
have the fundamental identity of table values like SSN, school, and examination
registration numbers that are unique. These table values are never the same and can be
set as a primary key in a database.
▪ Foreign Keys. Foreign keys always have primary keys or keys as references in a different
table. Primary keys are considered the mother table, while the foreign key is the child
table. It helps to create a relationship between two tables.
7. Relationship
There are various tables in a database that are related. A relational database is a modern
database that creates links between tables using primary and foreign keys.
Entering data in a table and creating links between tables helps to reduce data redundancy in the
relational database. There are three types of relationships in a table under the database elements.
Before you can actually begin designing a database, you must understand what data the database needs
to store and how that data will be used. It is tempting to think you understand the gist of what is going on
and start sketching out tables and columns, but it is always better to wait. Gather information.
Make sure that you understand exactly what the customer needs to store in the database and why.
Gathering information is a complex task. Most projects have many facets that need to be accounted for. It
can be quite daunting, but there are some basic steps to help you proceed.
▪ Initial interviews with the chief stakeholders (the managers or executives initiating the database
project)
▪ Review of business documents to identify data elements
▪ Interviews with stakeholders
▪ Questionnaires
▪ Work shadowing (observing the flow of information)
Database Requirement
A database requirement is something the database needs to have or do in order to meet the business
needs of the organization for which it is being built.
Business rules describe the rules that govern the way data are acquired, stored, and used by the business.
They are important for a database developer, who must make sure the database he or she develops can
support all the business rules and operations. Some of the business rules can be enforced directly in the
database.
Example:
▪ A SHIP DATE cannot be prior to an ORDER DATE for any given order.
▪ A customer with a "Preferred" status receives a 15% discount on all purchases.
The basic building blocks of all data models are entities, attributes, relationships, and constraints.
An entity is a person, place, thing, or event about which data will be collected and stored. An entity
represents a particular type of object in the real world, which means an entity is “distinguishable”—that is,
each entity occurrence is unique and distinct.
A constraints rules or conditions applied to database data ensuring data integrity, consistency and
adherence to business rules.
- END OF LESSON 2 -