0% found this document useful (0 votes)
4 views

Sample Dbms Paper

This document is an examination paper for the Database Management Systems course at the National School of Business Management. It consists of multiple-choice questions, practical database design tasks, and SQL queries related to database concepts and normalization. The exam covers topics such as entity-relationship diagrams, functional dependencies, and SQL syntax.
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)
4 views

Sample Dbms Paper

This document is an examination paper for the Database Management Systems course at the National School of Business Management. It consists of multiple-choice questions, practical database design tasks, and SQL queries related to database concepts and normalization. The exam covers topics such as entity-relationship diagrams, functional dependencies, and SQL syntax.
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/ 5

National School of Business Management

1st Year – 1st Semester Examination


Database Management Systems
(CS105.3)
Time: 03Hrs
Answer All Questions.

Section A
1. .......... and ………. used to find the number of values in a column and the average value.
a. TOTAL, AVG
b. COUNT, AVG
c. COUNT, AVG
d. SUM, AVG

2. Which of the syntax is correct for insert statement?


i) insert into <table_name> values <list of values>
ii) insert into <table_name> (column list) values <list of values>
a. i-only
b. ii-only
c. Both of them
d. None of them

3. Relationships with three participating entities are known as ____________ relationships.


a. unary
b. binary
c. ternary
d. tertiary

4. Which of the following is not comparison operator?


a. <>
b. <
c. =<
d. >=

5. To eliminate duplicate rows ……………… is used


a. NODUPLICATE
b. ELIMINATE
c. DISTINCT
d. None of these

6. In 2NF
a. No functional dependencies exist.
b. No multivalued dependencies exist.
c. No partial functional dependencies exist
Page 1 of 5
d. No partial multivalued dependencies exist.

7. ……………… specifies a search condition for a group or an aggregate.


a. GROUP BY Clause
b. HAVING Clause
c. FROM Clause
d. WHERE Clause

8. A ………………. does not have a distinguishing attribute if its own and mostly are dependent
entities, which are part of some another entity.
a. Weak entity
b. Strong entity
c. Non attributes entity
d. Dependent entity

9. In the __________ normal form, a composite attribute is converted to individual attributes.


a. First
b. Second
c. Third
d. Fourth

10. ........... means multiple copies of the same data items.


a. Data reduction
b. Data integrity
c. Data consistency
d. Data redundancy

11. Which of the following is not an aggregate function?


a. Avg
b. Sum
c. With
d. Min

12. For like predicate which of the following is true.


i) % matches zero of more characters.
ii) _ matches exactly one character.
a. i-only
b. ii-only
c. Both of them
d. None of them

13. What operator tests column for the absence of data?


a. EXISTS operator
b. IS NULL operator
c. NOT operator
d. None of these
14. Which one of the following is not true? A Database Management System (DBMS) is
a. Set of data files in disk
b. Software stored in disk
c. Software that controls access to data

Page 2 of 5
d. Software runs in a server

15. _____ integrity ensures that each row can be uniquely identified via one or more attributes
called the primary key
a. Domain integrity
b. Entity integrity
c. Referential integrity
d. None of the above

16. In E-R Diagram derived attributes are represented by


a. Ellipse
b. Dashed ellipse
c. Rectangle
d. Triangle

17. A functional dependency between two or more non-key attributes is called


a. Transitive dependency
b. Partial transitive dependency
c. Functional dependency
d. Partial functional dependency

18. ………………… is a full form of SQL.


a. Standard query language
b. Sequential query language
c. Structured query language
d. Server side query language

19. Aggregate functions are functions that take a ___________ as input and return a single value.
a. Collection of values
b. Single value
c. Aggregate value
d. Both a & b

20. A relation is ................... if every field contains only atomic values and, no lists or sets.
a. 1 NF
b. 2 NF
c. 3 NF
d. None of above
(Total-40 marks)

Page 3 of 5
Section B

Q1
Consider the following requirements given to build a database for ABC Pvt Ltd.
 ABC Pvt Ltd is an item manufacturing company with several plants island wide. These plants
