SlideShare a Scribd company logo
Unit 1
Database system concepts and architecture -A Brief History of Database Applications, View of
Data, Databases and Database Users. Database System Concepts and Architecture - Data Models,
Schemas, and Instances, Three-Schema Architecture and Data Independence. Data Modeling Using
the Entity–Relationship (ER) Model - Entity Sets, attributes and Keys, Relationship Sets, ER
Diagrams. The Enhanced Entity–Relationship (EER) Model - Subclasses, Superclasses, and
Inheritance, Specialization and Generalization, Constraints
Database Languages in DBMS
o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.
Types of Database Languages
1. Data Definition Language (DDL)
o DDL stands for Data Definition Language. It is used to define database structure or
pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the number of
tables and schemas, their names, indexes, columns in each table, constraints, etc.
Here are some tasks that come under DDL:
o Create: It is used to create objects in the database.
o Alter: It is used to alter the structure of the database.
o Drop: It is used to delete objects from the database.
o Truncate: It is used to remove all records from a table.
o Rename: It is used to rename an object.
o Comment: It is used to comment on the data dictionary.
These commands are used to update the database schema that's why they come under Data
definition language.
2. Data Manipulation Language (DML)
DML stands for Data Manipulation Language. It is used for accessing and manipulating data in
a database. It handles user requests.
Here are some tasks that come under DML:
o Select: It is used to retrieve data from a database.
o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
o Merge: It performs UPSERT operation, i.e., insert or update operations.
o Call: It is used to call a structured query language or a Java subprogram.
o Explain Plan: It has the parameter of explaining data.
o Lock Table: It controls concurrency.
3. Data Control Language (DCL)
o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.
(But in Oracle database, the execution of data control language does not have the feature
of rolling back.)
Here are some tasks that come under DCL:
o Grant: It is used to give user access privileges to a database.
o Revoke: It is used to take back permissions from the user.
There are the following operations which have the authorization of Revoke:
CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.
4. Transaction Control Language (TCL)
TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.
Here are some tasks that come under TCL:
o Commit: It is used to save the transaction on the database.
o Rollback: It is used to restore the database to original since the last Commit.
Keys
o Keys play an important role in the relational database.
o It is used to uniquely identify any record or row of data from the table. It is also used to
establish and identify relationships between tables.
For example, ID is used as a key in the Student table because it is unique for each student. In the
PERSON table, passport_number, license_number, SSN are keys since they are unique for each
person.
Types of keys:
1. Primary key
o It is the first key used to identify one and only one instance of an entity uniquely. An
entity can contain multiple keys, as we saw in the PERSON table. The key which is most
suitable from those lists becomes a primary key.
o In the EMPLOYEE table, ID can be the primary key since it is unique for each employee.
In the EMPLOYEE table, we can even select License_Number and Passport_Number as
primary keys since they are also unique.
o For each entity, the primary key selection is based on requirements and developers.
2. Candidate key
o A candidate key is an attribute or set of attributes that can uniquely identify a tuple.
o Except for the primary key, the remaining attributes are considered a candidate key. The
candidate keys are as strong as the primary key.
For example: In the EMPLOYEE table, id is best suited for the primary key. The rest of the
attributes, like SSN, Passport_Number, License_Number, etc., are considered a candidate key.
3. Super Key
Super key is an attribute set that can uniquely identify a tuple. A super key is a superset of a
candidate key.
For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME), the
name of two employees can be the same, but their EMPLYEE_ID can't be the same. Hence, this
combination can also be a key. kip 10s
The super key would be EMPLOYEE-ID (EMPLOYEE_ID, EMPLOYEE-NAME), etc.
4. Foreign key
o Foreign keys are the column of the table used to point to the primary key of another table.
o Every employee works in a specific department in a company, and employee and
department are two different entities. So we can't store the department's information in
the employee table. That's why we link these two tables through the primary key of one
table.
o We add the primary key of the DEPARTMENT table, Department_Id, as a new attribute
in the EMPLOYEE table.
o In the EMPLOYEE table, Department_Id is the foreign key, and both the tables are
related.
5. Alternate key
There may be one or more attributes or a combination of attributes that uniquely identify each
tuple in a relation. These attributes or combinations of the attributes are called the candidate
keys. One key is chosen as the primary key from these candidate keys, and the remaining
candidate key, if it exists, is termed the alternate key. In other words, the total number of the
alternate keys is the total number of candidate keys minus the primary key. The alternate key
may or may not exist. If there is only one candidate key in a relation, it does not have an alternate
key.
For example, employee relation has two attributes, Employee_Id and PAN_No, that act as
candidate keys. In this relation, Employee_Id is chosen as the primary key, so the other candidate
key, PAN_No, acts as the Alternate key.
6. Composite key
Whenever a primary key consists of more than one attribute, it is known as a composite key.
This key is also known as Concatenated Key.
For example, in employee relations, we assume that an employee may be assigned multiple
roles, and an employee may work on multiple projects simultaneously. So the primary key will
be composed of all three attributes, namely Emp_ID, Emp_role, and Proj_ID in combination. So
these attributes act as a composite key since the primary key comprises more than one attribute.
7. Artificial key
The key created using arbitrarily assigned data are known as artificial keys. These keys are
created when a primary key is large and complex and has no relationship with many other
relations. The data values of the artificial keys are usually numbered in a serial order.
For example, the primary key, which is composed of Emp_ID, Emp_role, and Proj_ID, is large
in employee relations. So it would be better to add a new virtual attribute to identify each tuple in
the relation uniquely.
View of Data
• Database is a collection of interrelated data and set of programs that allow users
to access or modify the data.
• Abstract view of the system is a view in which the system hides certain details of
how the data are stored and maintained.
• The main purpose of database systems is to provide users with abstract view of
the data.
• The view of the system helps the user to retrieve data efficiently.
• For simplifying the user interaction with the system there are several levels of
abstraction - these levels are - Physical level, logical level and view level.
Data Abstraction
Data abstraction: Data abstraction means retrieving only required amount of
information /of the system and hiding background details.
There are several levels of abstraction that simplify the user interactions with the
system. These are
1) Physical level:
• This is the lowest level.
• This level describes how actually the data are stored.
• This level describes complex low level data structures.
2) Logical level:
• This is the next higher level, which describes the what data are stored in database.
• This level also describes the relationship among the data.
• The logical level thus describes then entire database in terms of small number of
relatively simple structures.
• The database administrators use logical level of abstraction for deciding what
information to keep in database.
3) View level:
This is highest level of abstraction that describes only part of the entire database.
• The view level can provide the access to only part of the database.
• This level helps in simplifying the interaction with the system.
• The system can provide multiple views of the same system.
• Clerk at the reservation system, can see only part of the database and can access
the required information of the passenger.
Fig. 1.3.1 shows the relationship among the three levels of abstraction.
For example: Consider following record
Type employee = record
empID:numeric(10)
empname:char(20)
dept_no:numeric (10)
salary:numeric(8,2)
end
This code defines a new record employee with four fields. Each field is associated
with field name and its type. There are several other records such as
department with fields dept_no, dept_name, building
customer with fields cust_id,cust_name
• At the physical level, the record - customer, employee, department can be Vibe
described as block of consecutive storage locations. Many database systems hide
lowest level storage details from database programmer.
• The type definition of the records is decided at the logical level. The programmer
work of the record at this level, similarly database administrators also work at this
level of abstraction.
• There is specific view of the record is allowed at the view level. For instance - -
customer can view the name of the employee, or id of the employee but cannot
access employee's salary.
Instances and Schemas
Schema: The overall design of the database is called schema
For example - In a program we do variable declaration and assignment of values to
the variable. The variable declaration is called schema and the value assigned to
the variable is called instance. The schema for the student record can be
Instances: When information is inserted or deleted from the database then the
database gets changed. The collection of information at particular moment is called
instances. For example - following is an instance of student database
Types of Schema: The database has several schema based on the levels of
abstraction.
(1) Physical Schema: The physical schema is a database design described at the
physical level of abstraction.
(2) Logical Schema: The logical schema is a database design at the logical level of
abstraction.
(3) Subschema:A database may have several views at the view level which are
called subschemas.
Databases and Database Users
A Database User is defined as a person who interacts with data daily, updating,
reading, and modifying the given data. Database users can access and retrieve data
from the database through the Database Management System (DBMS) applications
and interfaces.
Types of Database Users
Database users are categorized based on their interaction with the database. There
are seven types of database users in DBMS. Below mentioned are the types of
database users:
1. Database Administrator (DBA)
A Database Administrator (DBA) is a person/team who defines the schema and
also controls the 3 levels of the database. The DBA will then create a new account
ID and password for the user if he/she needs to access the database. DBA is also
responsible for providing security to the database and he allows only authorized
users to access/modify the database. DBA is responsible for problems such as
security breaches and poor system response time.
 DBA also monitors the recovery and backup and provides technical support.
 The DBA has a DBA account in the DBMS which is called a system or
