Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 116

DATABASE MANAGEMENT

SYSTEMS (DBMS)

21AIM45A

MODULE -1
MODULE 1:SYLLABUS
Introduction to Databases: Definition of database,
DBMS; Characteristics of Database approach;
Advantages of using DBMS approach;DBMS
Database Concept and Architecture: Data models,
schemas and instances; Data Abstraction; Three-
schema architecture and data independence;
Components of a DBMS - Database Designer-
Database Administrator-Database Users.
Introduction to Entity- Relationship Model:
Entity Types, Attributes and Keys; Relationship
types, Roles and Structural Constraints; Weak
Entity Types; ER Diagrams, Naming Conventions
and Design Issues; Relationship types of degree
higher than two; Reduction of an E-R schema to
relational Tables
CIE EVALUATION MATRIX

Tests Assignment Quizze Practical Case


(25 (10 marks) s (5 activities(5 studies(5
marks) marks) marks) marks)
DATABASE
 Database plays a critical role in all areas where computers are used.
Eg: Business, Social media, Engineering, Medicine, Education, Library, etc.

 Data: Known facts that can be recorded


 Database: Collection of related data

Eg: Telephone Directory(Collection of related data with implicit meaning)

Properties:

 DB is a collection of data with some inherent meaning.


 DB is designed, built & populated with data for specific purpose.

 DB can be of any size & complexity.


 Greater size can be maintained by social media company (Facebook, Amazon, etc.)
 DB occupies over 42 terabytes which is stored over 100’s of computers
We interact with the DB thro’ Shopping, Banking, Ticket Booking, etc.
Our activities make the computer program to access the DB.
DATABASE MANAGEMENT
SYSTEMS (DBMS)
What is Database Management System?

A Database Management System (DBMS), or simply a Database


System (DBS) consist of :

 A collection of interrelated and persistent data (usually


referred to as the database (DB)).
 A set of application programs used to access, update and
manage that data (which form the data management system
(MS)).
Brief History
• Early 1960s: first general purpose database by Charles
Bachman from GE. Used the network data model.
• Late 1960s: IBM developed Information Management System
(IMS). Used the hierarchical data model. Led to SABRE, the
airline reservation system developed by AA and IBM. Still in
use today.
• 1970: Edgar Code of IBM developed the relational data
model. Led to several DBMS based on relational model, as
well as important theoretical results. Code wins Turing award.
• 1980s: relational model dominant. SQL standard.
• Late 1980s, 1990s: DBMS vendors extend systems, allowing
more complex data types (images, text).
CHARACTERISTICS OF DATABASE APPROACH

The main characteristics of the database approach versus the file-processing approach
are the following:

Self-describingnature of a database system


Insulation between programs and data, and data abstraction
Support of multiple views of the data
Sharing of data and multiuser transaction processing
2. Insulation between Programs and Data, and
Data Abstraction:

In traditional file processing, the structure of data


files is embedded in the application programs, so any
changes to the structure of a file may require
changing all programs that access that file. By
contrast, DBMS access programs do not require such
changes in most cases. The structure of data files is
stored in the DBMS catalog separately from the
access programs. We call this property program-
data independence.
3. Support of Multiple Views of the Data:

A database typically has many types of users, each of whom


may require a different perspective or view of the database. A
view may be a subset of the database or it may contain virtual
data that is derived from the database files but is not explicitly
stored. Some users may not need to be aware of whether the data
they refer to is stored or derived. A multiuser DBMS whose
users have a variety of distinct applications must provide
facilities for defining multiple views.
4. Sharing of Data and Multiuser Transaction Processing:

A multiuser DBMS, as its name implies, must allow multiple


users to access the database at the same time. This is essential if
data for multiple applications is to be integrated and maintained
in a single database. The DBMS must include concurrency
control software to ensure that several users trying to update the
same data do so in a controlled manner so that the result of the
updates is correct.
For example, when several reservation agents try to
assign a seat on an airline flight, the DBMS should ensure that
each seat can be accessed by only one agent at a time for
assignment to a passenger. These types of applications are
generally called online transaction processing (OLTP)
applications. A fundamental role of multiuser DBMS software is
to ensure that concurrent transactions operate correctly and
efficiently.
ADVANTAGES OF USING THE DBMS APPROACH
 Representing Complex Relationships Among Data: A DBMS
