0% found this document useful (0 votes)
124 views20 pages

Pod 22321

1) The document provides instructions to examiners for evaluating answers on a Principles of Database exam. It includes guidance on partial credit and variations between model answers and student answers. 2) The exam contains two questions - the first with multiple short parts worth a total of 10 marks, and the second with three longer parts worth a total of 12 marks. 3) The model answers provided follow the instructions, giving partial marks for correct concepts when details vary from the model answer. Diagrams and definitions are marked separately.

Uploaded by

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

Pod 22321

1) The document provides instructions to examiners for evaluating answers on a Principles of Database exam. It includes guidance on partial credit and variations between model answers and student answers. 2) The exam contains two questions - the first with multiple short parts worth a total of 10 marks, and the second with three longer parts worth a total of 12 marks. 3) The model answers provided follow the instructions, giving partial marks for correct concepts when details vary from the model answer. Diagrams and definitions are marked separately.

Uploaded by

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Important Instructions to examiners:


1) The answers should be examined by key words and not as word-to-word as given in the model
answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to
assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance
(Not applicable for subject English and Communication Skills).
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may give
credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant

answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
ding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.

Q. Sub Answer Marking


No Q.N. Scheme
.
1. Attempt any FIVE of the following: 10
(a) List any four DBMS softwares. 2M
(Note: Any four valid DBMS software can be considered)
Ans. List of DBMS software are the followings:
i. Oracle RDBMS Any
ii. IBM DB2 four
1/2
iii, Microsoft SQL Server M
iv. MySQL each
v. MS Access
vi. SQLite
vii. PostgreSQL
viii. MongoDB
ix. SQL Developer
x. SAP Sybase SE
(b) Define Domain and Attribute. 2M
Ans. A Domain is defined as the set of all unique values permitted for an Each
attribute. definitio
Attributes are the descriptive properties owned by each entity of an n 1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

entity set. each


(c) List and draw any four symbols used in ER-Model. 2M
Ans. Different symbols used in ER-Model are the following:

Any
four
symbol
1/2
M
each

(d) Define Constraint. 2M


Ans. Constraints are the rules enforced on the data columns of a table.
These are used to limit the type of data that can go into a table. This
ensures the accuracy and reliability of the data in the database. Definitio
Constraints could be either on a column level or a table level. The n 2M
column level constraints are applied only to one column, whereas the
table level constraints are applied to the whole table.
(e) Define Database. List any two advantages of database system. 2M
Ans. A database is an organized collection of data so that it can be easily Definitio
accessed, managed and updated. n 1M

Advantages of database system are the following:


1. Controlling Redundancy of data in a centralized system of Any two
DBMS advanta
2. Integrity of data can be enforced in case of database system by ges 1/2M
enforcing constraints each
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

3. Inconsistency of data can be avoided by reducing duplicacy or


redundancy
4. Data can be shared by multiple applications in centralized DBMS
5. Standards can be enforced in DBMS is a central system by
enforcing standards easily at Company level, Department level,
National level or International level.
6. Restricting unauthorized access among multiple users when
sharing of data takes place in a database.
7. Providing Backup and Recovery facilities is provide by DBMS
for recovering from hardware or software failures.
(f) Define database model. 2M
Ans. Definition of database model:
A database model is a type of data model that determines the logical Definitio
structure of a database. It also fundamentally determines in which n 2M
manner data can be stored, organized and manipulated.
(g) List advantages of Normalization. 2M
Ans. List of Advantages of Normalization are the following:
1. More efficient data structure.
2. Avoid redundant fields or columns.
3. More flexible data structure i.e. we should be able to add new rows Any two
and data values easily advanta
4. Better understanding of data. ges 1M
5. Ensures that distinct tables exist when necessary. each
6. Easier to maintain data structure i.e. it is easy to perform operations
and complex queries can be easily handled.
7. Minimizes data duplication.
8. Close modeling of real world entities, processes and their
relationships.
2. Attempt any THREE of the following: 12
(a) Define data abstraction. Explain the levels of data abstraction 4M
with neat diagram.
Ans. Data abstraction is defined as
Suppression of details of data organization and storage
Highlighting of the essential features for an improved Definitio
understanding of data n 1M
The characteristic that allow program data independence and
program operation independence is called data abstraction.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Three levels of abstraction are:

Physical level: This is the lowest level of data abstraction. It


describes how data is actually stored in database. The complex data Levels
structure details is described at this level. 2M

Logical level: This is the middle level of 3-level data abstraction


architecture. It describes what data is stored in database and the
relationships among the data.