are responsible for leading different projects that the company undertakes. A certain plant
may control a number of projects, but a project is always under the control of one plant. All
plants have a name, number (unique), budget and several buildings at different locations.
 There are number of employees working in a plant and each employee works in only one
plant. For each employee the name (first name and surname separately), employee number
(unique), address, gender and salary are recorded. The date that an employee was employed
is also recorded.
 Some employees are assigned to work on one or more projects simultaneously. Each project
has one or more employees. Each project has a name, number (unique) and a single location.
The time an employee has been assigned to a particular project should be recorded.
 Some employees also supervise other employees, but all employees need not be supervised.
An employee is supervised by just one employee but an employee may supervise several
employees.
 Some employees may have several dependents. A dependent can only be a dependent of one
employee at any time. For each dependent the dependent’s name, relationship, birth date
and gender are recorded.
 The company offers credit union facilities as a service to its employees. An employee is not
required to become a member of ABC Credit Union (ACU). However most of employees have
accounts in ACU. Every ACU account must belong to one employee. ACU accounts are
identified by a unique account number. For each ACU account, account type and the balance
are also recorded.

A. Draw an Entity Relationship diagram and use the relational mapping rules to create a linked
relational schema. State any assumptions you make.
(15 marks)
B. Convert the ER Diagram in part (A) to the Relational Model
(5 marks)
(Total-20 marks)

Q2
A. Define followings using suitable examples
I. Participation constrains
II. Integrity constraints (4 marks)

B. Consider the relation R = {A, B, C, D, E, F, G, H, I, J} and the functional dependencies


 {A, B}  {E, F, H}
 {A} {D, J}
 {B} {C, G}
 {G} {I}
Assume the keys of R to be A and B. Decompose R into 2NF and 3NF (6 Marks)

Page 4 of 5
C. Consider the following health history report.
HEALTH HISTORY REPORT
pet id pet name pet type pet age owner visit date Proc no procedure
246 Rover Dog 12 Sam Jan 13/2014 01 rabies vaccination
Cook Mar 27/2014 10 examine and treat
Apr 02/2015 05 heart worm test
341 Jerry Cat 4 Sam Jan 23/2014 01 rabies vaccination
Cook Jan 13/2015 01 rabies vaccination
519 Tweedy Bird 2 Terry Apr 30/2014 20 annual check up
Kim Apr 30/2015 12 eye wash
The above report can be converted to un-normalized form relational model as follows.

Pet [pet_id, pet_name, pet_type, pet_age, owner, (visitdate, procedure_no, procedure_name ) ]

Convert above un-normalized relation to Third Normal Form. You must provide appropriate
justifications/reasons for each change you make during the normalization process.
(10 Marks)
(Total-20 marks)
Q4
Consider the following tables and answer the questions given below.
Stock Table
ItemCode – Primary Key
ItemCategory – Foreign key from the field ItemCategory of ItemCategory table
ItemDescription – Cannot contain null values
QuantityInHand
CostPrice – Acceptable data values should be between 100 and 10000
SalesPrice

ItemCategory Table
ItemCategory – Primary Key, Only accepts values S,M,C,D
CategoryName

Write SQL statements for the following queries:


I. Create two tables following given column and table constraints. (Assume your own data types
and sizes). (4 marks)
II. Insert a new item to the stock table with following values (I015,M,LED
Monitor,14,10500,12500) (2 marks)
III. Display ItemDescription and ItemCategory of all the items belonging to category D and sort
the output by ItemDescription. (2 marks)
IV. Display the ItemCode and ItemDescription of all the items of which the QuantityInHand is less
than 50. (2 marks)
V. Increase the CostPrice of all the items belonging to category M by 5% and SalesPrice by 6%.
(2 marks)
VI. List the ItemCode, CategoryName, CostPrice and SalesPrice of all the items which contain the
string ‘abc’ at any place in the ItemDescription. (2 marks)
VII. Display the total CostPrice of all the items with the new column name TotalCost. (2 marks)
VIII. Display the average cost of each item category with the new column names, ItemCategory
and AverageCost. (2 marks)
IX. Delete the record with the item code I012 from the Stock table (2 marks)
(Total-20 marks)
*****End of the paper*****
Page 5 of 5

You might also like