You are on page 1of 19

Page 1 of 2

www.vujannat.ning.com

CS403 Database Management System


Final Term Examination - February 2005
Time Allowed: 150 Minutes

Please read the following instructions carefully before attempting any of the
questions:
1. Attempt all questions. Marks are written adjacent to each question.
2. Do not ask any questions about the contents of this examination from anyone.
a. If you think that there is something wrong with any of the questions, attempt
it to the best of your understanding.
b. If you believe that some essential piece of information is missing, make an
appropriate assumption and use it to solve the problem.
You are allowed to use MS VISIO to make diagrams. If you do so please remember to copy
and paste your code into the examination solution area.

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found
involved in cheating will get an `F` grade in this course.

Total Marks: 55 Total Questions: 5

Question No. 1 Marks : 10

Consider the tables below:

EMP(empNo, eName, job, mgr, hireDate, sal, comm, deptNo)


(mgr stores the empNo of employee who is manager of the department in which an
employee works, comm Stores the commission of the employee)
DEPT(deptNo, dName, loc)

Write the SQL statements for the following queries:


a) Display the names of all employees whose commission is greater than their salary
increased by 10%
b) Display all employees' names and their hire dates and their managers' names and hire
dates for all employees who were hired before their managers.
c) Determine the number of managers without listing them.
d) List all employees grouped department wise.
e) Set the salaries of all employees to 20000 whose name contain the "DILDAR"

Question No. 2 Marks : 10

Do as appropriate:
a) A relation that has no partial functional dependencies is in ___________ normal form.
b) A transaction must acquire a ________ before doing any operation.
c) A ________ is a simple identifier that serves to identify each transaction.
d) The primary goal of physical database design is data processing security.(T/F)
e) The last step in the design process is the ______________, which maps the local
conceptual schemas to physical storage devices available at the corresponding sites.
f) Join and subquery techniques may often be used to accomplish the same task.(T/F)
g) The special value of the attribute is generally referred to as the ___________
h) A join is a relational operation that causes two common attributes to be combined into a
single composite attribute.(T/F)
i) The hierarchical data model is the most commonly used model in contemporary database
applications.(T/F)
j) A ___________ key is an attribute in one table that acts as a primary key in another table.

Question No. 3 Marks : 6

Consider the tables below: (2,3,1)


a) Mention the major difference between B tree and B+ tree. How can selection of either of
them as an index implementation approach can affect the number of accesses required
performing a particular relational operator (say SELECT)?
b) Consider the following relations:
Student(stud_id, stud_name, camp_add, GPA)
Registration (stud_id, course_id, grade)

Following is a typical query against these relations:


SELECT STUDENT.STUD_ID, STUD_NAME,STUD_NAME,COURSE_ID,
GRADE
FROM STUDENT, REGISTRATION
WHERE STUDENT.STUD_ID=REGISTRATION.STUD_ID
AND GPA>3.0
Page 2 of 2

a. On what attributes should indexes be defined to speed up the above query? Give
the reasons for each attribute selected.
b. Write SQL command to create indexes for each attribute you identified in (a).

c) When a student has not chosen a major at a university, the university often enters a value
of "Undecided" a default value or a way to represent the null value?

Question No. 4 Marks : 15

Differentiate the following: - 3 each


a) Naïve and Sophisticated End Users.
b) Process numbers in Diagram 0, Context diagram and detailed DFD (in all three of them).
c) Clustered Verses Unclustered Indexes.
d) Tuple Relational Calculus & Domain Relational Calculus.
e) Total and partial participation of an entity.

Question No. 5 Marks : 14

Give short and precise answers of the following: (2, 2, 2, 2, 2,4)


a) The order of non-conflicting operations does not matter in an interleaved schedule, why?
b) 2PL ensures serializability but generates deadlock, how?
c) What are the 3rd and 4th forms of normalization, explain with examples?
d) How do we represent a multi-valued attribute in E-R diagram?
e) Explain how can we say that granularity of locks effects concurrency?
f) Let a file have following set of key values:
{2,5,8,10,15,18,23,25,28,31,33}
Construct a B-Tree index assuming 4 key values per node. Also show the changes in the
tree after the following operations:
1. insert 24
2. delete 2
3. insert 35
4. delete 18
www.vujannat.ning.com

