CH1 Notes
CH1 Notes
CH1 Notes
Applications: - It can be considered as a user friendly web page where the user enters the requests.
Here he simply enters the details that he needs and presses buttons to get the data.
End User: - They are the real users of the database. They can be developers, designers, administrator
or the actual users of the database.
DDL: - Data Definition Language (DDL) is a query fired to create database, schema, tables, mappings
etc in the database. These are the commands used to create the objects like tables, indexes in the
database for the first time. In other words, they create structure of the database.
DDL Compiler: - This part of database is responsible for processing the DDL commands. That means
these compilers actually breaks down the command into machine understandable codes. It is also
responsible for storing the metadata information like table name, space used by it, number of columns
in it, mapping information etc.
DML Compiler: - When the user inserts, deletes, updates or retrieves the record from the database,
he will be sending request which he understands by pressing some buttons. But for the database to
work/understand the request, it should be broken down to object code. This is done by this compiler.
One can imagine this as when a person is asked some question, how this is broken down into waves
to reach the brain!
Query Optimizer: - When user fires some request, he is least bothered how it will be fired on the
database. He is not all aware of database or its way of performance. But whatever be the request, it
should be efficient enough to fetch, insert, update or delete the data from the database. The query
optimizer decides the best way to execute the user request which is received from the DML compiler.
It is similar to selecting the best nerve to carry the waves to brain!
Stored Data Manager: - This is also known as Database Control System. It is one the main central
system of the database. It is responsible for various tasks
It converts the requests received from query optimizer to machine understandable form. It makes
actual request inside the database. It is like fetching the exact part of the brain to answer.
It helps to maintain consistency and integrity by applying the constraints. That means, it does not
allow inserting / updating / deleting any data if it has child entry. Similarly it does not allow entering
any duplicate value into database tables.
It controls concurrent access. If there is multiple users accessing the database at the same time, it
makes sure, all of them see correct data. It guarantees that there is no data loss or data mismatch
happens between the transactions of multiple users.
It helps to backup the database and recover data whenever required. Since it is a huge database and
when there is any unexpected exploit of transaction, and reverting the changes are not easy. It
maintains the backup of all data, so that it can be recovered.
Data Files: - It has the real data stored in it. It can be stored as magnetic tapes, magnetic disks or
optical disks.
Compiled DML: - Some of the processed DML statements (insert, update, delete) are stored in it so
that if there is similar requests, it will be re-used.
Data Dictionary: - It contains all the information about the database. As the name suggests, it is the
dictionary of all the data items. It contains description of all the tables, view, materialized views,
constraints, indexes, triggers etc.
Structure of DBMS:
DBMS (Database Management System) acts as an interface between the user and the database. The
user requests the DBMS to perform various operations such as insert, delete, update and retrieval on
the database.
The components of DBMS perform these requested operations on the database and provide necessary
Components of a DBMS
Functions of DBMS:
o DBMS free the programmers from the need to worry about the organization and location
of the data i.e. it shields the users from complex hardware level details.
o DBMS can organize process and present data elements from the database. This capability
enables decision makers to search and query database contents in order to extract
answers that are not available in regular Reports.
o Programming is speeded up because programmer can concentrate on logic of the
application.
o It includes special user friendly query languages which are easy to understand by non
programming users of the system.
o Authorization services like log on to the DBMS start the database stop the Database etc.
o Transaction supports like Recovery, Rollback etc,
o Import and Export of Data.
o Maintaining data dictionary
o User's Monitoring
Entity-Relationship Model
Entity-Relationship (ER) Model is based on the notion of real-world entities and relationships among
them. While formulating real-world scenario into the database model, the ER Model creates entity
set, relationship set, general attributes and constraints.
ER Model is best used for the conceptual design of a database.
ER Model is based on − Entities and their attributes. Relationships among entities.
Entity − An entity in an ER Model is a real-world entity having properties called attributes. Every
attribute is defined by its set of values called domain. For example, in a school database, a student is
considered as an entity. Student has various attributes like name, age, class, etc.
Relationship − The logical association among entities is called relationship. Relationships are mapped
with entities in various ways. Mapping cardinalities define the number of association between two
entities.
Hierarchical Model
This database model organises data into a tree-like-structure, with a single root, to which all the other
data is linked. The hierarchy starts from the Root data, and expands like a tree, adding child nodes to
the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like index of a book, recipes etc.
In hierarchical model, data is organised into tree-like structure with one one-to-many relationship
between two different types of data, for example, one department can have many courses, many
professors and of-course many students.
Network Model
This is an extension of the Hierarchical model. In this model data is organised more like a graph, and
are allowed to have more than one parent node.
In this database model data is more related as more relationships are established in this database
model. Also, as the data is more related, hence accessing the data is also easier and fast. This database
model was used to map many-to-many data relationships.This was the most widely used database
model, before Relational Model was introduced.