superuser account.
 DBA repairs damage caused due to hardware and/or software failures.
 DBA is the one having privileges to perform DCL (Data Control
Language) operations such as GRANT and REVOKE, to allow/restrict a
particular user from accessing the database.
2. Naive / Parametric End Users
Parametric End Users are the unsophisticated who don’t have any DBMS
knowledge but they frequently use the database applications in their daily life to
get the desired results. For example, Railway’s ticket booking users are naive
users. Clerks in any bank is a naive user because they don’t have any DBMS
knowledge but they still use the database and perform their given task.
3. A System Analyst
A system Analyst is a user who analyzes the requirements of parametric end users.
They check whether all the requirements of end users are satisfied.
4. Sophisticated Users
Sophisticated users can be engineers, scientists, business analyst, who are familiar
with the database. They can develop their own database applications according to
their requirement. They don’t write the program code but they interact the database
by writing SQL queries directly through the query processor.
5. Database Designers
Data Base Designers are the users who design the structure of database which
includes tables, indexes, views, triggers, stored procedures and constraints which
are usually enforced before the database is created or populated with data. He/she
controls what data must be stored and how the data items to be related. It is the
responsibility of Database Designers to understand the requirements of different
user groups and then create a design which satisfies the need of all the user groups.
6. Application Programmers
Application Programmers also referred as System Analysts or simply Software
Engineers, are the back-end programmers who writes the code for the application
programs. They are the computer professionals. These programs could be written
in Programming languages such as Visual Basic, Developer, C, FORTRAN,
COBOL etc. Application programmers design, debug, test, and maintain set of
programs called “canned transactions” for the Naive (parametric) users in order to
interact with database.
7. Casual Users / Temporary Users
Casual Users are the users who occasionally use/access the database but each time
when they access the database they require the new information, for example,
Middle or higher level manager.
8. Specialized users
Specialized users are sophisticated users who write specialized database
application that does not fit into the traditional data-processing framework. Among
these applications are computer aided-design systems, knowledge-base and expert
systems etc.
DBMS Architecture
o The DBMS design depends upon its architecture. The basic client/server
architecture is used to deal with a large number of PCs, web servers,
database servers and other components that are connected with networks.
o The client/server architecture consists of many PCs and a workstation which
are connected via the network.
o DBMS architecture depends upon how users are connected to the database to
get their request done.
Types of DBMS Architecture
Database architecture can be seen as a single tier or multi-tier. But logically,
database architecture is of two types like: 2-tier architecture and 3-tier architecture.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the
user can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't
provide a handy tool for end users.
o The 1-Tier architecture is used for development of the local application,
where programmers can directly communicate with the database for the
quick response.
2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the two-tier
architecture, applications on the client end can directly communicate with
the database at the server side. For this interaction, API's
like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query
processing and transaction management.
o To communicate with the DBMS, client-side application establishes a
connection with the server side.
Fig: 2-tier Architecture
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server.
In this architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which
further communicates with the database system.
o End user has no idea about the existence of the database beyond the
application server. The database also has no idea about any other user
beyond the application.
o The 3-Tier architecture is used in case of large web application.
Data Models
A Data Model in Database Management System (DBMS) is the concept of tools
that are developed to summarize the description of the database. Data Models
provide us with a transparent picture of data which helps us in creating an actual
database. It shows us from the design of the data to its proper implementation of
data.
Types of Relational Models
1. Conceptual Data Model
2. Representational Data Model
3. Physical Data Model
It is basically classified into 3 types:-
1. Conceptual Data Model
The conceptual data model describes the database at a very high level and is useful
to understand the needs or requirements of the database. It is this model, that is
used in the requirement-gathering process i.e. before the Database Designers start
making a particular database. One such popular model is the entity/relationship
model (ER model). The E/R model specializes in entities, relationships, and even
attributes that are used by database designers. In terms of this concept, a discussion
can be made even with non-computer science(non-technical) users and
stakeholders, and their requirements can be understood.
Entity-Relationship Model( ER Model): It is a high-level data model which is used
to define the data and the relationships between them. It is basically a conceptual
design of any database which is easy to design the view of data.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name,
place, object, class, etc. These are represented by a rectangle in an ER
Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These
are represented by Ellipse in an ER Diagram. It can be Age, Roll Number, or
Marks for a Student.
3. Relationship: Relationships are used to define relations among different
entities. Diamonds and Rhombus are used to show Relationships.
Characteristics of a conceptual data model
 Offers Organization-wide coverage of the business concepts.
 This type of Data Models are designed and developed for a business