CS403 Data Base Management System


Final Term Examination – Spring 2005
Time Allowed: 150 Minutes

Please read the following instructions carefully before


attempting any of the questions:
1. Attempt all questions. Marks are written adjacent to each
question.
2. Do not ask any questions about the contents of this
examination from anyone.
a. If you think that there is something wrong with any of
the questions, attempt it to the best of your understanding.
b. If you believe that some essential piece of information is
missing, make an appropriate assumption and use it to
solve the problem.
You are allowed to use MS VISIO to make diagrams. If you do so
please remember to copy and paste your code into the examination
solution area.

**WARNING: Please note that Virtual University takes serious


note of unfair means. Anyone found involved in cheating will
get an `F` grade in this course.

Total Marks: 59 Total Questions: 09

Question No. 1 Marks : 01

A relation that has no partial functional dependencies is in ___________ normal


form.

o 1NF
o 2NF
o 3NF
o none of above
Question No. 2 Marks : 15

Differentiate the following: - (15, 3 each)

a) List Partitioning and Range Partitioning.


b) Truncate and delete commands of SQL
c) Primary and secondary indexes.
d) Process numbers in Diagram 0, Context diagram and detailed DFD (in all three of
them).
e) Dynamic view and materialized view

Question No. 3 Marks : 01

User access to the database is supported by ______________schema.


o External schema
o Conceptual schema
o Internal schema
o None of above

Question No. 4 Marks : 15

Give short and precise answers of the following: (5 each)

a) De-normalization
b) Raid and which level of RAID is best?
c) 2PL ensures serializability but generates deadlock, how?

Question No. 5 Marks : 01

To keep duplicate values from being returned use the _________ keyword

o Distinct
o All
o Unique
o None Of Above

Question No. 6 Marks : 15

Consider the tables below: (15, 3 each)

Student (Stud_ID, Sname)


Faculty (Fac_ID, Fname)
Course (Course_ID, Cname)
Is_Qualified (Fac_ID, Course_ID, Date_Qualified)
Section (Sec_ID, Course_ID)
Is_Registered (Stud_ID, Sec_ID)

Write SQL queries to answer the following questions:


a) Which students have an ID number that is less than 500?
b) List the name of faculty members have qualified to teach a course since 1993?
c) List total number of students in each section
d) List all the students whose name starts from a to f
e) Which instructors cannot teach Syst Analysis?

Question No. 7 Marks : 01

De-normalization can increase the chance of errors and inconsistencies and can
force reprogramming if business rules change.

o True
o False

Question No. 8 Marks : 09

What are derived, multi-valued and composite attribute? Explain with


examples?

Question No. 9 Marks : 01

A locking is a simple identifier that serves to identify each transaction.


o True
o False
WWW.vujannat.ning.Com
Connecting VU Students

CS403 Database Management System


Final Term Examination – Spring 2006
Time Allowed: 150 Minutes

Question No. 1 Marks : 2

In two phase locking, when a transaction releases a lock, it may acquire additional lock.
 True
 False

Question No. 2 Marks : 15

a) Why standardization is necessary? Explain its benefits in terms of database


architecture.

b) Why we choose DBMS after conceptual model? Discuss.

c) Check the following relation is in 2nd normal form. If no, then convert it in 2nd
normal form and explain its reason.
ORDER_ITEM (orderId, itemId, itemDescription, qty, pricePerItem, totalPrice)

Question No. 3 Marks : 15

Write SQL queries for the following relations:

LANGUAGE (langNo, langName)


NATION (nationNo, nationName)
MAGAZINE (magNo, magName, startDate, langNo, nationNo)
ISSUE (readerNo, magNo, borrowDate, returnDate, comment)
READER (readerNo, readerName, deptNo, address, birthDate, phone, email)
DEPARTMENT (deptNo, deptName)

a) Delete a reader’s record whose name is Salman and department is Management.


