Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
13 views16 pages

Unit 1

The document provides an overview of database systems, including definitions of data, databases, and database management systems (DBMS), along with their advantages over traditional file processing systems. It discusses the three-level architecture of databases, data abstraction, and the roles of various users and components within a DBMS. Additionally, it covers mapping cardinalities, data models, and the responsibilities of a database administrator.

Uploaded by

Ritu Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views16 pages

Unit 1

The document provides an overview of database systems, including definitions of data, databases, and database management systems (DBMS), along with their advantages over traditional file processing systems. It discusses the three-level architecture of databases, data abstraction, and the roles of various users and components within a DBMS. Additionally, it covers mapping cardinalities, data models, and the responsibilities of a database administrator.

Uploaded by

Ritu Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Mrs.

Pranali Neeraj Kale SYCM-II (DMS-22319)

1. DATABASE SYSTEM CONCEPT (Marks on this unit – 12 M)

1.1 CONCEPT OF DATA,DATABSE,DBMS


DATA
Data is information that has been translated into a form that is efficient for processing.
i.e. Data can be facts related to any object.
e.g. your age,name,height,weight are some data related to you.
Picture,mage,file,pdf are also data.

DATABASE
A database is a collection of information that is organized so that it can be easily
accessed,managed and updated.
Data is organized into row ,columns and tables.

DATABASE MANAGEMENT SYSTEM (DBMS)


A DBMS is a system software for creating and managing databases.
OR
DBMS: A database-management system is a collection of interrelated data and a set of
Programsto access those data.
The DBMS provides users and programmers to create, retrieve, update and manage data.

ADVANTAGES OR PROPERTIES OF DBMS


State and explain four advantages or properties of DBMS over file processing system
Or
List advantages of DBMS
1. Reduction in Redundancy: Duplication of records is reduced.
Redundancy is the concept of repetition of data. i. e each data may have more
than a single copy. The file system cannot control redundancy.

2. Avoiding Inconsistency: As the redundancy is reduced inconsistency is avoided.


As there is no or less redundancy data remains consistent.Since the same
information can be present at multiple files in file system,data needs to be updated at all
the files whenever any changes in data occur.
e.g. a changed customer address may be reflected in personal information but not
in saving account file. By having centralized database this can be avoided.

3. Maintaining data Integrity: Accuracy is maintained.


There may be cases when some constraints need to be applied on the data before
inserting it in database.The file system does not provide any procedure to check
these constraints automatically.

4. Sharing of data: Sharing of data is possible.


When multiple users use same database on the network it is called as data
sharing.users can do any operations like adding record,deleting,modifying and
searching record.These operations at a time on same data may corrupt the
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

original data and system may fail to do user operations. To avoid these problems
different users with different privileges are created in the system.
In file system data sharing is very difficult.

5. Enforcement of Security: Security can be enforced.


Not every user of database system should be able to access all the data. Database
administrator (DBA) assures the data access to the users by assigning different
privileges.

6. Simplicity
Simplicity means to represent the overall logical view of data in a simple and
clear manner. DBMS is very simple for its users who use it.

7. Backup and recovery


Data loss is a very big problem for all the organizations. DBMS solves this
problem of taking backup again and again because it allows automatic backup and
recovery of database

8. Transaction support

DEFINITION OF DATA REDUNDANCY


Data redundancy means storing same data multiple times at different locations.
APPLICATIONS OF DBMS:
1. Banking
2. Airlines and railways
3. Sales
4. Telecommunications
5. Universities and colleges.
6. Manufacturing
7. E-commerce
8. Credit card transactions
9. Online shopping
10. Library management system
11. Credit card transaction
12. Military
13. Finance

List of DBMS software.


Oracle, MySQL, Microsoft Access, Microsoft SQL Server, IBM DB2, MongoDB

1.2 THREE LEVEL ARCHITECTURE FOR DATABASE SYSTEM


