You are on page 1of 15

DATABASE

Definition: A database is an organized collection of structured information, or data, that is stored


electronically in a computer system.

A database is usually controlled by a database management system (DBMS). Together, the data and the
DBMS, along with the applications that are associated with them, are referred to as a database system,
often shortened to just database.

Data within the most common types of databases in operation today is typically arranged in rows and
columns in a series of tables to make processing and data querying efficient. The data can then be easily
accessed, managed, modified, updated, controlled, and organized. Most databases use structured query
language (SQL) for writing and querying data.

What is Data?

In simple words, data can be facts related to any object in consideration. For example, your name, age,
height, weight, etc. are some data related to you. A picture, image, file, pdf, etc. can also be considered
data.

What’s the difference between a database and a spreadsheet?

Databases and spreadsheets (such as Microsoft Excel) are both convenient ways to store information.
The primary differences between the two are:

 How the data is stored and manipulated?


 Who can access the data?
 How much data can be stored?

Why use a database?

 Databases can store very large numbers of records efficiently (they take up little space).
 It is very quick and easy to find information.
 It is easy to add new data and to edit or delete old data.
 Data can be searched easily, eg 'find all Ford cars'.
 Update records in bulk

 Data can be sorted easily, for example into 'date first registered' order.
 Data can be imported into other applications, for example a mail-merge letter to a customer
saying that an MOT test is due.
 More than one person can access the same database at the same time - multi-access.
 Security may be better than in paper files.

Databases vs. Spreadsheets

Databases are different from spreadsheets in that they're better at storing large amounts of data and
manipulating it in various ways.
Here are just a few actions you can perform with a database that would be difficult, if not impossible, to
perform using a spreadsheet:

 Retrieve all records that match certain criteria


 Cross-reference records in different tables
 Perform complex aggregate calculations

Database uses

Databases provide an efficient way to store, retrieve and analyze data. While system files can function
similarly to databases, they are far less efficient. Databases are especially important for business and
research.

Computers can perform calculations far faster than humans, and they use programmed logic to make
decisions. However, computers are also capable of storing a tremendous amount of information, and
the amount of data computers can store continues to increase.

Databases are at the forefront of making this information available to programs and to computers.

Most medium and large companies rely on databases for the following:

- for storing customer information and accounting information.

- Researchers use databases, as well. Some of the largest databases in the world store weather
information. - There are simply too many weather data points for humans to analyze, and finding signs
of small but significant climate shifts would be impossible without databases.

- When a database holds details about people, it's likely to include their first name, surname and their
date of birth. In addition to this, specialist information is stored depending on the database's intended
use. Organizations use databases for a variety of reasons:

 the police have details of all known criminals in a database, eg crimes they've committed
 schools use a database to store details about their pupils, eg how many days they've been off