b) List all the magazine names in ascending order whose language is Arabic.
c) List all the reader’s email addresses that have been issued Islam magazine.
d) List all the magazine names which are issued to Zaid.
e) Create a view containing the following attributes from the READER and
DEPARTMENT relations.

READER (readerNo, readerName, phone)


DEPARTMENT (deptName)

Question No. 4 Marks : 2

The general purpose of data partitioning and placement is ------------------.


 Increasing workload
 Decreasing workload
 None of others

Question No. 5 Marks : 10

Differentiate between the followings?

a) Simple and materialized view.


b) WHERE and HAVING clause.

Question No. 6 Marks : 2

Transaction is executed as a whole or none. This property of transaction is called ----------------


-.
 Atomicity
 Durability
 Concurrency

Question No. 7 Marks : 10

a) What is transaction? Differentiate between preemptive and non preemptive


transactions.

b) Why we need sub query? Explain in detail.

Question No. 8 Marks : 2


RAID level 4 stripes data at byte level.
 True
 False

Question No. 9 Marks : 2

IN function helps reduce the need to use multiple AND conditions.


 True
 False
http://vujannat.ning.com
BEST SITE TO HELP STUDENTS
FINALTERM EXAMINATION
SPRING 2007 Marks: 100
CS403 - DATABASE MANAGEMENT SYSTEMS Time: 150min
(Session - 5 )

StudentID/LoginID: ______________________________

Student Name: ______________________________

Center Name/Code: ______________________________

Exam Date: Tuesday, July 10, 2007

Please read the following instructions carefully before attempting any


of the questions:
1. Attempt all questions. Marks are written adjacent to each question.
2. Do not ask any question about the contents of this examination from
any one.
a. If you think that there is something wrong with any of the
questions, attempt it
to the best of your understanding.
b. If you believe that some essential piece of information is
missing, make an
appropriate assumption and use it to solve the problem.
c. Write all steps, missing steps may lead to deduction of marks.
3. Exam is Closed Book. No handouts or extra material is allowed in
exam hall other than rough sheet which will be provided by the
examiner.
4. Use of cell phone during the examination is strictly prohibited,
otherwise strict disciplinary action will be taken as per university rules

For Teacher's use only


Question 1 2 3 4 5 6 7 8 9 10 Total
Marks
Question 11 12 13
Marks

Question No: 1 ( Marks: 15 )


Write SQL queries for the following relations

CUSTOMER (custId, name, address, city, province, postalCode, phone)


ORDER (orderNo, custId, invNo, datePlaced, datePromised, terms, status)
ORDER_LINE (orderLineNo, orderNo, pCode, qty)
INVOICE (invNo, custId, orderNo, date, status)
INVOICE_LINE (invLineNo, invNo, pCode, qtyShip)
PRODUCT (pCode, pName, pDescription)

a) Delete a customer’s record whose name is zafar and city is Karachi.


b) List all the product names in descending order whose quantity shipped is less than 5000.
c) List all the invoice numbers whose product code is 12.
d) List all the order numbers whose quantity is more than 2500.
e) Create a view containing the following attributes from the CUSTOMER and ORDER
relations.

CUSTOMER (custId, name, address)


ORDER (orderNo, datePlaced, status)

Question No: 2 ( Marks: 6 )

Differentiate between the followings.

Horizontal and Vertical partitioning.

Question No: 3 ( Marks: 25 )

Differentiate between the followings?

a) Differentiate committed and rollback transaction


b) What are the major differences in clustered and non clustered indexes?
c) What is the difference between detection and prevention schemas of dead lock
prevention?
d) What is the difference b/w Equi-join and Natural join?

Question No: 4 ( Marks: 20 )

Normalize the given data table up to 3NF.

(Student# , Advisor , Adv-Room , Class1 , Class2 , Class3)

Question No: 5 ( Marks: 18 )

a) What is transaction? Differentiate between pre-emptive and non pre-emptive


transactions.
b) Why we need sub query? Explain in detail.
Question No: 6 ( Marks: 2 ) - Please choose one

Select the activity that is most clearly part of the Database Administrator's
responsibility.