should have the capability to represent such relationships and to
retrieve related data quickly.

 User Friendly - Data are presented in a straightforward and logical


manner by database management systems (DBMS). It is simple to carry
out many activities, such as the addition, deletion, or creation of files
or data.

 Data Abstraction - In order to give users an abstract overview of the data,


database systems are primarily used. Since numerous intricate algorithms are
employed by developers to boost the effectiveness of databases that are
concealed from users by several degrees of data abstraction, consumers can
easily engage with the system
OVERVIEW OF DATABASE LANGUAGES AND ARCHITECTURES

Data Models, Schemas, and Instances.


 A data model ---a collection of concepts that can be used to describe the
conceptual/logical structure of a database--- provides the necessary means to
achieve this abstraction. By structure is meant the data types, relationships, and
constraints that should hold for the data.
 Most data models also include a set of basic operations for specifying
retrievals/updates. Object oriented data models include the idea of objects having
behavior (i.e., applicable methods) being stored in the database (as opposed to purely
"passive" data). According to C.J. Date (one of the leading database experts), a data
model is an abstract, self-contained, logical definition of the objects, operators, and
so forth, that together constitute the abstract machine with which users interact. The
objects allow us to model the structure of data; the operators allow us to model its
behavior.
Data models
Hierarchical Model
• The hierarchical data model organizes data in a tree structure. There is a
hierarchy of parent and child data segments. This structure implies that a
record can have repeating information, generally in the child data segments.
• Hierarchical DBMSs were popular from the late 1960s, with the introduction
of IBM's Information Management System (IMS) DBMS, through the 1970s.
Network Model

• The popularity of the network data model coincided with the


popularity of the hierarchical data model. Some data were
more naturally modeled with more than one parent per child.
• So, the network model permitted the modeling of many-to-
many relationships in data. In 1971, the Conference on Data
Systems Languages (CODASYL) formally defined the
network model.
Relational Model

• A relational database allows the definition of data structures,


storage and retrieval operations and integrity constraints.

• In such a database the data and relations between them are


organized in tables. A table is a collection of records and
each record in a table contains the same fields.
Object-Oriented Model

• Object DBMSs add database functionality to object


programming languages. They bring much more than
persistent storage of programming language objects.

• A major benefit of this approach is the unification of the


application and database development into a seamless data
model and language environment.
Architecture of DBMS
Architecture of DBMS
levels or layers of DBMS
architecture
 Internal Level: - Internal level indicates how the data will be
stored and described the data structures and access method to
be used by the database.
 Conceptual Level: - The conceptual level describes what data
are to be stored in the database and also describes what
relationship exists among those data.
 External Level: The view schema describes the end user
interaction with database systems.
 The internal level has an internal schema which describes the physical storage
structure of the database.
 The internal schema is also known as a physical schema.
 It uses the physical data model. It is used to define that how the data will be stored
in a block.
 The physical level is used to describe complex low-level data structures in detail.
The internal level is generally is concerned with the following activities:

 Storage space allocations.


 Access paths.

 Data compression and encryption


techniques.
 Optimization of internal structures.
 Representation of stored fields.
 The conceptual schema describes
the design of a database at the
conceptual level. Conceptual level
is also known as logical level.
 The conceptual schema describes
the structure of the whole
database.
 The conceptual level describes
what data are to be stored in the
database and also describes what
relationship exists among those
data.
 In the conceptual level, internal
details such as an implementation
of the data structure are hidden.
 Programmers and database
administrators work at this level.
 At the external level, a database contains several schemas that
sometimes called as subschema. The subschema is used to describe the
different view of the database.
 An external schema is also known as view schema.
 Each view schema describes the database part that a particular user
group is interested and hides the remaining database from that user
group.
 The view schema describes the end user interaction with database