It is based on ANSI-SPARC database architecture.(ANSI-American National Standards Institute,
SPARC-Standards Planning and Requirements committee).
The three levels are as given below:
1) Physical level
2) Conceptual level
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

3) External level
These three levels provide data abstraction means hide the low level complexities from end
users.
End users
external
schema
External / conceptual mapping
conceptual schema
onceptual/ Internal mapping
Conceptual level (or logical level)

internal schema
Database
External level
View1 View2 View3 View n
Physical Level (or internal level)
Mapping is the process of transforming request response between various database levels of
architecture.
In external/conceptual mapping ,DBMS transforms a request from external to conceptual level.
In conceptual/internal mapping ,the request transforms from conceptual to internal levels.

1)Physical level:
• Physical level describes the physical storage structure of data in database.
• It is also known as internal level.
• At lowest level ,it stored in the form ofbits and at highest level,it can be viewed in the
form of files..
• Internal schema defines the data types.

2)Conceptual level:
• Conceptual level describes the structure of the whole database for a group of users.
• It also known as logical level.
• Conceptual schema is the representation of entire content of the database.
• It contains all information to build external records.It hides internal details of physical
staorage.

3)External level:
• External level is related to the data which is viewed by individual end users.
• It also called a view level.
• This level includes a number of user views or external schemas
• This level is closets to the user.

Describe data abstraction with neat diagram.


(Diagram- 1 Mark, Description of each level-1 Mark)
Ans:
Data abstraction is a process in which developer hides the complexity from the user to
simplify the user interaction with the system. There are three levels of abstraction.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

Three levels of abstraction are as follows:


1) Physical level
2) Logical level
3) View level

Explanation:
1) Physical Level:
• It is lowest level of abstraction.
• This level defines lowest complicated data structure of database system.
• This level hidden from user.
• It defines how the data are stored.

2) Logical Level:
• The level next to physical level is called logical level.
• This level defines what data stored in the database and what the relationships among
these data are.
• Fully decides the structure of the entire database.

3) View Level:
• This level is used to show the part of database to user.
• There is more complexity in physical as well as logical level so user should not interact
withcomplicated database.
• So different view of database can be created for user to interact with database easily.

INSTANCE and SCHEMA


Instance / ( or Database state or snapshot):
The data is stored in the database at a particular moment or time is called as instance / database
state /snapshot.
Schema:
The overall design structure of the database is called as schema.
OR
It is the overall description or the design of the database specified during the database design.
A database schema can be divided into two types.
1)Physical database schema:
Thios schema defines the actual storage of data and its form of storage like files,indicesetc.It
defines how the data will be stored in a secondary storage.
2) Logical database schema:
This schema defines all the logical constraints that need to be applied on the data stored.
It defines tables,views and integrity constraints.

DATA INDEPENDENCE- logical and physical independence


Definition: Data independence is ability to modify a schema definition in one level without
affecting a schema definition in next higher level.
There are two levels of data independence.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

1)Physical data independence


2)Logical data independence

PHYSICAL DATA INDEPENDENCE:


• Physical data independence is the ability to modify the physical schema without any
change inany application programs.
• Physical data independence seperates conceptual levels from the internal level.
• It is easy to achieve physical data independence.
LOGICAL DATA INDEPENDENCE:
• Logical data independence is ability to modify the conceptual schema without any change
in application programs,
• Logical data independence seperates external level from conceptual level.
• It is difficult to achieve logical data independence.

1.4:OVERALL STRUCTURE OF DBMS


Sycm
Ms.S.A.Kshirsagar
DMS(22319)

Sou.Venutai chavan polytechnic, Pune Page 8