audience.
 The conceptual model is developed independently of hardware
specifications like data storage capacity, location or software specifications
like DBMS vendor and technology. The focus is to represent data as a user
will see it in the “real world.”
Conceptual data models known as Domain models create a common vocabulary
for all stakeholders by establishing basic concepts and scope
2. Representational Data Model
This type of data model is used to represent only the logical part of the database
and does not represent the physical structure of the database. The representational
data model allows us to focus primarily, on the design part of the database. A
popular representational model is a Relational model. The relational Model
consists of Relational Algebra and Relational Calculus. In the Relational Model,
we basically use tables to represent our data and the relationships between them. It
is a theoretical concept whose practical implementation is done in Physical Data
Model.
The advantage of using a Representational data model is to provide a foundation to
form the base for the Physical model
3. Physical Data Model
The physical Data Model is used to practically implement Relational Data Model.
Ultimately, all data in a database is stored physically on a secondary storage device
such as discs and tapes. This is stored in the form of files, records, and certain
other data structures. It has all the information on the format in which the files are
present and the structure of the databases, the presence of external data structures,
and their relation to each other. Here, we basically save tables in memory so they
can be accessed efficiently. In order to come up with a good physical model, we
have to work on the relational model in a better way. Structured Query Language
(SQL) is used to practically implement Relational Algebra.
This Data Model describes HOW the system will be implemented using a specific
DBMS system. This model is typically created by DBA and developers. The
purpose is actual implementation of the database.
Characteristics of a physical data model:
 The physical data model describes data need for a single project or
application though it maybe integrated with other physical data models
based on project scope.
 Data Model contains relationships between tables that which addresses
cardinality and nullability of the relationships.
 Developed for a specific version of a DBMS, location, data storage or
technology to be used in the project.
 Columns should have exact datatypes, lengths assigned and default values.
 Primary and Foreign keys, views, indexes, access profiles, and