View level: This is highest level of data abstraction. This level


describes the user interaction with database system.

Diagram
1M

(b) Distinguish between network database model and relational 4M


database model.
Ans. Sr. Network database model Relational database model
No.
1 Relationship between Relationship between
records is expressed in the records is represented by a
form of pointers or links relation that contains a key
for each record involved in Any
the relationship. four
2 Many to many relationship Many to many relationship points
can also be implemented can be easily implemented 1M each
3 Record relationship Relationship implementation
implementation is very is very easy through the use
complex due to use of of a key or composite key
pointers fields
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

4 Network model is useful Relationship model relations


for representing suchare is useful for representing
records which have many most of the real world
to many relationships objects and relationship
among them
5 In Network model also the Relational model does not
record relations are maintain physical connection
physical among of records. Data is
organized logically in the
form of rows and columns.
6 Example: Example:
Relation :Student

Rollno name percentage

101 Abc 89.8

(c) Describe enhanced ER model with the help of example. 4M


Ans. Enhanced ER is a high-level data model that incorporates the
extensions to the original ER model. It is created to design more
accurate database schemas.
EER reflects data properties and constraints more precisely.
It also includes more complex requirements than traditional Descript
application. ion 3M

It is a diagrammatic technique for displaying the following


concepts
Sub Class and Super Class
Specialization and Generalization
Union or Category
Aggregation
These concepts are used when they comes in EER schema and the
resulting schema diagrams called as EER Diagrams.

For example: Square, Circle, Triangle are the sub class of Shape
super class.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Diagram
1M

(d) Compare file system and database system. 4M


Ans. File system Database system
1. File processing don't contain 1. Presence of Self-describing
any self describing feature and nature of a database system and
neither posses metadata. Metadata.

2. In file processing, if any 2. In database system, the


changes to the structure of a file structure of data files is stored in Any
may require changing all the DBMS catalog separately four
programs that access the file from the access program. This is points
called program-data 1M each
independence

3. File processing system don't 3.Support of multiple views of


support multiple views. the data i.e. Each user may see a
different view of the database,
which describes only the data of
interest to that user

4. It is not possible to share data 4. Sharing of data and multi-


and multi user transaction user transaction processing i.e
simultaneously among allowing a set of concurrent
concurrent users in case of file users to retrieve from and to
processing system update the database.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

5. The traditional file approach, 5. Controlling Redundancy is


each group independently keeps one of most important feature to
their own file. use DBMS

3. Attempt any THREE of the following: 12


(a) 4M
Ans. Codd rules:
Rule 1 : The information rule
a has to be presented Any
to the user should be in the form of table. four
rules
Rule 2 : Guaranteed Access Rule 1M each
Whole data should be available or accessible to the user without any
ambiguity. The ambiguity can be avoided only through the perfect
combination of the table name, primary key, and column name.

Rule 3: Systematic treatment of null values


The null values i.e. absence of the values in the table should be
treated properly. The table should allow a field to remain empty. This
is not applicable to primary keys. Key columns cannot have null
values.

Rule 4 : Active on-line catalog based on the relational model


Fourth rule specifies need of dynamic on-line catalog based on the
relational model. There are certain system tables that stores the
database definition should be present. The data accessing tools should
be used to access the database structure information.

Rule 5 : The comprehensive data sub language rule: The system


must support at least one relational language that Has a linear syntax
Can be used both interactively and within application programs,
Supports data definition operations (including view definitions), data
manipulation operations (update as well as retrieval), security and
integrity constraints, and transaction management operations (begin,
commit, and rollback).

Rule 6 : The view updating rule: All views those can be updated
theoretically, must be updated by the system.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Rule 7 : High-level insert, update, and delete: A database must


support high-level insertion, updation, and deletion. This must not be
limited to a single row, that is, it must also support union, intersection
and minus operations to yield sets of data records

Rule 8 : Physical data independence: Changes to the physical level


(how the data is stored, whether in arrays or linked lists etc.) must not
require a change to an application based on the structure.

Rule 9 : Logical data independence: Changes to the logical level


(tables, columns, rows, and so on) must not require a change to an
application based on the structure.
Rule 10 : Integrity independence: Integrity constraints must be
specified separately from application programs and stored in the
catalog. It must be possible to change such constraints as and when
appropriate without unnecessarily affecting existing applications.

Rule 11 : Distribution independence: The distribution of portions of


the database to various locations should be invisible to users of the
database. Existing applications should continue to operate
successfully: when a distributed version of the DBMS is first
introduced; and when existing distributed data are redistributed
around the system.