List of DBMS user:
a) Naive users
b) Application programmers
c) Sophisticated users
d) Specialized users
e) Database administrator
a) Naive User:
• Naïve users are unsophisticated users
• They are interact with the system through the application program.
• They give data as input through application program or get output data which is
generated by application program.
• Example: Bank cashier.
b) Application programmers:
• Application programmers are the users who write the program.
• These programmers use programming tools to develop the program.
• RAD technology is used to write the program.
c) Sophisticated users:
• Sophisticated users interact with the system by making the requests in the form of query
language.
• These queries are then submitted to the query processor.
• Query processor converts the DML statements into lower level interactions which are
understandable by storage manager.
• Some sophisticated users can be analyst.
d) Specialized users:
• These users are not traditional.
• They write some special application programs which are not regular applications.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

• Example: such types of applications are CAD, knowledge based and expert system.
e) Database administrator:
• Responsible for managing whole database system , create and maintains database.
• Manages users who can access the database and manages integrity issue.
• Manages performance of system as and when required.
different components of DBMS are as follows:
1. Query Processor (DDL interpreter, DML compiler, Embedded DML Pre-Compiler, Query
Evaluation Engine)
2. Storage Manager (Authorization and Integrity Manager, Transaction Manager, File Manager,
Buffer Manager)
3. Disk Storage ( Data Files, Data Dictionary, Statistical data, indices)

QUERY PROCESSOR:
The query processor components include:
1. DDL Interpreter: It interprets DDL statements and records them in a set of tables containing
metadata or data dictionary.
2. DML Compiler: It translates DML statements of high level query language into low level
instructions that query evaluation engine understands.
3. Embedded DML PreCompiler: It converts DML statements embedded in application
program to normal procedural calls in host language. The precompiler must interact with the
DML compiler to generate the appropriate code.
4. Query Evaluation Engine: It executes low level instructions generated by DML compiler and
DDL

STORAGE MANAGER:
The storage manager components include:
a)Buffer manager:
It is responsible for retrieving data from disk storage to main memory.
b)File manager:
Manages the allocation of space on disk storage and the data structure used to represent
information on disk.
c)Authorization and integrity manager:
checks for integrity constraints and authority of users to access data.
d) Transaction manager:
Ensures that the database remains in consistent state although there are system failure.

DISK STORAGE:
The disk storage components include:
a)Data files:
stored in the database itself.
b)Data dictionary:
stores metadata about the structure of the database,
c)Indices:
provide fast access to data items.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

List four function of database administrator.


(List any four function - 1 Mark each)
Ans: Function of database administrator
1. Schema Definition: The DBA creates database schema by executing DDL statements.
2. Storage structure and access method: The storage of the data structure and how to access data
from it is handled by DBA.
3. Granting of authorization for data access: The DBA will grant and restrict access to the user
4. Regular Maintenance of Database: The DBA performs some of the routine maintenance
activities like periodic backups, ensuring enough disk space is available.
5. Schema and Physical organization modification: DBA writes a set of definitions to modify the
database schema or description of physical storage organization.
6. Integrity-constraint specification: Integrity constraints are written by DBA and they are stored
in a special file, which is accessed by database manager, while updating the data.
7. Back-up and Recovery: DBA also takes backup of the data on a backup storage device so that
if data then lost then it can be again recovered and compiled. DBA also recovers the damaged
data.

MAPPING CARDINALITIES / RATIO


Definition: The degree to which one entity is related to other entity is known as mapping
cardinalities of the relation.

TYPES OF MAPPING CARDINALITIES


For a relationship set ‘R’vbetween entity set A and B the mapping cardinality must be one of the
following:
1)ONE TO ONE (1:1)
An entity in A is associated with atmost one entity in B and An entity in B is associated with
atmost one entity in A.
AB
1:1 a1 b1

2) ONE TO MANY ( 1:n)


An entity in A is associated with any numbere of entities in B and any number of entities in B
can be associated with atmost one entity in A.
a2 b2

a3 b3

a4 b4

AB
1:n a1 b1
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

3)MANY TO ONE (n:1)


any number of entities in A are associated with atmost one entity in B and an entity in B can be
associated with any number of entities in A.
AB
4)MANY TO MANY (n:n)
Any number of entities in A are associated with any number of entities in B and vice versa.
AB
n:n
a2 b2

a3 b3