authorizations, etc. are defined
Some Other Data Models
1. Hierarchical Model
The hierarchical Model is one of the oldest models in the data model which was
developed by IBM, in the 1950s. In a hierarchical model, data are viewed as a
collection of tables, or we can say segments that form a hierarchical relation. In
this, the data is organized into a tree-like structure where each record consists of
one parent record and many children. Even if the segments are connected as a
chain-like structure by logical associations, then the instant structure can be a fan
structure with multiple branches. We call the illogical associations as directional
associations.
2. Network Model
The Network Model was formalized by the Database Task group in the 1960s. This
model is the generalization of the hierarchical model. This model can consist of
multiple parent segments and these segments are grouped as levels but there exists
a logical association between the segments belonging to any level. Mostly, there
exists a many-to-many logical association between any of the two segments.
3. Object-Oriented Data Model
In the Object-Oriented Data Model, data and their relationships are contained in a
single structure which is referred to as an object in this data model. In this, real-
world problems are represented as objects with different attributes. All objects
have multiple relationships between them. Basically, it is a combination of Object
Oriented programming and a Relational Database Model.
4. Float Data Model
The float data model basically consists of a two-dimensional array of data models
that do not contain any duplicate elements in the array. This data model has one
drawback it cannot store a large amount of data that is the tables can not be of large
size.
5. Context Data Model
The Context data model is simply a data model which consists of more than one
data model. For example, the Context data model consists of ER Model, Object-
Oriented Data Model, etc. This model allows users to do more than one thing
which each individual data model can do.
6. Semi-Structured Data Model
Semi-Structured data models deal with the data in a flexible way. Some entities
may have extra attributes and some entities may have some missing attributes.
Basically, you can represent data here in a flexible way.
Advantages of Data Models
1. Data Models help us in representing data accurately.
2. It helps us in finding the missing data and also in minimizing Data
Redundancy.
3. Data Model provides data security in a better way.
4. The data model should be detailed enough to be used for building the
physical database.
5. The information in the data model can be used for defining the relationship
between tables, primary and foreign keys, and stored procedures.
Disadvantages of Data Models
1. In the case of a vast database, sometimes it becomes difficult to understand
the data model.
2. You must have the proper knowledge of SQL to use physical models.
3. Even smaller change made in structure require modification in the entire
application.
4. There is no set data manipulation language in DBMS.
5. To develop Data model one should know physical data stored
characteristics.
Schema and Instance in DBMS
“Schema” and “Instance” are key ideas in a database management
system (DBMS) that help organize and manage data. Let’s begin by
examining their distinctions from one another.
Instances
An Instance is the state of an operational database with data at any given
time. It contains a snapshot of the database. The instances can be
changed by certain CRUD operations, such as like addition, and deletion
of data. It may be noted that any search query will not make any kind of
changes in the instances.
Example:
Let’s say a table teacher in our database whose name is School, suppose
the table has 50 records so the instance of the database has 50 records
for now and tomorrow we are going to add another fifty records so
tomorrow the instance has a total of 100 records. This is called an
instance.
Schema
Schema is the overall description of the database. The basic structure of
how the data will be stored in the database is called schema.
Schema
Schema is of three types: Logical Schema, Physical Schema and view
Schema.
 Logical Schema – It describes the database designed at a logical level.
 Physical Schema – It describes the database designed at the physical
level.
 View Schema – It defines the design of the database at the view level.
Example:
Let’s say a table teacher in our database named school, the teacher table
requires the name, dob, and doj in their table so we design a structure
as:
Teacher table
name: String
doj: date
dob: date
Above given is the schema of the table teacher.
Difference Between Schema and Instance
Schema Instance
It is the overall description of the database.
It is the collection of information stored
in a database at a particular moment.
The schema is same for the whole database.
Data in instances can be changed using
addition, deletion, and updation.
Does not change Frequently. Changes Frequently.
Defines the basic structure of the database
i.e. how the data will be stored in the
database.
It is the set of Information stored at a
particular time.

More Related Content

PPTX
SQL-queries-for-Data-Analysts-Updated.pptx
PPTX
unit 1.pptx
PPTX
Introduction to database
PPTX
unit 1.pptx
PPTX
DBMS ppts unit1.pptx
PPTX
Database Basics
PDF
Introduction to Database Management System
PPTX
DEE 431 Database keys and Normalisation Slide 2
SQL-queries-for-Data-Analysts-Updated.pptx
unit 1.pptx
Introduction to database
unit 1.pptx
DBMS ppts unit1.pptx
Database Basics
Introduction to Database Management System
DEE 431 Database keys and Normalisation Slide 2

Similar to RELATIONAL DATABASE PURPOSE OF DATABASE SYSTEM (20)

PDF
database1.pdf
DOCX
Database Concepts
PPT
Preparing for BIT – IT2301 Database Management Systems 2001d
PPTX
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
PDF
LectDBS_1.pdf
PPTX
Data resource management
PPTX
Relational Database.pptx
PPTX
2nd chapter dbms.pptx
PPTX
DBMS (1).pptx
PDF
RDBMS NOTES 1.pdf BWSBFDGFEDRHHYGTRFEDCWXSDFRGTHYUJ7IK89O8IJUY7HGTR
PPT
DBMS Full.ppt
PDF
Introduction to Database
PPTX
PPT
Database Technology Teaching Material For Learn
PPTX
Ch 2-introduction to dbms
PPTX
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
PPTX
Introduction to Database Management Systems (DBMS)
PPTX
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
PPT
Database
PPTX
Database Management System(UNIT 1)
database1.pdf
Database Concepts
Preparing for BIT – IT2301 Database Management Systems 2001d
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
LectDBS_1.pdf
Data resource management
Relational Database.pptx
2nd chapter dbms.pptx
DBMS (1).pptx
RDBMS NOTES 1.pdf BWSBFDGFEDRHHYGTRFEDCWXSDFRGTHYUJ7IK89O8IJUY7HGTR
DBMS Full.ppt
Introduction to Database
Database Technology Teaching Material For Learn
Ch 2-introduction to dbms
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
Introduction to Database Management Systems (DBMS)
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
Database
Database Management System(UNIT 1)
Ad