systems.
Mapping between Views
The three levels of DBMS architecture don't exist
independently of each other. There must be correspondence
between the three levels i.e. how they actually correspond
with each other. DBMS is responsible for correspondence
between the three types of schema. This correspondence is
called Mapping.
There are basically two types of mapping in the database
architecture:
•Conceptual/ Internal Mapping
•External / Conceptual Mapping
Conceptual/ Internal Mapping
The Conceptual/ Internal Mapping lies between the
conceptual level and the internal level. Its role is to define the
correspondence between the records and fields of the
conceptual level and files and data structures of the internal
level.
External/ Conceptual Mapping
The external/Conceptual Mapping lies between the external
level and the Conceptual level. Its role is to define the
correspondence between a particular external and the
conceptual view.
Advantages of data abstraction in DBMS

Users can easily access the data based on their queries.


It provides security to the data stored in the database.
Database systems work efficiently because of data
abstraction.
2. Physical data independence:
- Change internal schema without changing conceptual schema
- To improve performance of retrieval or update

Most DB & file environments physical details (such as exact location on disk,
h/w details of storage, placement, comparison, splitting, merging of record, etc.)
are hidden from user.
Logical data independence allows changes without affecting application
program
 Physical data independence can be defined as the capacity to
change the internal schema without having to change the
conceptual schema.
 If we do any changes in the storage size of the database system
server, then the Conceptual structure of the database will not be
affected.
 Physical data independence is used to separate conceptual levels
from the internal levels.
 Physical data independence occurs at the logical interface level.
Components of DBMS
Components of DBMS

1. Hardware: Can range from a PC to a network of


computers.
2. Software: DBMS, operating system, network software
(if necessary) and also the application programs.
3. Data: Used by the organization and a description of this
data called the schema.
4. People: Includes database designers, DBAs, application
programmers, and end-users.
5. Procedure: Instructions and rules that should be applied
to the design and use of the database and DBMS.
Actors/People on the scene

Small personal DB – one person defines, construct & manipulate DB & no sharing occurs.
Large DB – Many people involve for design, use & maintenance of DB with 1000’s of users.

People who work for DB system environment are:

DBA(DB Admin.)
DBD(DB Designer)
End User
SE(System Analyst & Application Pgm.er)
Data Base Administrators

 Chief admin. who oversees & manages the resources.

In DB environment: Primary Resource is DB.


Secondary Resource is DBMS & related S/W.

 DBA is responsible for authorizing access to DB, monitoring, acquiring


h/w & s/w resources.
 DBA is responsible for security & system response time.
Database Designers
 Responsible for identifying data in DB, choose apt structure &
store.
 DBD task is before implementation.
 DBD communicate with all DB users & understand their
requirements.
 Then develop views of the DB.
 Each view is analysed & integrated with other user group.
 Final DB should satisfy the requirements of all user group.
End Users
People who access DB for querying, updating & generating reports.

Categories:

Casual end user – occasionally access DB


Naive end user – frequently updating & querying DB
Eg: Bank customers check account balance, withdrawal & deposit
Reservation agent – airlines, hotels, etc
Employee at receiving station – shipping company
social media end user – post & read web sites
Sophisticated end users – People who implement their own applications (Engg., Scientist,
Business analyst, etc.)
Standalone users – people who use ready made pgm. packages
System Analyst/ Application
Programmer
 System Analyst/ Application Programmer – Collects the requirements of
end user & develop specifications.– Implements these specifications as
program, then test, debug, document & maintain
canned transaction (pgm.ed & tested carefully)

They are called as SE.