► Performance tuning

► Data modification

► Data deletion

► Data entry

Question No: 7 ( Marks: 2 ) - Please choose one

Which normalisation transformation corresponds to "Eliminating partial key


dependencies"?

► unnormalised to 1NF

► 1NF to 2NF

► 2NF to 3NF

► 3NF to BCNF

Question No: 8 ( Marks: 2 ) - Please choose one

Locking was introduced into databases so that

► Keys can be provided to maintain security

► All simultaneous transactions are prevented

► Passwords can be provided to maintain security

► Consistency can be enforced

Question No: 9 ( Marks: 2 ) - Please choose one

A back-up and recovery regime should protect an organisation against:

► incorrect data

► corrupt media

► insecure data

► data validation
Question No: 10 ( Marks: 2 ) - Please choose one

SQL has ----------- types of commands

► 3

► 5

► 2

► 4

Question No: 11 ( Marks: 2 ) - Please choose one

Transactions are often referred to in terms of ACID. Which one of the following is
not part of the term ACID?

► Atomic

► Isolation

► Durable

► Complete

Question No: 12 ( Marks: 2 ) - Please choose one

In ------- type of partitioning table is split on the basis of rows

► Horizontal

► Vertical

► Parallel

► None of the given

Question No: 13 ( Marks: 2 ) - Please choose one

Which of the following is a good example of what is meant by?


“Serialisability”

► All disk access happens one after another

► The result of the transactions is the same as if the transactions went


one after another

► The situation where the Lost Update problem exists

► All transactions happen one after another


www.vujannat.ning.com

CS403 Data Base Management System


Mid Term Examination – February 2005
Time Allowed: 90 Minutes

Please read the following instructions carefully before attempting any


of the questions:
1. Attempt all questions. Marks are written adjacent to each question.
2. Do not ask any questions about the contents of this examination from
anyone.
a. If you think that there is something wrong with any of the
questions, attempt it to the best of your understanding.
b. If you believe that some essential piece of information is missing,
make an appropriate assumption and use it to solve the problem.

You are allowed to use MS VISIO to make diagrams. If you do so please remember to
copy and paste your code into the examination solution area.

**WARNING: Please note that Virtual University takes serious note of


unfair means. Anyone found involved in cheating will get an `F` grade
in this course.

Total Marks: 50 Total Questions: 9

Question No. 1 Marks : 12

Give precise answers.

a) How do we represent many-to-many relationship with an entity?


b) How do we represent an multi-valued attribute in E-R diagram? How can we transform such
an attribute into our relational design?
c) Give the example from a real table (with actual attributes) having transitive dependency.
Mention the problems that the table may have due to transitive dependency and how would
you remove them
d) What are two necessary conditions to identify a candidate key out of the given FDs for a
relation R.

Question No. 2 Marks : 15

Explain the following with examples

a) Functions of DBA
b) specialization & Generalization
c) Entity and Entity Instance

Question No. 3 Marks : 1

SQL commands can be classified into three types. Which is NOT an SQL command type?
o DDL
o DML
o DGL
o DCL

Question No. 4 Marks : 1

A ____ is the smallest unit of application data recognized by system software.

o Row
o Field
o Record
o Table

Question No. 5 Marks : 1

Which is NOT an advantage of the database approach?

o Limited data sharing


o Minimal data redundancy
o Improved data quality
o Reduced program maintenance

Question No. 6 Marks : 1

Which is NOT a component of a relational database?


o Entity
o Table
o Attribute
o Hierarchy

Question No. 7 Marks : 1

Which is not a disadvantage of traditional file processing systems?

o Program-data dependence
o Reduced data redundancy
o Limited data sharing
o Lengthy development time

Question No. 8 Marks : 5

Fill in the blanks

a) The term _______ refers to bare facts recorded in the database.


b) A major reason for 3-level architecture is to provide _________.
c) A (n) _________consists of entities and resources.
d) A __________ entity type does not need an identifier.
e) ___________ are represented using diamonds linked with participant ETs

Question No. 9 Marks : 13

Given the scenario:


Temporary Employment Corporation (TEC) places temporary workers in companies during
peak periods. TEC's manager gives you the following description of the business:
TEC has a file of candidates who are willing to work. If the candidate has worked before, that
candidate has a specific job history. Each candidate has several qualifications. TEC also has a
list of companies that request temporaries. Each time a company requests a temporary
employee, TEC makes an entry in the openings folder. This folder contains an opening number,
company name, required qualifications, starting date, anticipated ending date, and hourly pay.
Each opening requires only one specific or main qualification. When a candidate matches the
qualification, he/she is given the job, and an entry is made in the placement record folder. This
folder contains an opening number, candidate number, total hours worked, and so on. In
addition, an entry is made in the job history for the candidate.

Draw the E-R diagram for the above, providing the degree and cardinalities.
www.vujannat.ning.com

CS403 Data Base Management System


Mid Term Examination – February 2005
Time Allowed: 90 Minutes

Please read the following instructions carefully before attempting any


of the questions:
1. Attempt all questions. Marks are written adjacent to each question.
2. Do not ask any questions about the contents of this examination from
anyone.
a. If you think that there is something wrong with any of the
questions, attempt it to the best of your understanding.
b. If you believe that some essential piece of information is missing,
make an appropriate assumption and use it to solve the problem.

You are allowed to use MS VISIO to make diagrams. If you do so please remember to
copy and paste your code into the examination solution area.

**WARNING: Please note that Virtual University takes serious note of


unfair means. Anyone found involved in cheating will get an `F` grade
in this course.

Total Marks: 50 Total Questions: 9

Question No. 1 Marks : 12

Give precise answers.

a) How do we represent many-to-many relationship with an entity?


b) How do we represent an multi-valued attribute in E-R diagram? How can we transform such
an attribute into our relational design?
c) Give the example from a real table (with actual attributes) having transitive dependency.
Mention the problems that the table may have due to transitive dependency and how would you
remove them
d) What are two necessary conditions to identify a candidate key out of the given FDs for a
relation R.
Question No. 2 Marks : 15

Explain the following with examples

a) Functions of DBA
b) specialization & Generalization c)
Entity and Entity Instance

Question No. 3 Marks : 1

SQL commands can be classified into three types. Which is NOT an SQL command type?
o DDL
o DML
o DGL
o DCL

Question No. 4 Marks : 1

A is the smallest unit of application data recognized by system software.

o Row
o Field
o Record
o Table

Question No. 5 Marks : 1

Which is NOT an advantage of the database approach?

o Limited data sharing


o Minimal data redundancy
o Improved data quality
o Reduced program maintenance

Question No. 6 Marks : 1

Which is NOT a component of a relational database?


o Entity
o Table
o Attribute
o Hierarchy

Question No. 7 Marks : 1


Which is not a disadvantage of traditional file processing systems?

o Program-data dependence
o Reduced data redundancy
o Limited data sharing
o Lengthy development time

Question No. 8 Marks : 5

Fill in the blanks

a) The term refers to bare facts recorded in the database.


b) A major reason for 3-level architecture is to provide _________.
c) A (n) _________consists of entities and resources.
d) A entity type does not need an identifier.
e) are represented using diamonds linked with participant ETs

Question No. 9 Marks : 13

Given the scenario:


Temporary Employment Corporation (TEC) places temporary workers in companies during
peak periods. TEC's manager gives you the following description of the business:
TEC has a file of candidates who are willing to work. If the candidate has worked before, that
candidate has a specific job history. Each candidate has several qualifications. TEC also has a
list of companies that request temporaries. Each time a company requests a temporary
employee, TEC makes an entry in the openings folder. This folder contains an opening number,
company name, required qualifications, starting date, anticipated ending date, and hourly pay.
Each opening requires only one specific or main qualification. When a candidate matches the
qualification, he/she is given the job, and an entry is made in the placement record folder. This
folder contains an opening number, candidate number, total hours worked, and so on. In
addition, an entry is made in the job history for the candidate.

Draw the E-R diagram for the above, providing the degree and cardinalities.

You might also like