a4 b4

a1 b1
a2
a3
a4 b3

b2
a5
a1 b1

a2 b2
a3 b3

a4
b4

List various data models.


List any two data model. 2M
Ans: Data Models:
1. Hierarchical Model
2. Network Model
3. Relational Model
4. Entity Relationship Model

DATA MODEL
Data model is a collection of tools for describing data,relationships ,consistency constraints.
It describes the the structure of database at physical,logial and view level.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

TYPES OF DATA MODELS:

1)Object based logical model


a)E-R model b)Object oriented model
2)Record based logical model
a)Relational model b)Hierarchical model c)Network model
1) RELATIONAL MODEL:
Relational Model represents the database as a collection of tables. A table is a database object
that stores data in form of rows and columns. Each row in the table represents collection of
related data value.
Tuple: In relational model, a row is called as tuple.
Attribute: A column header is called as an attribute.
Degree: The degree of relation is number of attributes of the table.
Domain: All permissible values of attributes is called as a domain.
Cardinality: Number of rows in the table is called as cardinality
e.g. Create table Student_details(RollNo number(3),Name varchar(15),City varchar(30));
Student_details:
Nita Pune
Rahul Mumbai
Rakesh Solapur

Sycm
Ms.S.A.Kshirsagar
DMS(22319)

Sou.Venutai chavan polytechnic, Pune Page 13


In the above example Student_details is the name of Relation. There are three attributes RollNo a
Name and city so Degree is 3. In the relation there are three tuples(rows) so Cardinality is 3.

2)HIERARCHICAL MODEL:
• Hierarchical database model is the oldest database model.
• The data are organized into tree like structure.
• This structure allows parent / child relationship.
• Int this model parent can have many childrens but child can have only one parent.
• The hierarchical model organizes data elements as tabular rows one for each instance of
an entity.
• Drawback of this model is that,it can have only one to many relationships between nodes.
The above hierarchical model can be represented as relational model as follows
Nita Pune
Rahul Mumbai
Rakesh Solapur

• Hierarchical model is identical to the network model as data is represented by record and
relationship represented by links.
• The hierarchical model is simple and easy to design but quite complex to implement.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

• it is based on parent/child relationship so there is always links between the parent and
child under it.The relationship is one to many.

3)NETWORK MODEL:
• Network model has graph like structure.
• In the network model data are represented by records and relationship among data are
represented by links.
• A network model permits a record to have more than one parent.
• The network model is simple and easy to design.
• It can handles one -to -many and many- to - many relationships.

Difference between network model and hierarchical model

1.6 Data modeling using the E-R model:


Entity Relationship Model:
The Entity relationship(E-R) model is a high level data model developed by chen in
1976.It is based on representation of real world.
It consists of set of entities and relationship among them.
Entity - An entity is a thing or object present in the real world.It may be physical or logical.
e.g. student,employee,book,hospital,sale,inspection.

Entity set- Collection of entities is called entity set.


Relationship – It is an association among several entities.
Attribute: Properties or characteristics of an entity is called as an attribute.
For example, a student entity may have name, class, and age as attributes.
Domain:All permissible values of an attribute is called as domain.
e.g: student is an entity
Rollno,stud_Name, stud_addr are attributes
Here domain of attribute rollno is the set of all values of rollnos.
Here D1 is domain of Rollno, D2 is domain of Stud_Name , D3 is domain of stud_addr

TYPES OF ATTRIBUTES:
An attribute can be characterized by the following attribute types:
1. Simple attributes: Attributes which cannot be divided into subparts are known asSimple
attributes. E.g .RollNo.
2. Composite attributes:Attributes which can be divided into subparts are known as composite
attributes.
e.g 1) Name can be divided as First_name,Middle_name,Last_name
Name
First name Last name
Middle name
2) Address can be divided into street,city,state,code. And street can be divided into
street_no,street_name,apt_name
Address
Street City State code
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

Street_no Street_name Apt_name