Hardware
Software
Here the hardware means the physical
Software is the main component of the
part of the DBMS. Here the hardware
DBMS.
includes output devices like a printer,
Software is defined as the collection of
monitor, etc., and storage devices like a hard
programs that are used to instruct the
disk.
computer about its work. The software
In DBMS, information hardware is the most
consists of a set of procedures, programs, and
important visible part. The equipment which is
routines associated with the computer system's
used for the visibility of the data is the printer,
operation and performance. Also, we can say
computer, scanner, etc. This equipment is used
that computer software is a set of instructions
to capture the data and present the output to the
that is used to instruct the computer hardware
user.
for the operation of the computers.
The server can store a large amount of data,
The software includes so many software like
which can be shared with the help of the user's
network software and operating software. The
own system.
database software is used to access the
The database can be run in any system that
database, and the database application
ranges from microcomputers to mainframe
performs the task.
computers. And this database also provides an
This software has the ability to understand
interface between the real worlds to the
the database accessing language and then
database.
convert these languages to real database
When we try to run any database software
commands and then execute the database.
like MySQL, we can type any commands with
the help of our keyboards, and RAM, ROM,
and processor are part of our computer system.
Procedures
Data The procedure is a type of
The term data means the collection of any general instruction or guidelines
raw fact stored in the database. Here the data for the use of DBMS. This
are any type of raw material from which instruction includes how to set up
meaningful information is generated. the database, how to install the
The database can store any form of data, such database, how to log in and log out
as structural data, non-structural data, and logical of the database, how to manage the
data. database, how to take a backup of
The structured data are highly specific in the the database, and how to generate
database and have a structured format. But in the the report of the database.
case of non-structural data, it is a collection of In DBMS, with the help of
different types of data, and these data are stored procedure, we can validate the data,
in their native format. control the access and reduce the
We also call the database the structure of the traffic between the server and the
DBMS. With the help of the database, we can clients. The DBMS can offer better
create and construct the DBMS. After the performance to extensive or complex
creation of the database, we can create, access, business logic when the user follows
and update that database. all the procedures correctly.
The main reason behind discovering the The main purpose of the
database is to create and manage the data within procedure is to guide the user during
the database. the management and operation of the
Data is the most important part of the DBMS. database.
Here the database contains the actual data and
metadata. Here metadata means data about data.
DBMS Languages
Data Definition Language-DDL
• Data Definition Language (DDL) statements are used to
define the database structure or schema.
Some examples:
• CREATE - to create objects /data in the database
• ALTER - alters the structure of the database
• DROP - delete objects from the database
• TRUNCATE - remove all records from a table, including all
spaces allocated for the records are removed
• COMMENT - add comments to the data dictionary
• RENAME - rename an object
Data Manipulation Language
(DML)
Data Manipulation Language (DML) statements are used
for managing data within schema objects.
Some examples:
• SELECT - Retrieve data from the a database
• INSERT - Insert data into a table
• UPDATE - Updates existing data within a table
• DELETE - deletes all records from a table, the space for the
records remain
• MERGE - UPSERT operation (insert or update)
DCL - Data Control Language

DCL commands are used to grant and take back


authority from any database user.
Disadvantage of DBMS

• Cost of Hardware and Software


• Cost of Data Conversion
• Cost of Staff Training
• Appointing Technical Staff
• Database Damage
Introduction to Entity- Relationship
Model:
 ER model stands for an Entity-Relationship
model. It is a high-level data model. This
model is used to define the data elements
and relationship for a specified system.

 These objects are known as entities, and


relationship is an association among these
entities.

 In ER modeling, the database structure is


portrayed as a diagram called an entity-
relationship diagram.
For example, Suppose we design a school database. In this
database, the student will be an entity with attributes like address,
name, id, age, etc. The address can be another entity with attributes
like city, street name, pin code, etc and there will be a relationship
between them.
Component of ER Diagram

Strong Entity
The following are the different symbols used to
draw ER diagrams
Entity:
An entity may be any object, class, person or place. In the
ER diagram, an entity can be represented as rectangles.
Consider an organization as an example- manager, product,
employee, department etc. can be taken as an entity.

Weak Entity
An entity that depends on another entity called a weak entity. The weak entity
doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.
Strong Entity Type: It is an entity that has its own
existence and is independent.
The entity relationship diagram represents a strong entity
type with the help of a single rectangle. Below is the ERD of
the strong entity type:

In the above example, the