More from saranyaksr92 (7)

PDF
UNIT 2 DATABASE DESIGN 9.pdf ER DIAGRAMS
PDF
UNIT 5 TRANSACTION MANAGEMENT 9 f.pdf AND SQL
PDF
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
PDF
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
PDF
DATABASE DESIGNS ER DIAGRAMS REATIONA; ALGEBRA
PDF
TRANSACATION CONCEPTS ACID PNeed for Concurrencyroperties Serializability
PDF
Relational data base and Er diagema Normalization
UNIT 2 DATABASE DESIGN 9.pdf ER DIAGRAMS
UNIT 5 TRANSACTION MANAGEMENT 9 f.pdf AND SQL
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
DATABASE DESIGNS ER DIAGRAMS REATIONA; ALGEBRA
TRANSACATION CONCEPTS ACID PNeed for Concurrencyroperties Serializability
Relational data base and Er diagema Normalization
Ad

Recently uploaded (20)

PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lecture Notes Electrical Wiring System Components
PPT
Mechanical Engineering MATERIALS Selection
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Construction Project Organization Group 2.pptx
PPT
Project quality management in manufacturing
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Geodesy 1.pptx...............................................
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
Lesson 3_Tessellation.pptx finite Mathematics
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lecture Notes Electrical Wiring System Components
Mechanical Engineering MATERIALS Selection
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
UNIT 4 Total Quality Management .pptx
Structs to JSON How Go Powers REST APIs.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Arduino robotics embedded978-1-4302-3184-4.pdf
Construction Project Organization Group 2.pptx
Project quality management in manufacturing
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Geodesy 1.pptx...............................................
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Model Code of Practice - Construction Work - 21102022 .pdf

