DocScanner 7 Dec 2023 19-32
DocScanner 7 Dec 2023 19-32
PART-1
Overview, Database System,us File System,
Database System Concept and Architecture.
Questions-Answers
Long Answer Type andMedium Answer Type Questions
Answer
Advantages of DBMS: K02ati!
redundancy: It controls data redundancy because it stores
1 Database
all the data in one single database file and that recorded data is placed
722in the database.
Page 2 of 32
1-3A (OSTT-Sem-5)
Management System users of an organization can
Database authorized
DBMS, the
sharing: In users.
Data among multiple maintainable due to the centralized
share the data can be easily
maintenance:It
. Easy
nature of the database
system.
development time
and maintenance need.
3. Specialized users: r
Ein ?
(roitxiu
ga. These are also sophisticated users, but they write special database
'se appication programs.g
They are the developers who develop the complex programs
b
AnsVer
over data and
Database administrators are the personnel's who has control
programs used for accessing the data.
Functions/role of database administrator (DBA):
1. Schema definition:
a. Originaldatabase schema is defined by DBA.
are
b. This is accomplished by writing a set of definitions, which
translated by the DDL compiler to a set oflabels that are permanently
stored in the data dictionary.
:
2 Storage structure andaccess method definition
deue
a. The creation of appropriate storage structure and access method.
b. This is accomplished by writing a set of definitions, which are
translated by the data storage and definition language compiler.
3. Schema and physical organization and modification :
a. Modification of the database schema or the description of the physical
storage organization.
b. These changes are accomplished by writinga set of definition to do
modification to the appropriate internal system talbles.
Page 4 of 32
Logical level
Physical level
Fig, 1.5.1. The three levels of data abstraction,
:
1. Physical level
i Physical level is the lowest level of abstraction and describes how
the data are actually stored.
The physical level describes the complex low-level data structures
in details.
2 Logical level :
'otri
Logical level is the next-higher level of abstraction and it describes
what data are stored in the database, and what relationship exists
among those data.
iü. The logical level thus describes the entire database terms a
in of
small number of relatively simple structures.
3. View level:
View level is the highest level of abstraction;
it describes only part
of the entire database.
*iy
of abstraotio
in , The view level
with
exists to simplify their interaction
the system,I.sli.)i: isoibo
ii The system may provide many views for the same
database.
Page 5 of 32
Answer
S.No. Physical level Conceptual/ View level
Logical level hd4l
1. Thisis the lowest |This is the middle levelThis is the, highest
level of data of data abstraction. level of data
i abstraction. abstraction.
It describes howIt describes what data It describes theuser
Godata is actually is stored indatabase. interaction with
stored in database. database system.
3. It describes the It describes the It describes only those
complex low-level structure of whole part of the database
data structures in database. and hides in which the users are
detail. details of physical interested and hides
storage structure. rest of all information
siiti from the users.
aigrs
1-7A(CST-Sem)
Management System
Database
File system do not have a
DBMS. provides. a, crash| Crash
mechanism, i.e., if the system
3.
recovery mechanism, i.e.,
from| crashess while enteringssome
DBMS protects the data data
failure. then the content of the file will
the system lost.
is very difficult to protect a
DBMS provides a
good| It file
4
under the file system.
protection mechanišm.
File system cannot eficiently
DBMS can efficiently store and| store
5.
retrieve the data. and retrieve the data.
Ifor
6 DBMS takes careofIn the file system, concurrent
concurrent access of data using access has many problems l1
, redirecting the file while other.
some form of locking.
deleting some information or
Answer
client
The DBMS design depends upon its architecture. The basic
server architecture is used to deal with a large number of PCs, web
servers, database servers and other components that are Connected
with networks.
2. architecture depends upon how users are connected t0 ne
DBMS
database to get their request done.
Types of DBMS architecture:i sSih e
i 1-Tier architecture :
user.
1 In this: architecture, the database
is directly available tothe
It does
directly done on the database itself.
2.
Any changes done are
not provide a handy tool for end users.
local
3. The 1-Tier architecture
used for development--of
is
with
the
application, where programmers can communicate
directly
atite the database for the quick response.
ii. 2-Tier architecture:
*
1.i The 2-Tier architecture is same as basic client-server:
can
end For
bt2.. In the two-tier architecture, applications on the clientside.
directly còmmunicate with
the database at the server
this interaction, API's such as:
ODBC, are used.
JDBC
2
The user interfaces and application programs
client-side. are
Page 7 of 32
Application
Client
User
Fig. architecture.
l8.1. 2-Tier
iüi. 3-Tier architecture:
The 3-Tier architecture contains another layer between the client
and server. In this architecture, client cannot directly communicate
25D,ith the erver.
2. The application on the client-end interacts with an application
server which further communicates with the database system.
3
End user has no idea about the existence of thenodatabase beyond
any
the application server. The database also has idea about
other user beyond the application.
r4 The 3-Tier architecture is used in case of large web application.
Database
Server
Application server
|Application client
Client
User
tobsa,Ieroining
Page 8 of 32
PART-2
Data Model Schema and Instances, Data Independence
Database Language and Interfaces, Data Definition and
Language DML, Overall Databasee Structure.
Questions-Answers
Long Answer Type,and Medium Answer Type Questions
(Attribute) (Attribute)
tsite ii (Attribute (Attribute)
Entity
Relationship
Entity
OR
Explain data independence with its types.
AKTU 2019-20,
Marks 07
Answer
Data independence:Data independence
is defined as the capacity to chano
the schema at one level of a database system
schema at the next without having to change t
higher level.
Types ofdataindependence:
1. Physical data independence:
Physical data independence is
2tornal
the ability to modify i
without changing the conceptual schema. schema
b. Modification at the physical
level is occasionally necessary order
to improve performance. in
C. It refers tothe immunity of the conceptual
internal schema. eri schema to change in the
Lerisn si g
Discuss thefollowing OR
terins (i) DDL Command
(ii)
DMIGComimand
U
AKYU 2019-20 Marks
Page 11 of 32
Answer
Classificntion of datnbnso lnngunges : oalfs eozush jncs
:
1, Data Definition Longunge (DDL)
a. DDL is set of SQL commands uscd to create, modify and delete,
BaO database structures but not data." ioT St)3 ,AA
b. They are uscd by theDBA toa limited extent, a database designer,
or application devloper.
C. Create, drop, alter, truncate are commonly used DDL Command.
Data Manipulation Language (DML) :
a. A DML is a language that enablès users to access or manipulates
data as organized by the appropriate data model.
There aretwo types of DMLs
b :
Answer
Database languages: Refer Q. 1.12, Page 1-11A, Unit-1.
:
Examples
DDL:to
CREATE, ALTER, DROP, TRUNCATE, COMMENT, GRANT,
REVOKE
statementts iroltil siigebos
DML:
INSERT, UPDATE, DELETE statement
DCL:
a
GRANT and REVOKE statement
DQL:
SELECT statement
VDL:
create view emp5
1.
select *
asts
fromemployee.ohh0th n
e
where dno = 5;
Creates view for dept 5 employees.irzus isy o
Answer
DBMS interfaces :A database management system
user interface which allows for (DBMS) interface is a
the ability input queries to a database
to
without using the query language itself.
Various DBMS interfaces are: 9tocr2 d: gricb 11
b
Users can fillout all of the form entries to insert new data, or they
can fill out only certain entries, in which the DBMS will retrieve
matching data for the remaining entries.
3. Graphical user interfaces (GUI) :
a. A GUI typically displays a schema to the user in diagrammatic
form.
b
The user then can specify a query by manipulating the diagram. In
many cases, GUIs utilize both menus and forms.5eql.
:
4. Natural language interfaces
a. A natural language interface has its own schema, which is similar
to the database conceptual schema, as well as a dictionary of
important words.
b
The natural language interface refers to the words in its schema,
as well as to the set of standard words in its dictionary to interpret
the request.
c.
If the interpretation is successful, the interface generates a high
level query corresponding to the natural language request and
submits it to the DBMS for processing; otherwise, a dialogue is
started with the user to clarify the request.
5. Speech input and output :
a. The speech input is detected using a library of predefined words
and used to set up the parameters that are supplied to the queries.
b. For output,a similar conversion from text or numbers intospeech
takes place.
6. Interfaces for the DBA:
Most database systems contain privileged commands that can be
used only by the DBA's staff.
b. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema,
and reorganizing the storage structures of a database.
Que 1.15. Briefly describe the overall structure of DBMS.
OR : i
A database system is partitioned into modules that deal with each of the
responsibilities of the overallsystem. The functional components of a database
system can be broadly divided into two components iieizno9 A
Tools)
Compiler and
Application Linker DML Queries
Program Object DDL
Interpreter
Code
DML Compiler
t k
s6 and
Organizertt o
.
|Query Evaluation
Engine
sQuery processor
Buffer
manager File Authorization
manager and ransaction
integrity manager
manager
7 Storage manager
Indices
Data
Dictionary Disk storage iu
D2!
Data
Statistical
data
PART-3
Data Modeling using the Entity Relationship Model: ER Model Concepts
Notation forER Diagram, Mapping Constraints
Questions-Answers
Angwer
An entity relationship model (ER model) is a way. of representing the entities
create aa database.
and the relationships betweenthe entities in order to create
Page 16 of 32
1-17A((OSISema
System
Management
Databaso modelldiagram :
Elements/notation ofCR
that can be easily identifiable.
1. Entity: a real world object
Anentity is
can be abstract.
An entity
object that exists and is distingumshable rom othe
an
An entity is
C.
objects.
9
set : of similar type of entities.
2 EntityEntity set is a collection
contain entities with attribute
sharing similk
Sa. b. An entity
set may
tcivalues.
3. Attribute: characteristics of the entity, ii
An attribute gives the
ata also called as data
field, a field,
element, datafe
a data item, oran
b
It
is 0:daersi
U2 elementary item,!i
Relationship :
4. entities or enti
A
relationship is the association between
a.
Occurrence. Bna
type
Course
name department)
AKTU6-)
Answer Mano
addross
Store
Payment
KAvailablo
D Product
Product
Address
Salary
Demand
Employee
name
KEmployee
itema
(Empoyee
delkvery
of Deliverv
ID(No.
name)
of
Number
7
KInitiates
Order Promotion
codeD(Promno
type
Availability) No.
Shipping
ecation
Order Tracking
Pie
D) Prom0
Product
name
uct
thee0:4 A.university
following
sylabus entities registrar's
(a) courses, office maintains dataan
and prerequisites;
including title, c (b) course number, co
offerings, including
Page 19 of 32
Answer
In this ER diagram, the mnain entity sets are student, course, course offering
and instructor. The entity set course offering is a weak entity set dependent
on course. The assumptions made are
::ial iovs! t8.
a.í A class meets only at one particular place and time. This ER diagram
cannot model a class meeting at different places at different times.
b. There is no guarantee that the database does not have two classes
so meeting at the same place and time, bts r ii
i
Koffered
syllabus courseno
prerequisite
requires cOurse title
maincourse
(credits)
AnswVer
1. Mappingconstraints act as arule followed by contents of database
2
Data in the database must follow the constraints. it e
5Toc
Types of mapping constraints are:oi: iTGOGtyEs su:
1. Mapping cardinalitios.!} troetRuof? g'sdnoe
a. Mapping cardinalities (or cardinality ratios) specifies the number of
entities of which another entity can be associated via a relationshin
set.
sb. Mapping cardinalities are used in describing binary relationship
islins sets, although they contribute to the description relationship
of
sets that involve more than two entity sets.3h
st
C. For binary relationship set R between entity sets A
mapping cardinality must be one of the following:Rs
and B, the.
One to one: An entity in A is associated with at most one
entity in B and an entity in B is associated
with at most one
entity in A.
A B
ite
b
ag ba
Fig l211
ii. One to many:An entity in A is associated any number
of entities in B. An entity in B, however, can with
be associated with
at most one entity in A.
B
b,
a
b4
a4 ba
Fig. l21.3.
any
iv. Many to many An entity inAis associated with any number
:
an b
a
bg
OST:taebi sL2.t
Fig l 214
of entity sets.
Participation constraints It tells: the participation
:
2.
There are two types of participations yad
Partial participation s2i jite
S0i 2ittsrebi vlerpi 9siev ioreinn03
Total participaion
PART-4
Key,
Keys, Concept ofSuper Key, Candidate
Pruman Key, Generalization, AggTegation.
Questions Answers
TVpe Questions
Long Answer Type and Medlium Answer
super key,
Que 122.| Discuss the candidate key, primary key,
composite key and alternate key.
Page 22 of 32
OR
Define key. Explain various types of keys.
AKTU 2019-20, Marks07
Answer
Key is a attribute or set of
1
4 Composite key :
A composite key is a combination of two or more columns in:a
table that can be used to uniquely identify each row in the table.
b. It is used when we cannot identify a record using single attributes.
C. A primary key that is made by the combination of more than one
.
sttribute is known as a composite key.
Alternate key:
a. The alternate key of any table are those candidate keys which are
not currently selected as the primary key.
b. Exactly one of those candidate keys is chosen as the primary key
s
and the remainders, if any are then called alternate keys.
C.
An alternate key is a function of all candidate keys minus the
prìmary key.
d. Here in Employee table if EmployeeID is primary key then SSN
would be the alternate key.itsil:
:
6. Foreign key
betweenen tables and
a. Foreign key represents the relationship
ensures the referential integrity rule. i slacsrg i0
same or some
b.A foreign key is derived from the primary key the
of
(naaother table.
one or more columns ina table
C. Foreign key is the combination of (child
(parent table) at references a primary key in another table
table).
A foreign key value
can be left null..
d :
Que 123. What do you mean by a key tothe relation ? Explain the
differences between super key, candidate key and primary key.
10
BMarks
AKURZ0DO
Registration Vehicle id
osiog
Colour Make
ig, 1:23.1 An entioND
.0AR for defining keys,
0f:vu
Page 25 of 32
Answer
Generalization:
. Generalization isa process in which two lower level entities combine
to form higher level entity.
b. It is bottom-up approach.
C. Generalization is used to emphasize the similarities among lower level
entity sets and to hide the differences.
:
For example Generalization
Account
Saving Current
Fig. 124.1.
:
Specialization into lower
Specialization is a process of breaking higher level entity
232070
level entity.
b
It is top-down approach.
c.
Itis opposite to gemeralization.
:
For example Specialization
Person
|EmployeeCustomer
Fig. l242.
:
Aggregation
are treated
a. Aggregation is an abstraction through which relationships
as higher level entities.
:
For example
1. The relationship works_on (relating the entity sets employee, branch
and job) act as a higher-level entity set. on
2. We can then create a binary relationship Manages', between works
and manager to represent who manages what tasks.
Page 26 of 32
Job
Manages
Manager
Fig. 124.3. ERdiagram with aggregation.
:
Comparison
S. No.
Generalization Specialization Aggregation
1. In generalization, In specialization, an Aggregation is an
the common entity of higher-level |
abstraction through
attributes of two orentity is broken down which relationships
more lower-level into two or more are treated as higher
entities combines entities oflower level. level entities.
to form a new
higher-level entity.
2
Generalization is a Specialization is a top- It allows us to
bottom-up down approach. indicate that a
approach. relationship set
participates in
relationship
Liiahother set.
3. It helps in reducing It increases the size It also increases the
the schema size. of schema. size of schema..
4. Itis appliedtogroup It can be applied to a It is applied to group
of entities. single entity. of relationships.
PART-5
an
Reduction of
Diugram to Tables, Etended
ER ER Model
cie6 RelationshipofHighen Degree,
49Questions Answers
fio ong Answer Type and
MediumAnswerType.Questtons
Page 27 of 32
Course_Name
Subject_ID
Course_ID
JTUieb:
Course Subject
M
Has
Course_ID:
State
Pin Attends
Takes Teaches
Course_ID
City
isutivi|š)(Street)(
Address
Teaches Lecturer_Namne
Door_No)
ID)
Student_Name
ID Lecturer
Student
Age
Hobby
Page 28 of 32
ER diagram
become independent tables in the database.
b. In the ER diagram, Student, Course, Lecturer and Subjects fo
individual tables.
Al single-valued attribute becomes a column ifor the table:
Allthe attributes,whose
value at any instance of time is unigue
are considered as columns of that table.
b. In the Student entity, Student_Name and Student ID formithe
column of Student table. Similarly, Course_Name
and Course ID
form the column of Course table and so on.
3 Akey attribute of the entity is the primary key:
a. All the attributes represented in the oval shape
and underlined in
the ER diagram are considered as key attribute which act as a
primary key of table.
b. In the given ER diagram, Student_ID, Course_ID, Subject ID, and
Lecture ID are the key attribute of
the Student, Course, Subjects
and Lecturer entity.
4. The multivalued attribute is represented by a separate
table:
a. In the student table, a hobby is a multivalued
attribute.
b. So it is not possible torepresent multiple
values in a single column
ofStudent table. Hence we create a table Stud Hobby
name Student_ID and Hobby. with colum
Using both the column, we create a
composite key.
5. Composite attributes are merged into same
columns : table as differen
a In the given ER diagram, student addressis a composite
attribute
It contains City, Pin, Door_No, Street, and
b
State.
In the Student table, these attributes can merge as an
column. indiviau
6 Derived attributes are not considered
in the table :
In the Student table, Age is the
derived attribute.
b
It can be calculated at any point of time by calculating
between current date and Date the difer
of Birth (DoB).
Page 29 of 32
1-30 AnsTSem-5)
A'(
KCS2 inoxgSi Tntroduction
Stud_Hobbey
Student _ID
Hobby
AnsTer
1
The ER model that is supported with the additional semanticconcepts
is called the extended entity relationship model or EER model.
2. The EER model includes all the concepts of the original ER model
together with the following additional concepts:
:
a. Specialization Refer Q. 1.24, Page 1-26A, Unit-1.
b. Generalization : Refer Q. 1.24, Page 1-26A, Unit-1.
c.Aggregation : Refer ge l-26A.
3. The super class/subclass entity types (or super type /subtype entities).
is one of the most important modelling constructs that is included in
the EER model.
4. This feature enables us to model ageneral entity andthen subdivide it
into several specialized entity types (subclasses or subtypes):
5. EER diagramsare used to capture business rules such as constraints
iv in the super type/subtype relations. Thus, a super class is an entity
type that includes distinct subclasses that require to be represented in
a data model.
6. A subclass is an entity type that has a distinct role and is also a member
of a super class.
Page 30 of 32
1-31A (CSITSem-5)
Database Management System
Et 2
( Shared attributes
Superclass
Subclass Subclass
1. Activity diagram :