Rule 12: The non subversion rule: If the system provides a low-
level (record-at-a-time) interface, then that interface cannot be used to
subvert the system, for example, bypassing a relational security or
integrity constraint.
(b) Describe functional dependency with example. 4M
(Note: Any other example shall be considered)
Ans. A functional dependency occurs when one attribute in a relation
uniquely determine another attribute.
(OR)
A relation say R attribute X is functionally dependent on attribute Y
if every value in X in the relation has exactly one value of Y in the Descript
given relation. ion 2M
The functional dependency is represented as X Y, which specifies Y
is functionally dependent on X or X attribute functionally determine
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

the attribute Y.

Example:
Consider table : Employee( Emp_Id, Emp_Name, Emp_Address)

Here Emp_Id attribute can uniquely identify the Emp_Name attribute Example
of employee table because if we know the Emp_Id, we can tell that 2M
employee name associated with it.

Functional dependency can be written as:


(c) Explain different types of attributes. 4M
Ans. Types of Attributes:
1) Simple attributes : Attributes that cannot be subdivided (i.e are
atomic) into subparts are called as simple attributes.
E.g: Enroll_no, RollNo

2) Composite Attributes: The attributes which can be divided into Any


subparts are called composite attributes. four
E.g: attribute name could be structured as a composite attribute types
consisting of first_name,middle_name and last_name with
correct
3) Single Valued Attributes: explanat
The attribute has single value for a particular entity called as single ion 1M
valued attribute. each
E.g: Student_id

4) Multivalued Attributes:
The attribute has set of values for a specific entity called as multi
valued attribute.
E.g: Phone_no is multivalued attribute because employee may have
zero, one or several phone no.

5) Derived Attribute:
The value for this type of attribute can be derived from the values of
other related attributes or entities.
E.g: Customer entity has attribute age and date_of_birth. We
calculate age from date_of_birth and current_date.
Here age is derived attribute and date_of_birth is base or stored
attribute
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

6) Stored Attribute:
The stored attributes are such attributes which are already stored in
the database and from which the value of another attribute is derived
is called stored attribute. For example: date_of_birth is a stored
attribute from which age can be derived.
7) Null Attribute:
An attribute takes a null value when an entity does not have a value
for it - that is value does not exist
for the entity.
E.g apartment_no
(d) Explain different operations performed with Data Definition 4M
Language.
Ans. DDL Operations:
1. Create
2. Alter
3. Drop
4. Rename
5. Truncate
1) Create
in the database. It creates an empty structure of the table.
Syntax:
Create table < table name> ( column1 datatype[(size]),
column2 datatype[(size]),
colu Any 4
Example: operatio
Create table employee (empno number(5), ename varchar2(20),Salary ns 1M
number(8,2)); each

2) Alter : It is used to add new attributes or to modify the existing


attribute in the table structure.
Syntax for add option:
alter table<table name>
add( columnName1 datatype(size)
columnName2 datatyp(size)
...
columnNameNdatatyp(size)
);
Example:
alter table emp add(sal number(8,2));
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Syntax for modify option:


alter table<table name> modify (<columnName1><data
type>(<size>));
Example:
alter table emp modify sal number(10,2);

3) Rename :This command is used to rename a table, view, sequence


or a synonym.
Syntax of Rename command:
rename <oldtable_name> to <newtable_name>;
Example:
rename employee to employee_details;

4) Drop: The DROP command removes a table from the database.


All the tables' rows, indexes and privileges will also be removed. No
DML triggers will be fired. The operation cannot be rolled back.
Syntax:
drop table <table name>;
Example: drop table emp;

5) Truncate :Truncate command is used to remove all rows from a


table and to release the storage space used by the table keeping the
table definition intact.
Syntax:
truncate table <table name>;
Example: truncate table emp;
4. Attempt any THREE of the following: 12
(a) Explain BCNF with example. 4M
(Note: Any other example shall be considered)
Ans. BCNF:
Boyce Codd Normal Form (BCNF) is considered a special condition
of third Normal form. A table is in BCNF if every determinant is a Explana
candidate key. A table can be in 3NF but not in BCNF. This occurs tion 2M
when a non key attribute is a determinant of a key attribute

Example of BCNF:
Let's assume there is a company where employees work in more than
one department.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

