cs403 collection of old papers

19
AND GPA>3.0 WHERE STUDENT.STUD_ID=REGISTRATION.STUD_ID FROM STUDENT, REGISTRATION SELECT STUDENT.STUD_ID, STUD_NAME,STUD_NAME,COURSE_ID, GRADE Following is a typical query against these relations: Registration (stud_id, course_id, grade) Student(stud_id, stud_name, camp_add, GPA) b) Consider the following relations: 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)? Consider the tables below: (2,3,1) Question No. 3 Marks : 6 j) A ___________ key is an attribute in one table that acts as a primary key in another table. i) The hierarchical data model is the most commonly used model in contemporary database applications.(T/F) h) A join is a relational operation that causes two common attributes to be combined into a single composite attribute.(T/F) g) The special value of the attribute is generally referred to as the ___________ f) Join and subquery techniques may often be used to accomplish the same task.(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. d) The primary goal of physical database design is data processing security.(T/F) c) A ________ is a simple identifier that serves to identify each transaction. b) A transaction must acquire a ________ before doing any operation. a) A relation that has no partial functional dependencies is in ___________ normal form. Do as appropriate: Question No. 2 Marks : 10 e) Set the salaries of all employees to 20000 whose name contain the "DILDAR" d) List all employees grouped department wise. c) Determine the number of managers without listing them. 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. a) Display the names of all employees whose commission is greater than their salary increased by 10% Write the SQL statements for the following queries: DEPT(deptNo, dName, loc) (mgr stores the empNo of employee who is manager of the department in which an employee works, comm Stores the commission of the employee) EMP(empNo, eName, job, mgr, hireDate, sal, comm, deptNo) Consider the tables below: Question No. 1 Marks : 10 Total Marks: 55 Total Questions: 5 **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. 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. b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem. a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding. 2. Do not ask any questions about the contents of this examination from anyone. 1. Attempt all questions. Marks are written adjacent to each question. Please read the following instructions carefully before attempting any of the questions: Time Allowed: 150 Minutes Final Term Examination - February 2005 CS403 Database Management System www.vujannat.ning.com Page 1 of 2

Upload: httpmajidvacom

Post on 04-Apr-2015

445 views

Category:

Documents


0 download

DESCRIPTION

CS403 COLLECTION OF OLD PAPERS

TRANSCRIPT

Page 1: Cs403 Collection of Old Papers

AND GPA>3.0 WHERE STUDENT.STUD_ID=REGISTRATION.STUD_ID FROM STUDENT, REGISTRATION

SELECT STUDENT.STUD_ID, STUD_NAME,STUD_NAME,COURSE_ID, GRADE

Following is a typical query against these relations: Registration (stud_id, course_id, grade) Student(stud_id, stud_name, camp_add, GPA)

b) Consider the following relations:

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)?

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

Question No. 3 Marks : 6

j) A ___________ key is an attribute in one table that acts as a primary key in another table.

i) The hierarchical data model is the most commonly used model in contemporary database applications.(T/F)

h) A join is a relational operation that causes two common attributes to be combined into a single composite attribute.(T/F)

g) The special value of the attribute is generally referred to as the ___________ f) Join and subquery techniques may often be used to accomplish the same task.(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.

d) The primary goal of physical database design is data processing security.(T/F) c) A ________ is a simple identifier that serves to identify each transaction. b) A transaction must acquire a ________ before doing any operation. a) A relation that has no partial functional dependencies is in ___________ normal form.

Do as appropriate:

Question No. 2 Marks : 10

e) Set the salaries of all employees to 20000 whose name contain the "DILDAR" d) List all employees grouped department wise. c) Determine the number of managers without listing them.

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.

a) Display the names of all employees whose commission is greater than their salary increased by 10%

Write the SQL statements for the following queries: DEPT(deptNo, dName, loc)

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

EMP(empNo, eName, job, mgr, hireDate, sal, comm, deptNo) Consider the tables below:

Question No. 1 Marks : 10

Total Marks: 55 Total Questions: 5

**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.

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.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

2. Do not ask any questions about the contents of this examination from anyone. 1. Attempt all questions. Marks are written adjacent to each question.

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 150 Minutes

Final Term Examination - February 2005 CS403 Database Management System

www.vujannat.ning.com

Page 1 of 2

Page 2: Cs403 Collection of Old Papers

4. delete 18 3. insert 35 2. delete 2 1. insert 24

Construct a B-Tree index assuming 4 key values per node. Also show the changes in the tree after the following operations:

{2,5,8,10,15,18,23,25,28,31,33} f) Let a file have following set of key values: e) Explain how can we say that granularity of locks effects concurrency? d) How do we represent a multi-valued attribute in E-R diagram? c) What are the 3rd and 4th forms of normalization, explain with examples? b) 2PL ensures serializability but generates deadlock, how? a) The order of non-conflicting operations does not matter in an interleaved schedule, why?

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

Question No. 5 Marks : 14 e) Total and partial participation of an entity.

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

Differentiate the following: - 3 each

Question No. 4 Marks : 15

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?

b. Write SQL command to create indexes for each attribute you identified in (a).

a. On what attributes should indexes be defined to speed up the above query? Give the reasons for each attribute selected.

Page 2 of 2

Page 3: Cs403 Collection of Old Papers

o none of above o 3NF o 2NF o 1NF

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

Question No. 1 Marks : 01

Total Marks: 59 Total Questions: 09

**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.

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.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

2. Do not ask any questions about the contents of this examination from anyone.

1. Attempt all questions. Marks are written adjacent to each question.

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 150 Minutes

Final Term Examination – Spring 2005

CS403 Data Base Management System

www.vujannat.ning.com

Page 4: Cs403 Collection of Old Papers

, Sname) Stud_IDStudent ( Consider the tables below: (15, 3 each)

Question No. 6 Marks : 15

Unique oo None Of Above

o All o Distinct

To keep duplicate values from being returned use the _________ keyword

Question No. 5 Marks : 01

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

Give short and precise answers of the following: (5 each) Question No. 4 Marks : 15

o None of above

Conceptual schema oo Internal schema

o External schema User access to the database is supported by ______________schema. Question No. 3 Marks : 01

e) Dynamic view and materialized view

d) Process numbers in Diagram 0, Context diagram and detailed DFD (in all three of them).

c) Primary and secondary indexes. b) Truncate and delete commands of SQL a) List Partitioning and Range Partitioning.

Differentiate the following: - (15, 3 each)

Question No. 2 Marks : 15

Page 5: Cs403 Collection of Old Papers

o False o True

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

Question No. 9 Marks : 01

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

Question No. 8 Marks : 09

True oo False

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

Question No. 7 Marks : 01

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

Write SQL queries to answer the following questions:

) Stud_ID, Sec_IDIs_Registered (, Course_ID) Sec_IDSection (

, Date_Qualified) Fac_ID, Course_IDIs_Qualified (, Cname) Course_IDCourse (

, Fname) Fac_IDFaculty (

Page 6: Cs403 Collection of Old Papers

WWW.vujannat.ning.Com Connecting VU Students

, returnDate, comment) borrowDate, magNo, readerNoISSUE (, magName, startDate, langNo, nationNo) MAGAZINE (magNo

, nationName) NATION (nationNo, langName) LANGUAGE (langNo

rite SQL queries for the following relations: W

Q

uestion No. 3 Marks : 15

, itemDescription, qty, pricePerItem, totalPrice) itemId, orderIdnormal form and explain its reason. ORDER_ITEM (

nd normal form. If no, then convert it in 2nd c) Check the following relation is in 2

b

) Why we choose DBMS after conceptual model? Discuss.

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

architecture.

Q

uestion No. 2 Marks : 15

True False

wo ph In t ase locking, when a transaction releases a lock, it may acquire additional lock.

Q

uestion No. 1 Marks : 2

Time Allowed: 150 Minutes

Final Term Examination – Spring 2006 CS403 Database Management System

Page 7: Cs403 Collection of Old Papers

Question No. 8 Marks : 2 b) Why we need sub query? Explain in detail.

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

Question No. 7 Marks : 10

Concurrency Durability Atomicity

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

Question No. 6 Marks : 2

b) WHERE and HAVING clause. a) Simple and materialized view. Differentiate between the followings? Question No. 5 Marks : 10

None of others Decreasing workload Increasing workload

The general purpose of data partitioning and placement is ------------------. Question No. 4 Marks : 2

DEPARTMENT (deptName) READER (readerNo, readerName, phone)

e) Create a view containing the following attributes from the READER and DEPARTMENT relations.

d) List all the magazine names which are issued to Zaid. c) List all the reader’s email addresses that have been issued Islam magazine. b) List all the magazine names in ascending order whose language is Arabic. a) Delete a reader’s record whose name is Salman and department is Management.