school sick
 a hospital will store details of all its patients in a database, eg a history of their health issues
 the Government uses a database to store records of people's income tax payments
 a database is used to keep track of all the drivers in the CBD of a town who have (or haven't)
paid the parking fee. A fine is issued when someone has not paid.

What is a database management system (DBMS)?

A database typically requires a comprehensive database software program known as a database


management system (DBMS). A DBMS serves as an interface between the database and its end users or
programs, allowing users to retrieve, update, and manage how the information is organized and
optimized. A DBMS also facilitates oversight and control of databases, enabling a variety of
administrative operations such as performance monitoring, tuning, and backup and recovery.

Some examples of popular database software or DBMSs include MySQL, Microsoft Access, Microsoft
SQL Server, FileMaker Pro, Oracle Database, and dBASE.
DATABASE DESIGN

A database includes bulk information deposited in a framework, making it easier to locate and explore
relevant information. A well-designed database contains accurate and up-to-date information, allowing
data to be fetched easily whenever needed. It is easy to understand the importance of a database for a
company dealing with heaps of data regularly. However, it is significant to note that it requires a data
design that can make analysis faster and reliable.

What is Database Design?

A good database design process is governed by specific rules. The first rule dictates that redundant data
must be avoided; as it wastes space and increases the probability of faults and discrepancies within the
database.

The next rule is that the accuracy and comprehensiveness of information is extremely imperative. If the
database contains erroneous information, any documents that fetch data from such a database will also
include inaccurate information. Consequently, any decisions based on those documents will be
misleading, thus, increasing the importance of a database design that caters to all of the above rules.

So, how can you ensure that your database design is good? A well-designed database is the one that:

1. Distributes your data into tables based on specific subject areas to decrease data
redundancy
2. Delivers the database the information needed to link the data in the tables
3. Provides support, and guarantees the precision and reliability of data
4. Caters to your information processing and reporting requirements
5. Functions interactively with the database operators as much as possible

Importance of Database Design

Database design defines the database structure used for planning, storing, and managing information.
Accuracy in data can only be accomplished if a database is designed to store only valuable and necessary
information.

A well-designed database is important in guaranteeing information consistency, eliminating redundant


data, efficiently executing queries, and improving the performance of the database.

A good database design also allows you to easily access and retrieve data whenever needed.

The reliability of data depends on the table structure; whereas creating primary and unique keys
guarantees uniformity in the stored information.

Data replication can be avoided by forming a table of probable values and using a key to denote the
value. So, whenever the value changes, the alteration happens only once in the main table.

As the general performance of a database depends on its design, a good database design uses simple
queries and faster implementation. It is easy to maintain and update; whereas fixing trivial interruptions
in a poor database design may harm stored events, views, and utilities.
Database Development Life Cycle

There are various stages in database development. However, it is not necessary to follow each of the
steps sequentially. The life cycle can be broadly divided into three steps: requirement analysis, database
designing, and implementation.

1- Requirement Analysis

Requirement analysis requires two steps:

 Planning: In this stage, the plan of the entire Database Development Life Cycle is decided. It also
requires an analysis of the organization’s information systems strategy.

 Defining the system: This stage explains and lays out the proposed database system’s scope.

2- Database designing

The actual database designing takes into account two key models:

 Logical model: It is concerned with using the given requirements to create a database model.
The complete design is laid out on paper at this stage, without considering any specific DBMS
requirement or physically implementing it.

 Physical model: This stage comes after the logical model and therefore involves physically
implementing the logical model. It takes the DBMS and other physical implementation factors
into consideration.

3- Implementation

The implementation stage of the database development life cycle is concerned with:

 Data conversion and loading: It comprises data importation and data conversion coming from
the old system into the new database.

 Testing: Finally, this stage identifies errors in the new system and make sure if all the database
requirement specification is met.

DATABASE DESIGNING TECHNIQUES

The two most common techniques used to design a database include:

 Normalization: Tables are organized in such a way that it decreases data redundancy and
dependency. Larger tables are divided into smaller tables and are linked together using
relationships.

 Entity-Relationship (ER) Modeling: It’s a graphical database design approach that models
entities, their attributes, and defines relationships among these entities to signify real-life
objects. An entity is any real-world item that’s different or unique from the surroundings.

How to Design Database: Steps of Designing Database

Database designing generally starts with identifying the purpose of your database. The relevant data is
then collected and organized into tables. Next, you specify the primary keys and analyze relationships
between different tables for an efficient data design. After refining the tables, the last step is to apply
normalization rules for table standardization.

Let’s look at these steps of the database design process in detail:

STEP I: Define the objective of your database

The first step is to determine the purpose of your database. For example, if you are a small home-based
business, you could be designing a customer database that maintains a list of consumer info to generate
emails and reports. Hence, understanding the importance of a database is vital.

At the end of this step, you’ll have a strong mission statement that you can refer to throughout the
database design process. It’ll help you concentrate on your objectives when making important decisions.

STEP 2: Locate and consolidate the necessary data

The next step is to collect all kinds of information that you might want to store in the database. Begin
with the current information. Mull over the questions you want your database to answer, and it’ll help
you decide which data needs to be recorded.

STEP 3: Distribute the data into tables

Once you’ve amassed all the necessary data items, the next step is to divide them into main entities or
subject areas. For example, if you are a retailer, some of your main entities could be products,
customers, suppliers, and orders. Each entity will then become a separate table.

STEP 4: Change data items into columns

Data is segregated into tables, such that every data item becomes a field and is shown as a column. For
instance, a Customer table might include fields like name, address, e-mail address, and city.

After determining the preliminary set of columns for every table, you can refine them. For instance,
customer name can be recorded as two distinct columns: first name and last name. Likewise, you can
store the address in five distinct columns based on address, town, state, zip code, and region. This will
make it convenient for you to filter information.

STEP 5: Identify primary keys

The next step to improve your database design is to select a primary key for every table. This primary
key is a column or a set of column that’s used to distinctively pinpoint each row. For instance, in your
customer table, the primary key could be customer ID. This will allow you to uniquely identify each row
based on the customer ID.

More than one primary key can also exist, called a composite key, including multiple columns. For
example, in your Order Details table, primary keys could be order ID and product ID. The composite key
can be made using fields with similar or varying data types.

Similarly, if you wish to get an idea of your product sales, you can identify the product ID from the
Products table and the order number or ID from the Orders table.

STEP 6: Determine how tables are related


After dividing data into tables, information needs to be brought together in a meaningful manner. So,
explore each table and determine how the data in one table is linked with the data in another table. If
needed, you can add fields or form new tables to simplify the relationship based on the types of
information.

Below is an example of different entity types and relationship types.

In this step, you’ll create one-to-one, one-to-many, and/or many-to-many relationships between
different table entries.

When only one item from a table is associated with an item from another table, it’s called a one-to-one
(1:1) relationship. In a one-to-many (1:M) relationship, an item in one table is related to many items in
the other table, such as one customer placing several orders. A many-to-many (M:N) relationship occurs
if many items from one table are related to many items in other tables.
STEP 7: Enhance your database design

Now that you have all the required tables, fields, and relationships, the next step is to refine your
database design by creating and populating your tables with mockup information. Experiment with the
sample data by creating queries or adding new items. This will help you analyze your design for faults
and you’ll be able to highlight possible errors. If needed, adjust your design to mitigate those problems.

STEP 8: Implement the normalization rules

The last step is to implement the normalization rules for your database design. It is a systematic
approach that removes redundancy and unwanted characteristics, such as Insertion, Update, and
Deletion irregularities.

This multi-step process stores data in a tabular form, eliminating redundant data from the relation
tables.

Summary

The database design process helps you simplify the design, development, execution, and maintenance
of your corporate data management system.

A good database design can help save disk storage space by reducing data redundancy. Along with
maintaining data precision and reliability, it allows you to access data in various ways. Moreover, a well-
designed database is easier to use and maintain, making integration a breeze.

Characteristics of a good database:

 The database should be strong enough to store all the relevant data and requirements.

 Should be able to relate the tables in the database by means of a relation, for example, an
employee works for a department so that employee is related to a particular department. We
should be able to define such a relationship between any two entities in the database.

 Multiple users should be able to access the same database, without affecting the other user. For
example, several teachers can work on a database to update learners’ marks at the same time.
Teachers should also be allowed to update the marks for their subjects, without modifying other
subject marks.

 A single database provides different views to different users, it supports multiple views to the
user, depending on his role. In a school database, for example, teachers can see the breakdown
of learners’ marks; however, parents are only able to see only their child’s report – thus the
parents’ access would be read only. At the same time, teachers will have access to all the
learners’ information and assessment details with modification rights. All this is able to happen
in the same database.

 Data integrity refers to how accurate and consistent the data in a database is. Databases with
lots of missing information and incorrect information is said to have low data integrity.

 Data independence refers to the separation between data and the application (or applications)
in which it is being used. This allows you to update the data in your application (such as fixing a
spelling mistake) without having to recompile the entire application.
 Data Redundancy refers to having the exact same data at different places in the database. Data
redundancy Increases the size of the database, creates Integrity problems, decreases efficiency
and leads to anomalies. Data should be stored so that It Is not repeated in multiple tables.

 Data security refers to how well the data in the database is protected from crashes, hacks and
accidental deletion.

 Data maintenance refers to monthly, daily or hourly tasks that are run to fix errors within a
database and prevent anomalies from occurring. Database maintenance not only fixes errors,
but it also detects potential errors and prevents future errors from occurring.

There are also many people involved with organizing a well-run database. These are:

 the developers, who design and develop the database to suit the needs of an enterprise
 the Database Administrator, who:
 checks the database for its usages
 who is checking it
 provides access to other uses
 provides any other maintenance work required to keep the database up to date
 the End user, who uses the database, for example, teachers or parents.

DATABASE OBJECTS

Databases in Ms Access are composed of four objects: tables, queries, forms, and reports. Together,
these objects allow you to enter, store, analyze, and compile your data however you want.

Anything which we make from a create command is known as Database Object. It can be used to hold
and manipulate the data. Some of the examples of database objects are : tables view, sequence,
indexes, etc.

Tables

In summary, a database is a collection of data organized into many connected lists. In Ms Access, all
data is stored in tables, which puts tables at the heart of any database.

Tables are organized into vertical columns and horizontal rows.

In Access, rows and columns are referred to as records and fields. A field is more than just a column; it’s
a way of organizing information by the type of data it is. Every piece of information within a field is of
the same type. For example, every entry in a field called First Name would be a name, and every entry
in field called Street Address would be an address.

Forms - Forms are objects through which a user can add, edit, or display the data stored in a database.
Forms in Ms Access are like display cases in stores that make it easier to view or get the items that you
want.

A form is a window or screen that contains numerous fields, or spaces to enter data. Each field holds a
field label so that any user who views the form gets an idea of its contents. A form is more user friendly
than generating queries to create tables and insert data into fields.
Forms are used for entering, modifying, and viewing records. You likely have had to fill out forms on
many occasions, like when visiting a doctor's office, applying for a job, or registering for school. The
reason forms are used so often is that they're an easy way to guide people toward entering data
correctly. When you enter information into a form in Access, the data goes exactly where the database
designer wants it to go: in one or more related tables.

Queries - Queries are a way of searching for and compiling data from one or more tables. Running a
query is like asking a detailed question of your database. When you build a query in Access, you are
defining specific search conditions to find exactly the data you want.

Queries are far more powerful than the simple searches you might carry out within a table. While a
search would be able to help you find the name of one customer at your business, you could run a query
to find the name and phone number of every customer who's made a purchase within the past week. A
well-designed query can give information you might not be able to find just by looking through the data
in your tables.

Report - Reports offer you the ability to present your data in print. If you've ever received a computer
printout of a class schedule or a printed invoice of a purchase, you've seen a database report. Reports
are useful because they allow you to present components of your database in an easy-to-read format.
You can even customize a report's appearance to make it visually appealing. Access offers you the ability
to create a report from any table or query.

The Purpose of Reports.

Reports communicate information which has been compiled as a result of research and analysis of data
and of issues. Reports can cover a wide range of topics, but usually focus on transmitting information
with a clear purpose, to a specific audience.

Forms allow you to both add data to tables and view data that already exists. Reports present data from
tables and also from queries, which then search for and analyze data within these same tables.

View – This database object is used to create a view in database. A view is a logical table based on a
table or another view. A view contains no data of its own but is like a window through which data from
tables can be viewed or changed. The tables on which a view is based are called base tables. The view is
stored as a SELECT statement in the data dictionary.

Sequence – This database object is used to create a sequence in database. A sequence is a user created
database object that can be shared by multiple users to generate unique integers. A typical usage for
sequences is to create a primary key value, which must be unique for each row. The sequence is
generated and incremented (or decremented) by an internal Oracle routine.

Index – This database object is used to create a indexes in database. An Oracle server index is a schema
object that can speed up the retrieval of rows by using a pointer. Indexes can be created explicitly or
automatically. If you do not have an index on the column, then a full table scan occurs.

An index provides direct and fast access to rows in a table. Its purpose is to reduce the necessity of disk
I/O by using an indexed path to locate data quickly. The index is used and maintained automatically by
the Oracle server. Once an index is created, no direct activity is required by the user. Indexes are
logically and physically independent of the table they index. This means that they can be created or
dropped at any time and have no effect on the base tables or other indexes.

Synonym – This database object is used to create a indexes in database. It simplifies access to objects by
creating a synonym (another name for an object). With synonyms, you can Ease referring to a table
owned by another user and shorten lengthy object names. To refer to a table owned by another user,
you need to prefix the table name with the name of the user who created it followed by a period.
Creating a synonym eliminates the need to qualify the object name with the schema and provides you
with an alternative name for a table, view, sequence, procedure, or other objects. This method can be
especially useful with lengthy object names, such as views.

In the syntax:
PUBLIC : creates a synonym accessible to all users
synonym : is the name of the synonym to be created
object : identifies the object for which the synonym is created

TYPES OF DATABASES

There are many different types of databases. The best database for a specific organization depends on
how the organization intends to use the data.

Relational databases: Items in a relational database are organized as a set of tables with columns and
rows. Relational database technology provides the most efficient and flexible way to access structured
information.

Object-oriented databases: Information in an object-oriented database is represented in the form of


objects, as in object-oriented programming.

DATABASE MODELS

A database model shows the logical structure of a database, including the relationships and constraints
that determine how data can be stored and accessed. Individual database models are designed based on
the rules and concepts of whichever broader data model the designers adopt. Most data models can be
represented by an accompanying database diagram.

Types of database models

There are many kinds of data models. Some of the most common ones include:

 Hierarchical database model

 Relational model

 Network model

 Object-oriented database model


 Entity-relationship model

 Document model

 Entity-attribute-value model

 Star schema

 The object-relational model, which combines the two that make up its name

You may choose to describe a database with any one of these depending on several factors. The biggest
factor is whether the database management system you are using supports a particular model. Most
database management systems are built with a particular data model in mind and require their users to
adopt that model, although some do support multiple models.

In addition, different models apply to different stages of the database design process. High-level
conceptual data models are best for mapping out relationships between data in ways that people
perceive that data. Record-based logical models, on the other hand, more closely reflect ways that the
data is stored on the server.

Selecting a data model is also a matter of aligning your priorities for the database with the strengths of a
particular model, whether those priorities include speed, cost reduction, usability, or something else.

Relational model

The most common model, the relational model sorts data into tables, also known as relations, each of
which consists of columns and rows. Each column lists an attribute of the entity in question, such as
price, zip code, or birth date. Together, the attributes in a relation are called a domain. A particular
attribute or combination of attributes is chosen as a primary key that can be referred to in other tables,
when it’s called a foreign key.

Each row, also called a tuple, includes data about a specific instance of the entity in question, such as a
particular employee.

The model also accounts for the types of relationships between those tables, including one-to-one, one-
to-many, and many-to-many relationships. Here’s an example:
Within the database, tables can be normalized, or brought to comply with normalization rules that make
the database flexible, adaptable, and scalable. When normalized, each piece of data is atomic, or broken
into the smallest useful pieces.

Relational databases are typically written in Structured Query Language (SQL). The model was
introduced by E.F. Codd in 1970.

Hierarchical model

The hierarchical model organizes data into a tree-like structure, where each record has a single parent
or root. Sibling records are sorted in a particular order. That order is used as the physical order for
storing the database. This model is good for describing many real-world relationships.

This model was primarily used by IBM’s Information Management Systems in the 60s and 70s, but they
are rarely seen today due to certain operational inefficiencies.

Network model
The network model builds on the hierarchical model by allowing many-to-many relationships between
linked records, implying multiple parent records. Based on mathematical set theory, the model is
constructed with sets of related records. Each set consists of one owner or parent record and one or
more member or child records. A record can be a member or child in multiple sets, allowing this model
to convey complex relationships.

It was most popular in the 70s after it was formally defined by the Conference on Data Systems
Languages (CODASYL).

Object-oriented database model

This model defines a database as a collection of objects, or reusable software elements, with associated
features and methods. There are several kinds of object-oriented databases:

A multimedia database incorporates media, such as images, that could not be stored in a relational
database.

A hypertext database allows any object to link to any other object. It’s useful for organizing lots of
disparate data, but it’s not ideal for numerical analysis.

The object-oriented database model is the best known post-relational database model, since it
incorporates tables, but isn’t limited to tables. Such models are also known as hybrid database models.
Object-relational model

This hybrid database model combines the simplicity of the relational model with some of the advanced
functionality of the object-oriented database model. In essence, it allows designers to incorporate
objects into the familiar table structure.

Languages and call interfaces include SQL3, vendor languages, ODBC, JDBC, and proprietary call
interfaces that are extensions of the languages and interfaces used by the relational model.

Entity-relationship model

This model captures the relationships between real-world entities much like the network model, but it
isn’t as directly tied to the physical structure of the database. Instead, it’s often used for designing a
database conceptually.

Here, the people, places, and things about which data points are stored are referred to as entities, each
of which has certain attributes that together make up their domain. The cardinality, or relationships
between entities, are mapped as well.
A common form of the ER diagram is the star schema, in which a central fact table connects to multiple
dimensional tables.

You might also like