RELATIONAL DATABASE PURPOSE OF DATABASE SYSTEM

  • 1. Unit 1 Database system concepts and architecture -A Brief History of Database Applications, View of Data, Databases and Database Users. Database System Concepts and Architecture - Data Models, Schemas, and Instances, Three-Schema Architecture and Data Independence. Data Modeling Using the Entity–Relationship (ER) Model - Entity Sets, attributes and Keys, Relationship Sets, ER Diagrams. The Enhanced Entity–Relationship (EER) Model - Subclasses, Superclasses, and Inheritance, Specialization and Generalization, Constraints Database Languages in DBMS o A DBMS has appropriate languages and interfaces to express database queries and updates. o Database languages can be used to read, store and update the data in the database. Types of Database Languages 1. Data Definition Language (DDL) o DDL stands for Data Definition Language. It is used to define database structure or pattern. o It is used to create schema, tables, indexes, constraints, etc. in the database. o Using the DDL statements, you can create the skeleton of the database. o Data definition language is used to store the information of metadata like the number of tables and schemas, their names, indexes, columns in each table, constraints, etc. Here are some tasks that come under DDL:
  • 2. o Create: It is used to create objects in the database. o Alter: It is used to alter the structure of the database. o Drop: It is used to delete objects from the database. o Truncate: It is used to remove all records from a table. o Rename: It is used to rename an object. o Comment: It is used to comment on the data dictionary. These commands are used to update the database schema that's why they come under Data definition language. 2. Data Manipulation Language (DML) DML stands for Data Manipulation Language. It is used for accessing and manipulating data in a database. It handles user requests. Here are some tasks that come under DML: o Select: It is used to retrieve data from a database. o Insert: It is used to insert data into a table. o Update: It is used to update existing data within a table. o Delete: It is used to delete all records from a table. o Merge: It performs UPSERT operation, i.e., insert or update operations. o Call: It is used to call a structured query language or a Java subprogram. o Explain Plan: It has the parameter of explaining data. o Lock Table: It controls concurrency. 3. Data Control Language (DCL) o DCL stands for Data Control Language. It is used to retrieve the stored or saved data. o The DCL execution is transactional. It also has rollback parameters. (But in Oracle database, the execution of data control language does not have the feature of rolling back.) Here are some tasks that come under DCL: o Grant: It is used to give user access privileges to a database.
  • 3. o Revoke: It is used to take back permissions from the user. There are the following operations which have the authorization of Revoke: CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT. 4. Transaction Control Language (TCL) TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical transaction. Here are some tasks that come under TCL: o Commit: It is used to save the transaction on the database. o Rollback: It is used to restore the database to original since the last Commit. Keys o Keys play an important role in the relational database. o It is used to uniquely identify any record or row of data from the table. It is also used to establish and identify relationships between tables. For example, ID is used as a key in the Student table because it is unique for each student. In the PERSON table, passport_number, license_number, SSN are keys since they are unique for each person.
  • 4. Types of keys: 1. Primary key o It is the first key used to identify one and only one instance of an entity uniquely. An entity can contain multiple keys, as we saw in the PERSON table. The key which is most suitable from those lists becomes a primary key. o In the EMPLOYEE table, ID can be the primary key since it is unique for each employee. In the EMPLOYEE table, we can even select License_Number and Passport_Number as primary keys since they are also unique. o For each entity, the primary key selection is based on requirements and developers. 2. Candidate key o A candidate key is an attribute or set of attributes that can uniquely identify a tuple. o Except for the primary key, the remaining attributes are considered a candidate key. The candidate keys are as strong as the primary key.
  • 5. For example: In the EMPLOYEE table, id is best suited for the primary key. The rest of the attributes, like SSN, Passport_Number, License_Number, etc., are considered a candidate key. 3. Super Key Super key is an attribute set that can uniquely identify a tuple. A super key is a superset of a candidate key. For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME), the name of two employees can be the same, but their EMPLYEE_ID can't be the same. Hence, this combination can also be a key. kip 10s The super key would be EMPLOYEE-ID (EMPLOYEE_ID, EMPLOYEE-NAME), etc.
  • 6. 4. Foreign key o Foreign keys are the column of the table used to point to the primary key of another table. o Every employee works in a specific department in a company, and employee and department are two different entities. So we can't store the department's information in the employee table. That's why we link these two tables through the primary key of one table. o We add the primary key of the DEPARTMENT table, Department_Id, as a new attribute in the EMPLOYEE table. o In the EMPLOYEE table, Department_Id is the foreign key, and both the tables are related. 5. Alternate key There may be one or more attributes or a combination of attributes that uniquely identify each tuple in a relation. These attributes or combinations of the attributes are called the candidate keys. One key is chosen as the primary key from these candidate keys, and the remaining candidate key, if it exists, is termed the alternate key. In other words, the total number of the alternate keys is the total number of candidate keys minus the primary key. The alternate key may or may not exist. If there is only one candidate key in a relation, it does not have an alternate key. For example, employee relation has two attributes, Employee_Id and PAN_No, that act as candidate keys. In this relation, Employee_Id is chosen as the primary key, so the other candidate key, PAN_No, acts as the Alternate key.
  • 7. 6. Composite key Whenever a primary key consists of more than one attribute, it is known as a composite key. This key is also known as Concatenated Key. For example, in employee relations, we assume that an employee may be assigned multiple roles, and an employee may work on multiple projects simultaneously. So the primary key will be composed of all three attributes, namely Emp_ID, Emp_role, and Proj_ID in combination. So these attributes act as a composite key since the primary key comprises more than one attribute.
  • 8. 7. Artificial key The key created using arbitrarily assigned data are known as artificial keys. These keys are created when a primary key is large and complex and has no relationship with many other relations. The data values of the artificial keys are usually numbered in a serial order. For example, the primary key, which is composed of Emp_ID, Emp_role, and Proj_ID, is large in employee relations. So it would be better to add a new virtual attribute to identify each tuple in the relation uniquely. View of Data • Database is a collection of interrelated data and set of programs that allow users to access or modify the data. • Abstract view of the system is a view in which the system hides certain details of how the data are stored and maintained. • The main purpose of database systems is to provide users with abstract view of the data. • The view of the system helps the user to retrieve data efficiently. • For simplifying the user interaction with the system there are several levels of abstraction - these levels are - Physical level, logical level and view level. Data Abstraction
  • 9. Data abstraction: Data abstraction means retrieving only required amount of information /of the system and hiding background details. There are several levels of abstraction that simplify the user interactions with the system. These are 1) Physical level: • This is the lowest level. • This level describes how actually the data are stored. • This level describes complex low level data structures. 2) Logical level: • This is the next higher level, which describes the what data are stored in database. • This level also describes the relationship among the data. • The logical level thus describes then entire database in terms of small number of relatively simple structures. • The database administrators use logical level of abstraction for deciding what information to keep in database. 3) View level: This is highest level of abstraction that describes only part of the entire database. • The view level can provide the access to only part of the database. • This level helps in simplifying the interaction with the system. • The system can provide multiple views of the same system. • Clerk at the reservation system, can see only part of the database and can access the required information of the passenger. Fig. 1.3.1 shows the relationship among the three levels of abstraction.
  • 10. For example: Consider following record Type employee = record empID:numeric(10) empname:char(20) dept_no:numeric (10) salary:numeric(8,2) end This code defines a new record employee with four fields. Each field is associated with field name and its type. There are several other records such as department with fields dept_no, dept_name, building customer with fields cust_id,cust_name • At the physical level, the record - customer, employee, department can be Vibe described as block of consecutive storage locations. Many database systems hide lowest level storage details from database programmer. • The type definition of the records is decided at the logical level. The programmer work of the record at this level, similarly database administrators also work at this level of abstraction. • There is specific view of the record is allowed at the view level. For instance - - customer can view the name of the employee, or id of the employee but cannot access employee's salary.
  • 11. Instances and Schemas Schema: The overall design of the database is called schema For example - In a program we do variable declaration and assignment of values to the variable. The variable declaration is called schema and the value assigned to the variable is called instance. The schema for the student record can be Instances: When information is inserted or deleted from the database then the database gets changed. The collection of information at particular moment is called instances. For example - following is an instance of student database Types of Schema: The database has several schema based on the levels of abstraction. (1) Physical Schema: The physical schema is a database design described at the physical level of abstraction. (2) Logical Schema: The logical schema is a database design at the logical level of abstraction. (3) Subschema:A database may have several views at the view level which are called subschemas. Databases and Database Users A Database User is defined as a person who interacts with data daily, updating, reading, and modifying the given data. Database users can access and retrieve data from the database through the Database Management System (DBMS) applications and interfaces. Types of Database Users
  • 12. Database users are categorized based on their interaction with the database. There are seven types of database users in DBMS. Below mentioned are the types of database users: 1. Database Administrator (DBA) A Database Administrator (DBA) is a person/team who defines the schema and also controls the 3 levels of the database. The DBA will then create a new account ID and password for the user if he/she needs to access the database. DBA is also responsible for providing security to the database and he allows only authorized users to access/modify the database. DBA is responsible for problems such as security breaches and poor system response time.  DBA also monitors the recovery and backup and provides technical support.  The DBA has a DBA account in the DBMS which is called a system or superuser account.  DBA repairs damage caused due to hardware and/or software failures.  DBA is the one having privileges to perform DCL (Data Control Language) operations such as GRANT and REVOKE, to allow/restrict a particular user from accessing the database. 2. Naive / Parametric End Users Parametric End Users are the unsophisticated who don’t have any DBMS knowledge but they frequently use the database applications in their daily life to get the desired results. For example, Railway’s ticket booking users are naive users. Clerks in any bank is a naive user because they don’t have any DBMS knowledge but they still use the database and perform their given task. 3. A System Analyst A system Analyst is a user who analyzes the requirements of parametric end users. They check whether all the requirements of end users are satisfied. 4. Sophisticated Users Sophisticated users can be engineers, scientists, business analyst, who are familiar with the database. They can develop their own database applications according to their requirement. They don’t write the program code but they interact the database by writing SQL queries directly through the query processor.
  • 13. 5. Database Designers Data Base Designers are the users who design the structure of database which includes tables, indexes, views, triggers, stored procedures and constraints which are usually enforced before the database is created or populated with data. He/she controls what data must be stored and how the data items to be related. It is the responsibility of Database Designers to understand the requirements of different user groups and then create a design which satisfies the need of all the user groups. 6. Application Programmers Application Programmers also referred as System Analysts or simply Software Engineers, are the back-end programmers who writes the code for the application programs. They are the computer professionals. These programs could be written in Programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL etc. Application programmers design, debug, test, and maintain set of programs called “canned transactions” for the Naive (parametric) users in order to interact with database. 7. Casual Users / Temporary Users Casual Users are the users who occasionally use/access the database but each time when they access the database they require the new information, for example, Middle or higher level manager. 8. Specialized users Specialized users are sophisticated users who write specialized database application that does not fit into the traditional data-processing framework. Among these applications are computer aided-design systems, knowledge-base and expert systems etc. DBMS Architecture o The DBMS design depends upon its architecture. The basic client/server architecture is used to deal with a large number of PCs, web servers, database servers and other components that are connected with networks. o The client/server architecture consists of many PCs and a workstation which are connected via the network.
  • 14. o DBMS architecture depends upon how users are connected to the database to get their request done. Types of DBMS Architecture Database architecture can be seen as a single tier or multi-tier. But logically, database architecture is of two types like: 2-tier architecture and 3-tier architecture. 1-Tier Architecture o In this architecture, the database is directly available to the user. It means the user can directly sit on the DBMS and uses it. o Any changes done here will directly be done on the database itself. It doesn't provide a handy tool for end users. o The 1-Tier architecture is used for development of the local application, where programmers can directly communicate with the database for the quick response. 2-Tier Architecture
  • 15. o The 2-Tier architecture is same as basic client-server. In the two-tier architecture, applications on the client end can directly communicate with the database at the server side. For this interaction, API's like: ODBC, JDBC are used. o The user interfaces and application programs are run on the client-side. o The server side is responsible to provide the functionalities like: query processing and transaction management. o To communicate with the DBMS, client-side application establishes a connection with the server side. Fig: 2-tier Architecture 3-Tier Architecture o The 3-Tier architecture contains another layer between the client and server. In this architecture, client can't directly communicate with the server. o The application on the client-end interacts with an application server which further communicates with the database system.
  • 16. o End user has no idea about the existence of the database beyond the application server. The database also has no idea about any other user beyond the application. o The 3-Tier architecture is used in case of large web application. Data Models A Data Model in Database Management System (DBMS) is the concept of tools that are developed to summarize the description of the database. Data Models provide us with a transparent picture of data which helps us in creating an actual database. It shows us from the design of the data to its proper implementation of data. Types of Relational Models 1. Conceptual Data Model 2. Representational Data Model
  • 17. 3. Physical Data Model It is basically classified into 3 types:- 1. Conceptual Data Model The conceptual data model describes the database at a very high level and is useful to understand the needs or requirements of the database. It is this model, that is used in the requirement-gathering process i.e. before the Database Designers start making a particular database. One such popular model is the entity/relationship model (ER model). The E/R model specializes in entities, relationships, and even attributes that are used by database designers. In terms of this concept, a discussion can be made even with non-computer science(non-technical) users and stakeholders, and their requirements can be understood. Entity-Relationship Model( ER Model): It is a high-level data model which is used to define the data and the relationships between them. It is basically a conceptual design of any database which is easy to design the view of data. Components of ER Model: 1. Entity: An entity is referred to as a real-world object. It can be a name, place, object, class, etc. These are represented by a rectangle in an ER Diagram. 2. Attributes: An attribute can be defined as the description of the entity. These are represented by Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a Student. 3. Relationship: Relationships are used to define relations among different entities. Diamonds and Rhombus are used to show Relationships.
  • 18. Characteristics of a conceptual data model  Offers Organization-wide coverage of the business concepts.  This type of Data Models are designed and developed for a business audience.  The conceptual model is developed independently of hardware specifications like data storage capacity, location or software specifications like DBMS vendor and technology. The focus is to represent data as a user will see it in the “real world.” Conceptual data models known as Domain models create a common vocabulary for all stakeholders by establishing basic concepts and scope 2. Representational Data Model This type of data model is used to represent only the logical part of the database and does not represent the physical structure of the database. The representational data model allows us to focus primarily, on the design part of the database. A popular representational model is a Relational model. The relational Model consists of Relational Algebra and Relational Calculus. In the Relational Model, we basically use tables to represent our data and the relationships between them. It is a theoretical concept whose practical implementation is done in Physical Data Model. The advantage of using a Representational data model is to provide a foundation to form the base for the Physical model 3. Physical Data Model The physical Data Model is used to practically implement Relational Data Model. Ultimately, all data in a database is stored physically on a secondary storage device such as discs and tapes. This is stored in the form of files, records, and certain other data structures. It has all the information on the format in which the files are present and the structure of the databases, the presence of external data structures, and their relation to each other. Here, we basically save tables in memory so they can be accessed efficiently. In order to come up with a good physical model, we have to work on the relational model in a better way. Structured Query Language (SQL) is used to practically implement Relational Algebra.
  • 19. This Data Model describes HOW the system will be implemented using a specific DBMS system. This model is typically created by DBA and developers. The purpose is actual implementation of the database. Characteristics of a physical data model:  The physical data model describes data need for a single project or application though it maybe integrated with other physical data models based on project scope.  Data Model contains relationships between tables that which addresses cardinality and nullability of the relationships.  Developed for a specific version of a DBMS, location, data storage or technology to be used in the project.  Columns should have exact datatypes, lengths assigned and default values.  Primary and Foreign keys, views, indexes, access profiles, and authorizations, etc. are defined Some Other Data Models 1. Hierarchical Model The hierarchical Model is one of the oldest models in the data model which was developed by IBM, in the 1950s. In a hierarchical model, data are viewed as a collection of tables, or we can say segments that form a hierarchical relation. In this, the data is organized into a tree-like structure where each record consists of one parent record and many children. Even if the segments are connected as a chain-like structure by logical associations, then the instant structure can be a fan structure with multiple branches. We call the illogical associations as directional associations. 2. Network Model The Network Model was formalized by the Database Task group in the 1960s. This model is the generalization of the hierarchical model. This model can consist of multiple parent segments and these segments are grouped as levels but there exists a logical association between the segments belonging to any level. Mostly, there exists a many-to-many logical association between any of the two segments. 3. Object-Oriented Data Model
  • 20. In the Object-Oriented Data Model, data and their relationships are contained in a single structure which is referred to as an object in this data model. In this, real- world problems are represented as objects with different attributes. All objects have multiple relationships between them. Basically, it is a combination of Object Oriented programming and a Relational Database Model. 4. Float Data Model The float data model basically consists of a two-dimensional array of data models that do not contain any duplicate elements in the array. This data model has one drawback it cannot store a large amount of data that is the tables can not be of large size. 5. Context Data Model The Context data model is simply a data model which consists of more than one data model. For example, the Context data model consists of ER Model, Object- Oriented Data Model, etc. This model allows users to do more than one thing which each individual data model can do. 6. Semi-Structured Data Model Semi-Structured data models deal with the data in a flexible way. Some entities may have extra attributes and some entities may have some missing attributes. Basically, you can represent data here in a flexible way. Advantages of Data Models 1. Data Models help us in representing data accurately. 2. It helps us in finding the missing data and also in minimizing Data Redundancy. 3. Data Model provides data security in a better way. 4. The data model should be detailed enough to be used for building the physical database. 5. The information in the data model can be used for defining the relationship between tables, primary and foreign keys, and stored procedures. Disadvantages of Data Models
  • 21. 1. In the case of a vast database, sometimes it becomes difficult to understand the data model. 2. You must have the proper knowledge of SQL to use physical models. 3. Even smaller change made in structure require modification in the entire application. 4. There is no set data manipulation language in DBMS. 5. To develop Data model one should know physical data stored characteristics.
  • 22. Schema and Instance in DBMS “Schema” and “Instance” are key ideas in a database management system (DBMS) that help organize and manage data. Let’s begin by examining their distinctions from one another. Instances An Instance is the state of an operational database with data at any given time. It contains a snapshot of the database. The instances can be changed by certain CRUD operations, such as like addition, and deletion of data. It may be noted that any search query will not make any kind of changes in the instances. Example: Let’s say a table teacher in our database whose name is School, suppose the table has 50 records so the instance of the database has 50 records for now and tomorrow we are going to add another fifty records so tomorrow the instance has a total of 100 records. This is called an instance. Schema Schema is the overall description of the database. The basic structure of how the data will be stored in the database is called schema.
  • 23. Schema Schema is of three types: Logical Schema, Physical Schema and view Schema.  Logical Schema – It describes the database designed at a logical level.  Physical Schema – It describes the database designed at the physical level.  View Schema – It defines the design of the database at the view level. Example: Let’s say a table teacher in our database named school, the teacher table requires the name, dob, and doj in their table so we design a structure as: Teacher table name: String doj: date dob: date Above given is the schema of the table teacher.
  • 24. Difference Between Schema and Instance Schema Instance It is the overall description of the database. It is the collection of information stored in a database at a particular moment. The schema is same for the whole database. Data in instances can be changed using addition, deletion, and updation. Does not change Frequently. Changes Frequently. Defines the basic structure of the database i.e. how the data will be stored in the database. It is the set of Information stored at a particular time.