EMPLOYEE(EMP_ID,EMP_COUNTRY,EMP_DEPT,
DEPT_TYPE,EMP_DEPT_NO)
Example
In the above table Functional dependencies are as follows: 2M
1. EMP_ID EMP_COUNTRY
2. EMP_DEPT {DEPT_TYPE, EMP_DEPT_NO}
Candidate key: {EMP-ID, EMP-DEPT}
The table is not in BCNF because neither EMP_DEPT nor
EMP_ID alone are keys.
To convert the given table into BCNF, we decompose it into three
tables:
1.EMP_COUNTRY table: EMP_ID EMP_COUNTRY
2.EMP_DEPT table: EMP_DEPT {DEPT_TYPE,
EMP_DEPT_NO}
3. EMP_DEPT_MAPPING table:EMP_ID,EMP_DEPT

Functional dependencies:
1. EMP_ID EMP_COUNTRY
2. EMP_DEPT {DEPT_TYPE, EMP_DEPT_NO}

Candidate keys:
For the first table: EMP_ID
For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}
Now, this is in BCNF because left side part of both the functional
dependencies is a key.
(b) Explain client/server database system. 4M
Ans.

Correct
explanat
ion 4M

Client/Server Database System


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

1. It has two logical parts client and server.


2. Computer networking allows some task to be executed on a server
system and some tasks on client system. This leads to
development of client server architecture.
3. Server is the machine which serves to the clients.
4. Server machine provide services to the client machine such as file
access, printing, and database access. It is used to manage the
database tables optimally among multiple clients who
concurrently request the server for the same data.
5. The clients are the machines which requests for the service to the
server.
6. There are different types of client/server architecture such as
Two tier architecture
Three tier architecture.
7. In two tier architecture, client systems directly approach database
servers whereas in three tier architecture, there exists a middle
layer which acts as application server to receive and send requests
from client machine to database server and vice versa.

(c) Explain terms primary key and candidate key with example. 4M
Ans. Primary Key:
A primary key is an attribute in Relation that uniquely identifies the
rows in relation. A Primary key does not hold NULL values and
duplicate values. Each
OR definitio
A key which is selected by the designer to uniquely identify the entity n
is called as Primary key. A primary key cannot contain duplicate 1M
values and it can never contain null values inside it.

Example:
In a Student table(Rollno,Name,Percentage), Rollno is the primary
key Each
example
Candidate key: 1M
In a relation there may be a key or combination of keys which
uniquely identify the record. Such a key is called as Candidate key.
Example:
Consider a Student table (Rollno,Name,Percentage), if (Rollno)
and(Name)both are unique then both are identified as candidate keys.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

OR
Consider a Student table (Rollno, Name, Percentage), if (Rollno,
Name) is unique , then (Rollno, Name) can be a candidate key if and
only if Name and Rollno individually are not unique.
(d) Explain entity integrity constraint with example. 4M
Ans. Entity integrity constraint:
1) Unique key constraint: It avoids the duplication of values within
the rows in table. It allows null values. Each
Syntax: constrai
Create table <table_name> nt
(column name1 datatype(size), explanat
column_name2 datatype(size) constraint <constraint_name> ion 1M
unique,
---
column_name n datatype(size)
);
Example: Each
create table dept example
(deptno number(5) constraint dept_deptno_uk unique, 1M
dname varchar2(20),
loc varchar2(20));

2) Primary key constraint: Primary key constraint can be assigned


on one or more columns in a table used to uniquely identifies the each
row in table. It avoids duplication of rows and do not allow null
values.
Syntax:
Create table <table_name>
(column name1 datatype(size),
column_name2 datatype(size) constraint <constraint_name>
primary key,
---
column_name n datatype(size)
);
Example:
create table dept
(deptno number(5) constraint dept_deptno_pk primary key,
dname varchar2(20),
loc varchar2(20));
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

(e) Describe centralized database system with example. 4M


(Note: Any other example shall be considered).
Ans. Centralized Database System:
1. A centralized database consists of a single data server into which
all data are stored and from which all data are retrieved. All the
data reside at a single location and all applications must retrieve
all data from that location.
2. The centralized database system consists of a single processor Descript
together with its associated data storage devices and other ion 2M
peripherals. It is physically confined to a single location.
3. Data can be accessed from the multiple sites with the use of a
computer network while the database is maintained at the central
site
Following are the advantages of centralised database system:
The data integrity is maximized
The data redundancy is minimal.
Centralized database is much more secure.
Data is easily portable because it is stored at the same place.
The centralized database is cheaper than other types of
databases as it requires less power and maintenance.

Example:
Consider a company developing a project. As the project consist of
many different types of information like documents, plans, diagrams,
Example
can be stored in a database on server which can act as a centralized 2M
database from which all the project members will assess the
information acting as clients.
5. Attempt any TWO of the following: 12
(a) Consider a single table consisting following columns. Convert it 6M
into 2NF and 3NF Table:
(supplier_no, supplier_name, supplier_city, order_no,
order_quantity, order_amount, product_code, product_name)
Ans. Given Table Schema - (supplier_no, supplier_name, supplier_city,
order_no, order_quantity, order_amount, product_code,
product_name)

