CH-1 Database System Concepts
CH-1 Database System Concepts
Contents:
1. Concept of Data, database, DBMS, advantages of DBMS over file Processing system, Application
of database.
2. Three level architecture for database system.
3. Data abstraction: Different level of Data abstraction, Instance and schema, Data independence-
Logical and Physical independence.
4. Overall Structure of DBMS.
5. Data Modelling: Record based logical model- Relation, Network, Hierarchical.
6. Data Modelling using the E-R Model: Entity Relationship Model, Strong Entity set, Weak Entity
set, Types of Attributes, E-R Diagrams.
1. An Introduction to Database
Q. Define the following terms: (i) Data (ii) Database (ii) DBMS (3 Marks)
Disadvantages of DBMS
1. Increased Cost: DBMS implementation cost is high compared to the file system.
2. Complexity: Database systems are complex to understand
3. Performance: Database systems are generic, making them suitable for various applications. However
this feature affect their performance for some applications
4. Size: They are large in size.
5. Higher impact of a failure: The DBMS is placed at centralized location if the failure of any
component can bring operations to a halt.
2. Library Management System: There are thousands of books in the library so it is very difficult to
keep record of all the books in a copy or register. So DBMS used to maintain all the information
relate to book issue dates, name of the book, author and availability of the book
3. Banking: Customer inquiry, accounts, loans, and other transactions.
4. Education: Course registration, result, and other information.
5. Telecommunications: Communication network, telephone numbers, record of calls, for
generating monthly bills, etc.
6. E-commerce: Business activity such as online shopping, booking of holiday package,
consulting adoctor, etc.
7. Human resources: Organizations use database for storing information about their employees,
salaries, benefits, taxes, and for generating salary checks.
8. Military: Military keeps records of millions of soldiers and it has millions of files that should be
keep secured and safe. As DBMS provides a big security assurance to the military information so it is
widely used in militaries. One can easily search for all the information about anyone within seconds
with the help of DBMS.
9. Web based services:-For web user’s feedback, responses, resource sharing etc.
10. Sales: - For customer, product & purchase information.
1. External level
It is also called view level. The reason this level is called “view” is because several users can view their desired
data from this level which is internally fetched from database with the help of conceptual and internal level
mapping.
The user doesn’t need to know the database schema details such as data structure, table definition etc. user is
only concerned about data which is what returned back to the view level after it has been fetched from database
(present at the internal level).
External level is the “top level” of the Three Level DBMS Architecture.
2. Conceptual level
It is also called logical level. The whole design of the database such as relationship among data, schema of data
etc. are described in this level.
Database constraints and security are also implemented in this level of architecture. This level is maintained by
DBA (database administrator).
3. Internal level
This level is also known as physical level. This level describes how the data is actually stored in the storage
devices. This level is also responsible for allocating space to the data. This is the lowest level of the
architecture.
3. Data abstraction: Different level of Data abstraction, Instance and schema, Data independence-
Logical and Physical independence.
Instance :- ( Definition)
• Definition: The data stored in the database at a particular moment of time is called an “instance”
or a database state.
• Every time we update (i.e. insert, delete or modify) the value of a data item in record, that
time onestate of the database changes into another state.
Schema:-
• Definition: Design of a database is called the schema.
• A database schema is the skeleton structure that represents the logical view of the entire database.
• A database schema defines its entities and the relationship among them.
For example: An employee table in database exists with the following attributes:
This is the schema of the employee table. Schema defines the attributes of tables in the database.
Query Processor helps the database system, simplify and facilitate access to data.
o It also executes the user request which is received from the DML compiler.
a). DDL Interpreter: DDL interpreter converts DDL statements (like schema definition) into a set of
tables containing meta data or data dictionary.
b). DML Compiler: It translates DML statements ( like select, insert, update, delete) into low level
instructions (object code), so that query evaluation engine understands.
c). Embedded DML pre-compiler:It processes DML statements embedded in an application program
into procedural calls.
d). Query Evaluation Engine: It executes low-level instructions (object code) generated by the DML
compiler.
2. Storage Manager:-
Storage Manager is & program that provides an interface between the data stored in the
database and the queries received.
The storage manager is responsible for the interaction with the file manager.
The storage manager translates the various DML statements into low-level file-system commands
Thus, It is responsible for updating, storing, deleting, and retrieving data in the database.
a). Authorization and Integrity Manager: It checks the authority of users to access data and checks
the integrity constraints when the database is modified.
b). Transaction Manager : It ensures that the database remains in a consistent (correct) state despite
system failures, and that concurrent transaction executions proceed without conflicting
It manages the allocation of space on disk storage and the data structures used to represent information
stored on disk
It is responsible for fetching data from disk storage into main memory, and deciding what data to
cache in main memory.
a). Data Dictionary : It stores Metadata(data about data) about the structure of the database.
b). Data Files : It stores the database.
c). Indices : It provides faster retrieval of data item.
d). Statistical Data: It stores statistical information about the data in the database. This information
is used by query processor to select efficient ways to execute query.
4.2 Database Users (IMP)
1. Naive Users: -
• Naive means Lacking Experience (untrained) these are the users who need not be aware of the
presence of the Data Base System.
• Example of these type of users is the user of an ATM machine. Because these users only responds
to the instructions displayed on the screen (enter your pin number, click here, enter the required
money etc.). Obviously operations performed by these users are very limited.
2. Application Programmers: -
• Professional / Application programmers are those who are responsible for developing application
programs or user interface. The application programs could be written in a general-purpose
programming language or the commands available to manipulate a database.
• For example: Writing a C program to generate the report of employees who are working in
particular department, will involve a query to fetch the data from database. It will include a
embedded SQL query in the C Program.
3. Sophisticated Users:-
• Simply we can say that these are the EXPERIENCED users. These people interact with the
system without writing programs. They form requests by writing queries in database query
language.
• Sophisticated users are the users who are familiar with the structure of database & facilities of
DBMS.
4. Specialized Users:-
• These are the sophisticated users who write specialized database applications.
• For example computer aided design (CAD) systems, knowledge-based and expert systems.
5. Database Administrator:-
• It is responsible for managing the whole database system.
• He/She designs, creates & maintains the database.
• He/She manages the users who can access this db & controls integrity issues.
6. Database Designers:-
• Database designers are the computer professionals which responsible for developing db
orientedapplication /software's.
4.3 Functions of Database Administrator (DBA) (IMP)
Q. List four function of database administrator. (List any four function - 1 Mark each)
• The DBA (Database Administrator) is a person or group of persons who is responsible
for the management of the database.
• The person having central control over the system is called DBA. The functions of DBA are listed
below:-
1. Schema Definition: - The Database Administrator creates the database schema by executing DDL
statements. Schema includes the logical structure of database table (Relation) like data types of
attributes, length of attributes, integrity constraints etc.
2. Storage structure and access method definition: - Database tables or indexes are stored
in the following ways: Flat files, Heaps, B+ Tree etc.
3. Schema and physical organization modification: - The DBA carries out changes to the
existingschema and physical organization.
4. Granting authorization for data access:-
• The DBA provides different access rights to the users according to their level. Ordinary
users might have highly restricted access to data.
• DBA is responsible for granting the access to the database.
5. Integrity- Constraint specification: Integrity constraints are written by DBA and they are
stored in aspecial file, which is accessed by database manager, while updating the data.
6. Routine Maintenance: - Some of the routine maintenance activities of a DBA is given below.
a) Taking backup of database periodically
b) Ensuring enough disk space is available all the time.
c) Monitoring jobs running on the database.
d) Ensure that performance is not degraded by some expensive task submitted by some users.
e) Performance Tuning
Advantages
Simplicity
Security
Database Integrity
Efficiency
Disadvantages
Complexity of Implementation
Difficulty in Management
Poor Portability
Advantages
Simplicity
Ease of Use
Accuracy
Data Integrity
Security
Disadvantages
Maintenance Problem
Cost
Physical Storage
Lack of Scalability
Complexity in Structure
Decrease in performance over time
1. Entity
An entity is an object or component of data. An entity is represented as rectangle in an ER diagram.
For example: In the following ER diagram we have two entities Student and College and these two entities have
many to one relationship as many students study in a single college. We will read more about relationships later,
for now focus on entities.
Strong entity: The strong entity always have primary key. Its existence is not dependent on any other entity i.e.
it is independent of other entity.
Weak Entity:
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with other entity
is called weak entity. The weak entity is represented by a double rectangle. For example – a bank account
cannot be uniquely identified without knowing the bank to which the account belongs, so bank account is a
weak entity.
2. Attribute
Types of Attributes
Q. Define attribute. (1 Mark)
Q. Explain single value and multi value attribute of E-R model. (4 Marks)
Q. Explain any 4 types of attributes (4 Marks)
An attribute describes the property of an entity. An attribute is represented as Oval in an ER diagram. There are
four types of attributes:
1. Simple attribute
2. Key attribute
3. Composite attribute
4. Multivalued attribute
5. Derived attribute
6. NULL Attribute
1. Simple attribute
Simple attributes can’t be divided any further. For example, a student’s contact number. It is also called an
atomic value.
Following are the example of a simple attribute:
Id of the Employee can be a simple attribute,
Salary of the Employee can be a simple attribute,
Age and class of the student can be a simple attribute, etc.
2. Key attribute:
A key attribute can uniquely identify an entity from an entity set. For example, student roll number can uniquely
identify a student from a set of students. Key attribute is represented by oval same as other attributes however
the text of key attribute is underlined.
3. Composite attribute:
An attribute that is a combination of other attributes is known as composite attribute. For example, In student
entity, the student address is a composite attribute as an address is composed of other attributes such as pin
code, state, country.
4. Multivalued attribute:
An attribute that can hold multiple values is known as multivalued attribute. It is represented with double
ovals in an ER Diagram. For example – A person can have more than one phone numbers so the phone number
attribute is multivalued.
5. Derived attribute:
A derived attribute is one whose value is dynamic and derived from another attribute. It is represented
by dashed oval in an ER Diagram. For example – Person age is a derived attribute as it changes over time and
can be derived from another attribute (Date of birth).
6. NULL Attribute: It is used when an entity does not have a value for an attribute. i.e. missing or not
known.
Relationship
A relationship is a association between the entities. A relationship is represented by diamond shape in
ER diagram, it shows the relationship among entities.
The degree of a relationship = the number of entity sets that participate in the relationship.
Most useful in describing binary relationship sets.
Mapping cardinality of a relationship
For a binary relationship set the mapping cardinality must be one of the following types:
– One to one
– One to many
– Many to one
– Many to many
When a single instance of an entity is associated with more than one instances of another entity then it is called
one to many relationship. For example – a customer can place many orders but a order cannot be placed by
many customers.
When more than one instances of an entity is associated with more than one instances of another entity then it is
called many to many relationship. For example, a can be assigned to many projects and a project can be
assigned to many students.