3. Single-valued attribute: The attributes that hold a single value for a single entity
aresinglevalued attributes. E.g DOB, Roll_no.
4. Multivalued attributes :If an attribute is having multiple values for particular entity then it is
called multivalued attribute. E.g. MobileNo, Address
5. Derived attributes: The value of attribute can be derived from the valuesof other attributes or
E.g Age attribute can be derived from attributeDOB
6. Null attributes : A NULLvalue is used when an entity does not have a value for anattribute.

E-R DIAGRAM:
Def : An E-R diagram express the overall logical structure of a database graphically.
The symbols used in E-R diagram are:

Describe strong and weak entity set.


Ans: Strong Entity Set: An entity set that have sufficient attributes to form a primary key is
called a strong entity set.
OR
An entity set that have a primary key of its own is referred as Strong entity set.
Weak Entity:
An entity set that does not have sufficient attribute to form a primary key is called as Weak
Entity.
OR
A Entity set that does not have a Primary key of its own is referred as a weak entity
set.
Example:
In the above diagram Employee is a Strong Entity and Dependent is Weak Entity as it depends
on Employee.
Partial key: It is a unique attribute of a weak entity set.

DIFFERENT TYPES OF AN E-R DIAGRAM:


a)simple E-R diagram
customer and loan relationship
Primary key- cust_id is the primary of customer ,
loan_nois the primary of loan
Foreign key-cust_id is foreign key of loan
Loan no is foreign key of customer

2) An E-R diagram with an attribute to a relationship set


employee and company relationship
Primary key- empl_id is the primary of employee,
comp_id is the primary of company
Foreign key- empl_id is the foreign key of company
comp_id is the foreign key of employee

3)An E-R diagram with composite, multivalued and derived attribute


Primary key-cust_id is the primary of customer
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

composite attribute-Name
Derived attribute- Age
Multivalued attribute-phone_no

Important E-R diagram from MSBTE Papers:


Q.1 construct E-R diagram for customer branch and account relationship
fig: customer branch and loan relationship
Primary key- branch_ id is the primary of customer branch
account _ no is the primary key of account
Foreign key- branch_id is the foreign key of account
account_no is the foreign key of customer_branch

Q2.Draw an E-R diagram of library management system considering issue and return, fine
calculation facility
Primary key- mem_id is the primary key of member
book_id is the primary key of books
pub_id is the primary key of publisher
Foreign key-mem_id is the foreign key of books
book_id is the foreign key of publisher
mem_id , pub_id is the foreign key of books

Q.3 E-R diagram for railway reservation system


Primary key- seat_no is the primary key of passanger_detail
train_id is the primary key of train_detail
payment_id is the primary key of payment detail
booking_id is the primary key of booking
Foreign key-payment_detail:payment_id
Passanger_detai: payment_id, train_id
Train_detail : passanger_id ,booking_id
Booking : tarin_id

Q.4 Draw E-R diagram for airline reservation system. Here a passenger can book ticket
from personal for a flight on same date.
Primary key- p_id is the primary key of passanger_
A_id is the primary key of Airport
F_id is the primary key of flight
id is the primary key of payment
Foreign key-payment: p_id
Passanger: id, A_id
Airport :p_id,f_id
Flight:A_id

Q.5 Draw E-R diagram for Hospital management system.


Primary key- p_id is the primary key of patient
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

Hospid is the primary key of Hospital


Doc_id is the primary key of Doctor
Record_id is the primary key of medical_record
Foreign key-Patient:Hosp_id,record_id
Hospital:p_id,doc_id
Medical record:p_id
Doctor: Hosp_id

Q.6. An E-R diagram for school/college management system


Primary key- roll_no is the primary key of student
Class_no is the primary key of class
sub_id is the primary key of subject
WEAK ENTITY SET- section
Section_no is the primary key of weak entity set section
Foreign key-student:sub_id , class_no
class:roll_no
section:class_no
subject: roll_no
Derived attribute - age
Composite attribute - address