"Customer" is the entity
type with attributes such as
ID, Name, Gender, and
Phone Number. Customer
is a strong entity type as it
has a unique ID for each
customer.
Weak Entity Type: It is an entity that does not have its own
existence and relies on a strong entity for its existence.
The Entity Relationship Diagram represents the weak entity
type using double rectangles. Below is the ERD of the weak
entity type:
In the above example, "Address"
is a weak entity type with
attributes such as House No., City,
Location, and State.
The relationship between a strong
and a weak entity type is known as
an identifying relationship(double
ellipse).
Using a double diamond, the
Entity-Relationship Diagram
represents a relationship between
the strong and the weak entity
type.
For example, id, age, contact number, name, etc. can be
attributes of a student.
c. Multivalued Attribute
d. Derived Attribute
An attribute that can be derived from other attribute is known
as a derived attribute. It can be represented by a dashed ellipse.
For example, A person's age changes over time and can be
derived from another attribute like birth Date.
Relationship
A relationship is used to describe
the relation between entities.
Diamond or rhombus is used to
represent the relationship.
Types of relationship are as
follows:
a. One-to-One Relationship
When only one instance of an
entity is associated with the
relationship, then it is known as
one to one relationship.
For example 1, A female can
marry to one male, and a male can
marry to one female.
example 2,
b. One-to-many relationship
When only one instance of the entity on the left, and more
than one instance of an entity on the right associates with the
relationship then this is known as a one-to-many relationship.
For example, Scientist can invent many inventions, but the
invention is done by the only specific scientist.
c. Many-to-one relationship
When more than one instance of the entity on the left, and only
one instance of an entity on the right associates with the
relationship then it is known as a many-to-one relationship.
For example, Student enrolls for only one course, but a course
can have many students.
d. Many-to-many relationship
When more than one instance of the entity on the left, and
more than one instance of an entity on the right associates
with the relationship then it is known as a many-to-many
relationship.
For example, Employee can assign by many projects and
project can have many employees.
Mapping Cardinality
It is expressed as the number of entities to which another entity
can be associated via a relationship set.
For the binary relationship set there are entity set A and B then
the mapping cardinality can be one of the following −
•One-to-one
•One-to-many
•Many-to-one
•Many-to-many
Participation Constraints
Participate constraints are two types as mentioned below −

•Total participation

•Partial Participation
Total participation

The participation of an entity set E in


a relationship set R is said to be total
if every entity in E Participates in at
least one relationship in R.
For Example − Participation of loan
in the relationship borrower is total
participation.

Partial Participation

If only some of the entities in E


participate in relationship R, then the
participation of E in R is said to be
partial participation.
For example − Participation of
customers in the relationship
borrower is partial participation.
Practice :1-

Draw a ER diagram to show student write examination based on the


following scenario

Student(roll no,name,mobile,email),
Examination(Exam_id,subject,academic year,semester,date & time)
Practice :2-

Draw a ER diagram to show customer has an


address
Practice :2-

Draw a ER diagram to show Loan has


installments
Practice :3-

Draw a ER diagram to show employee has


login,department & role
Practice :

Draw a ER diagram for hospital management


with the following scenario

Doctor(Doctor_id,name,address,ph.no)
Patient(patient _id,name,address,ph.no)
Medicine(Name,quantity,amount)
Practice :

Draw a ER diagram for college management.


Represent cardinality ratio.
scenario of database is
1.TEACHER(name,id,address,phno)
2.STUDENT(sname,sid,address,phno)
3.BOOK(NAME.DOI)
4.EXAM(ECODE,ROOM,TIME,DATE)
5.DEPARTMENT(D_ID.DNAME)
6.COURSE(C_ID,CNAME)
7.SUBJECT(S_ID.SNAME)
PRACTICE:

A car-insurance company whose


customers own one or more cars
each. Each car has associated
with it zero to any number of
recorded accidents.
Practice :4-//LAB EXP1:

Consider following databases and draw ER diagram for a given


scenario.
1. COLLEGE DATABASE:
STUDENT (USN, SName, Address, Phone, Gender)
SEMSEC (SSID, Sem, Sec)
CLASS (USN, SSID)
SUBJECT (Subcode, Title, Sem, Credits)
IAMARKS (USN, Subcode,SSID, Test1, Test2, Test3, FinalIA)
Practice :4-