, deptName) deptNoDEPARTMENT (, readerName, deptNo, address, birthDate, phone, email) readerNoREADER (

Page 8: Cs403 Collection of Old Papers

False True

IN function helps reduce the need to use multiple AND conditions. Question No. 9 Marks : 2

False True

RAID level 4 stripes data at byte level.

Page 9: Cs403 Collection of Old Papers

http://vujannat.ning.com BEST SITE TO HELP STUDENTS

FINALTERM EXAMINATION

SPRING 2007

CS403 - DATABASE MANAGEMENT SYSTEMS (Session - 5 )

Marks: 100

Time: 150min

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 )

Page 10: Cs403 Collection of Old Papers

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.

Page 11: Cs403 Collection of Old Papers

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

Page 12: Cs403 Collection of Old Papers

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

Page 13: Cs403 Collection of Old Papers
Page 14: Cs403 Collection of Old Papers

b) How do we represent an multi-valued attribute in E-R diagram? How can we transform such an attribute into our relational design?

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

Give precise answers. Question No. 1 Marks : 12

Total Marks: 50 Total Questions: 9

**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.

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.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

2. Do not ask any questions about the contents of this examination from anyone.

1. Attempt all questions. Marks are written adjacent to each question.

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 90 Minutes

Mid Term Examination – February 2005

CS403 Data Base Management System

www.vujannat.ning.com

Page 15: Cs403 Collection of Old Papers

Which is NOT a component of a relational database? Question No. 6 Marks : 1

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

Which is NOT an advantage of the database approach? Question No. 5 Marks : 1

o Table o Record o Field o Row

A ____ is the smallest unit of application data recognized by system software. Question No. 4 Marks : 1

o DCL o DGL o DML o DDL

SQL commands can be classified into three types. Which is NOT an SQL command type? Question No. 3 Marks : 1

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

Explain the following with examples Question No. 2 Marks : 15

d) What are two necessary conditions to identify a candidate key out of the given FDs for a relation R.

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

Page 16: Cs403 Collection of Old Papers

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

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.

Temporary Employment Corporation (TEC) places temporary workers in companies during peak periods. TEC's manager gives you the following description of the business:

Given the scenario: Question No. 9 Marks : 13

e) ___________ are represented using diamonds linked with participant ETs d) A __________ entity type does not need an identifier. c) A (n) _________consists of entities and resources. b) A major reason for 3-level architecture is to provide _________. a) The term _______ refers to bare facts recorded in the database.

Fill in the blanks Question No. 8 Marks : 5

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

Which is not a disadvantage of traditional file processing systems? Question No. 7 Marks : 1

o Hierarchy o Attribute o Table o Entity

Page 17: Cs403 Collection of Old Papers

www.vujannat.ning.com

d) What are two necessary conditions to identify a candidate key out of the given FDs for a relation R.

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

an attribute into our relational design? b) How do we represent an multi-valued attribute in E-R diagram? How can we transform such a) How do we represent many-to-many relationship with an entity?

Give precise answers.

Question No. 1 Marks : 12

Total Marks: 50 Total Questions: 9

in this course.

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

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.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

2. Do not ask any questions about the contents of this examination from anyone.

1. Attempt all questions. Marks are written adjacent to each question.

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 90 Minutes

Mid Term Examination – February 2005 CS403 Data Base Management System

Page 18: Cs403 Collection of Old Papers

Question No. 7 Marks : 1

o Hierarchy o Attribute o Table o Entity

Which is NOT a component of a relational database?

Question No. 6 Marks : 1

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

Which is NOT an advantage of the database approach?

Question No. 5 Marks : 1

o Table o Record o Field o Row

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

Question No. 4 Marks : 1

o DDL o DML o DGL o DCL

SQL commands can be classified into three types. Which is NOT an SQL command type?

Question No. 3 Marks : 1

b) specialization & Generalization c) Entity and Entity Instance

a) Functions of DBA Explain the following with examples

Question No. 2 Marks : 15

Page 19: Cs403 Collection of Old Papers

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

addition, an entry is made in the job history for the candidate.

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

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.

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

TEC has a file of candidates who are willing to work. If the candidate has worked before, that

Temporary Employment Corporation (TEC) places temporary workers in companies during peak periods. TEC's manager gives you the following description of the business:

Given the scenario:

Question No. 9 Marks : 13

are represented using diamonds linked with participant ETs e) entity type does not need an identifier. d) A

b) A major reason for 3-level architecture is to provide _________. c) A (n) _________consists of entities and resources.

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

Question No. 8 Marks : 5

o Lengthy development time

o Program-data dependence o Reduced data redundancy o Limited data sharing

Which is not a disadvantage of traditional file processing systems?