Pod 22321
Pod 22321
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
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.
Any
four
symbol
1/2
M
each
Diagram
1M
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)
Diagram
1M
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)
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)
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.
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)
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
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)
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
(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)
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));
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)
Use of
correct
entities
2M
Correct
symbols
2M
Correct
relations
hips 2M
Diagram
3M
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)