Consider following databases and draw ER


diagram for a given scenario.

2. COMPANY DATABASE:
EMPLOYEE (SSN, Name, Address, gender, Salary,
SuperSSN, DNo)
DEPARTMENT (DNo, DName, MgrSSN, MgrStartDate)
DLOCATION (DNo,DLoc)
PROJECT (PNo, PName, PLocation, DNo)
WORKS_ON (SSN, PNo, Hours)
Min Max notation
Min Max notation
ER Diagrams, Naming Conventions and Design Issues;

ER (Entity-Relationship)Diagram
Entity-Relationship Diagram displays the relationships
of entity set stored in a database. In other words, the ER
diagram helps to explain the logical structure of
databases. It includes many specialized symbols, and its
meanings make this model unique. The purpose of ER
diagram is to represent the entity framework
infrastructure.

The components of the ER Diagram are:



Entities

Attributes

Relationships
Naming conventions

The following are the different symbols used to draw ER diagrams


Proper naming & Schema constructs

Choose singular name


Entity type & relationship type are in UPPERCASE letters
Attributes initial letter in capital rest all in lower case
Entity type name->noun
Relationship type name->verb
ER diagram is readable from left to right & top to bottom

Design choices for ER conceptual design

Concept is modelled first as an attribute(because it’s the reference to other


entity).
Attribute exist in many entities is projected as an independent entity(eg:
Department).
Design Issues

It is occasionally difficult to decide whether a particular concept in the


miniworld should be modeled as an entity type, an attribute, or a
relationship type. In general, the schema design process should be
considered an iterative refinement process, where an initial design is
created and then iteratively refined until the most suitable design is
reached. Some of the refinements that are often used include the following:
A concept may be first modeled as an attribute and then refined into a
relationship because it is determined that the attribute is a reference to
another entity type. It is often the case that a pair of such attributes that are
inverses of one another are refined into a binary relationship. Once an
attribute is replaced by a relationship, the attribute itself should be
removed from the entity type to avoid duplication and redundancy.
3. Placing Relationship Attributes
1) Choosing of Entity Set vs Attributes The cardinality ratios can become an
The use of an entity set or attribute depends on the affective measure in the placement of the
structure of the real-world enterprise that is being relationship attributes. So, it is better to
modelled and the semantics associated with its associate the attributes of one-to-one or one-
attributes. It leads to a mistake when the user use the
to-many relationship sets with any
primary key of an entity set as an attribute of another
entity set. Instead, he should use the relationship to do participating entity sets, instead of any
so. Also, the primary key attributes are implicit in the relationship set. The decision of placing the
relationship set, but we designate it in the relationship specified attribute as a relationship or entity
sets. attribute should possess the charactestics of
the real world enterprise that is being
modelled.
2) Use of Entity Set vs. Relationship Sets
It is difficult to examine if an object can be best
For example, if there is an entity which can be
expressed by an entity set or relationship set. To
determined by the combination of participating
understand and determine the right use, the user
entity sets, instead of determing it as a separate
need to designate a relationship set for
entity. Such type of attribute must be associated
describing an action that occurs in-between the
with the many-to-many relationship sets.
entities. If there is a requirement of representing
Thus, it requires the overall knowledge of each part
the object as a relationship set, then its better
that is involved inb desgining and modelling an ER
not to mix it with the entity set.
diagram. The basic requirement is to analyse the
real-world enterprise and the connectivity of one
entity or attribute with other.
Reduction(Conversion) of ER diagram into relational table
The basic rules for converting the ER diagrams into tables are-

 Convert all the Entities in the diagram to tables. All the


entities represented in the rectangular box in the ER
diagram become independent tables in the database. All
single valued attributes of an entity is converted to a
column of the table. All the attributes, whose value at any
instance of time is unique, are considered as columns of
that table.
 Key attribute in the ER diagram becomes the Primary key
of the table.

 Declare the foreign key column, if applicable.

 Any multi-valued attributes are converted into new table.

 Any composite attributes are merged into same table as