Second Normal Form (2NF):


To convert it into 2NF, We have to decompose the given table into
two tables with fully functional dependencies and establishing a
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

referential integrity constraint relationship among the two tables.


Table 1- Supplier Details
(supplier_no,supplier_name,supplier_city,order_no) 2NF 3M
Table 2 - Order Details
(order_no, order_ quantity, order_amount, product_code,
product_name)
Now the above two tables are in 2NF.

Third Normal Form (3NF):


To convert the above tables in 3NF ,We have to decompose them in
three tables satisfying the transitive dependencies property.
Table 1- Supplier Details 3NF 3M
(supplier_no ,supplier_name,supplier_city)
Table 2- Product Details
(product_code,product_name)
Table 3- Transaction(Order) Details
(order_no, product_code,supplier_no, order_ quantity, order_amount)
Hence the above three tables are satisfying Transitive dependencies
Thus they are in 3NF.
(b) Draw ER diagram of library management system in which 6M
library maintain the data of books, borrowers, issue return
details, fine collection, supplier of books etc. Assume suitable data
and display the relationship among entities.
Ans.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Use of
correct
entities
2M

Correct
symbols
2M

Correct
relations
hips 2M

(c) Consider the relation R with five attributes L, M, N, O, P 6M


You are given following dependencies:
L M, MN P, PO L
(i) List all keys for R.
(ii) Is R in 3NF?
Justify your answer.
Ans.
(i) List all keys for R:
Since Right hand side does not have NO, it can be part of the key.
So, (NO)+ ={NO} Listing
We will try other combinations with NO any 3
(LNO)+ ={LNOMP} it is candidate key. keys 3M
(MNO)+={MNOPL} it is candidate key.
(PNO)+={PNOLM} it is candidate key .
we get Keys as LNO,MNO,PNO. Correct
3NF
(ii) IsRin3NF?: justificat
M, P, L are prime attributes, so R(L,M,N,O,P) is in 3NF. ion 3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

6. Attempt any TWO of the following: 12


(a) Consider the following schemas: 6M
(i) Dept (Dept_no, Dept_name, Dept-loc)
(ii) Staff (Staff_id, Staff_name, Dept_no, Joint_date)
Draw and explain parent-child relationship for above schemas
and find out foreign key with justification.
Ans.
Parent Child Relationship Diagram for given Schema is as follows:

Diagram
3M

Fig: Parent Child Relationship diagram Identific


ation of
Foreign key: Dept_no is Foreign key for table Staff Foreign
key 1M
Justification:
As per above schemas, Dept table is parent table and Staff table is
child table.
Dept_no is primary key for Dept table. ,
There exist Dept_no as a common attribute in both the tables Dept Justifica
and Staff. tion 2M
Staff_id is primary key for Staff table.
So, Dept_no is foreign key for table Staff.
(b) Draw enhanced ER diagram for loan payment system. Consider 6M
the following entities:
(i) Loan (Loan_id, Loan_amount, Loan_date)
(ii) Payment (payment_id, Payment_date, Balance_amount)
(iii) Personal Loan (Personal Loan_no, Interest rate)
(iv) Home Loan (Home Loan_no, Interest rate)
Show strong entity set, weak entity set, super class and sub class.
Ans.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

Use of
correct
symbols
2M

Represe
ntation
of
Strong
Entity
1M

Weak
Entity
1M

Super
Class
1M

Subclass
1M
(c) rite a 6M
procedure to manipulate given database by adding, modifying
and deleting records.
Ans. Let us consider a Schema for Employee table
(emp_id,emp_name,emp_addr,emp_salary)
For adding records in table:
We use Insert into command for adding /inserting data into Employee
table. Adding
Example: procedu
re 2M
OR
Example:
SQL> Insert into Employee
values(&emp_id,'&emp_name','&emp_addr,'&emp_salary);
Modify
For modifying records in table: procedu
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

SUMMER 2019 EXAMINATION


MODEL ANSWER
Subject: Principles of Database Subject Code: 22321

We use update command for modifying data of Employee table. re 2M


Example:
SQL> update Employee set salary=30000 where emp_id=3;

For deleting records from table: Delete


We use delete command for deleting data of Employee table. procedu
Example: re 2M
SQL>delete from Employee where emp_id=4;

You might also like