MSBTE QUESTIONS
1. Define Database. List any two properties of database. ………………………2M
2. State and explain four advantages or properties of DBMS over file processing
system.(Any four Advantage - 1 Mark each)…………………………………………4M
3. Define DBMS. List any two applications of DBMS.………………………2M
(Definition- 1 Mark, Any 2 Application- /2 Mark each, Any relevant applications can
be considered)
4. What is meant by data redundancy? ………………………………………2M
(Correct Definition - 2 marks)
5. List any four DBMS software. ………………2M (Any four software - ½ mark each)
6. Describe data abstraction with neat diagram.………………………………………4M
(Diagram- 1 Mark, Description of each level-1 Mark)
7. Draw a neat labeled diagram of overall DBMS structure.………………………4M
(For diagram - 4 Marks)
8. Enlist different components of DBMS……………………………………………..2M
9. List four function of database administrator………………………..2M
10. List and explain types of DBMS users……………………………4M
11. List out query processing components and state their function.…………………4M
12. Describe Relational model with example. ………………………………..4M
(Explanation - 2 marks; example - 2 marks)
13. Compare network and hierarchical model. …………………………………4M
14. Define attribute and entity. ……………….…………………………………2M
(Definition of Attribute - 1 mark; Entity - 1 mark)
15. What are the types of attributes?(Any Four attributes – 1Mark each)……………4M
16. Explain single value and multivalue attribute of E-R model.……………………..2M
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

17. List various symbols used in E-R diagram. ………………………..4M


18. Describe strong and weak entity set. ………………………..2M
19. List various data models. ………………………..2M
20. List any two data model. ………………2M(List any four function - 1 Mark each)
21. What is the difference between weak entity set and strong entity set?………….4M
22. Draw an E-R diagram of library management system considering issue and return,
finecalculation facility. ………………………..4M
23. Draw E-R diagram for airline reservation system. Here a passenger can book ticket
from personal for a flight on same date. ………………………..4M
24. Draw E-R diagram for customer and loan. Assume suitable Attribute. …………2M
25. Draw an ER diagram for Library Management System. ………………………..4M
(Suitable entities – 1 Mark, Proper attributes – 1Mark, Correct relationships showing
26. Draw an E-R diagram of hospital management system. ………………………..4M
(Suitable entities – 1 Mark, Proper attributes – 1Mark, Correct relationships showing)
27. Draw an E-R diagram of library management system considering issue and return,
fine
28. calculation facility.(basic activities of library – 1Mark, correct symbols- 1Mark)
………..4M
29. construct E-R diagram for customer branch and account
relationship…………………..2M
30. E-R diagram for railway reservation system.…………………..4M
Sycm
Ms.S.A.Kshirsagar
DMS(22319)

Sou.Venutai chavan polytechnic, Pune Page 29


IMP questions
1. Define a)Database
b)DBMS
c)Instance
d)Schema
2. State and explain four advantages or properties of DBMS over file processing
system.
3. List out applications of DBMS.
4. What is meant by data redundancy?
5. List any four DBMS software and Database users.
6. Describe data abstraction with neat diagram.
7. Draw and explain a neat labeled diagram of overall DBMS structure.
8. Describe Relational model with example.
9. Compare network and hierarchical model.
10. Define attribute and entity.
11. What are the types of attributes?
12. List various symbols with its functions used in E-R diagram.
13. List various data models.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

14. What is the difference between weak entity set and strong entity set?
15. Draw an E-R diagram of library management system considering issue and return,
finecalculation facility.
16. Draw E-R diagram for airline reservation system. Here a passenger can book ticket
from personal for a flight on same date.
17. construct E-R diagram for customer branch and account relationship…
18. Draw E-R diagram for customer and loan. Assume suitable Attribute.
19. Draw an E-R diagram of hospital management system.
20. E-R diagram for railway reservation system.
Mrs. Pranali Neeraj Kale SYCM-II (DMS-22319)

You might also like