different columns.
 One can ignore derived attribute, since it can be calculated
at any time.
The ER diagram is given below:
There are some points for converting the ER diagram to the table:
•Entity type becomes a table.
In the given ER diagram, LECTURE, STUDENT, SUBJECT and COURSE forms
individual tables.
•All single-valued attribute becomes a column for the table.
In the STUDENT entity, STUDENT_NAME and STUDENT_ID form the column of
STUDENT table. Similarly, COURSE_NAME and COURSE_ID form the column of
COURSE table and so on.
•A key attribute of the entity type represented by the primary key.
In the given ER diagram, COURSE_ID, STUDENT_ID, SUBJECT_ID, and
LECTURE_ID are the key attribute of the entity.
•The multivalued attribute is represented by a separate table.
In the student table, a hobby is a multivalued attribute. So it is not possible to represent
multiple values in a single column of STUDENT table. Hence we create a table
STUD_HOBBY with column name STUDENT_ID and HOBBY. Using both the
column, we create a composite key.
•Composite attribute represented by components.
In the given ER diagram, student address is a composite attribute. It contains CITY,
PIN, DOOR#, STREET, and STATE. In the STUDENT table, these attributes can
merge as an individual column.
•Derived attributes are not considered in the table.
In the STUDENT table, Age is the derived attribute. It can be calculated at any point of
time by calculating the difference between current date and Date of Birth.
Using these rules, you can convert the ER diagram to tables and columns and assign the
mapping between the tables. Table structure for the given ER diagram is as below:
 The degree of relationship in DBMS can be categorized
as Unary, Binary, Ternary, or N-ary relationship.
 In a unary relationship, only one entity is involved. Here,
the degree of relationship is 1. The unary relationship is
also known as a recursive relationship.
 In a binary relationship, there are two entities involved.
The degree of relationship is 2.
 In a ternary relationship, there are three entities involved.
The degree of relationship is 3.
 In an N-ary relationship, there is an n number of involved
entities. The degree of relationship is 'n'.
Data Abstraction DBMS gives an The file system
abstract view of data provides the detail of
that hides the details. the data
representation and
storage of data.
Security and DBMS provides a It isn't easy to protect
Protection good protection a file under the file
mechanism. system
Recovery Mechanism DBMS provides a crash The file system doesn't have a
recovery mechanism, i.e., crash mechanism, i.e., if the
DBMS protects the user from system crashes while entering
system failure. some data, then the content of
the file will be lost.

Manipulation Techniques DBMS contains a wide variety The file system can't efficiently
of sophisticated techniques to store and retrieve the data.
store and retrieve the data.

Concurrency Problems DBMS takes care of Concurrent In the File system, concurrent
access of data using some form access has many problems like
of locking. redirecting the file while
deleting some information or
updating some information.

Where to use Database approach used in File system approach used


large systems which in large systems which
interrelate many files. interrelate many files.
Cost The database system is The file system approach is
expensive to design. cheaper to design.
Examples Oracle, SQL Server, Sybase Cobol, C++ etc.
etc.
QUESTION BANK: MODULE 1

1.Differentiate conventional File processing system and DBMS.


2.Explain the components of the ER Diagram .
3.Construct an E-R diagram for a car insurance company whose customers own
one or more cars each. Each car has associated with it zero to any number of
recorded accidents.
4.Draw the database 3 schema architecture and explain in
5.Explain in detail, data abstraction in DBMS.
6.Illustrate how to perform Reduction(Conversion) of ER diagram into
relational table with an example
7.Explain in detail various components of DBMS
8.a) Briefly explain about mapping cardinalities.
b) Give a short note on different types of database languages

8. Draw an ER diagram for the following application from the hospital:

A doctor has one or more patients to treat

Each doctor has an unique Doctor ID

Each patient has a name, phone number, address and date of birth

Patient entity is a weak entity

Also explain naming conventions and design issues of the ER model.

9. Write the following

a) Primary key

b) Composite attribute

c) Weak entity

d) Identifying relationship

You might also like