Sunday, September 13, 2015

CS6302 Database Management Systems May June 2015 - Question with answers

CS6302 Database Management Systems question paper - May/June 2015 / Anna University Previous Year 2015 Exam Questions / Anna University Previous Year 2015 Computer Science and Information Technology Question Papers / CS6302  / CS 2255 / CS 46 / CS 1254/080250009/10144 CS 406 — Database Management Systems Question with Answers

Question Paper Code : 77094

B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2015.
Third Semester
Computer Science and Engineering
CS 6302 — DATABASE MANAGEMENT SYSTEMS
(Common to Information Technology)
(Regulation 2013)


Time : Three hours                                                             Maximum : 100 marks

Answer ALL questions.
PART A — (10 × 2 = 20 marks)

1. Write the characteristics that distinguish the database approach with the file-based approach.
2. Define: Functional dependency
3. State the need for query optimization.
4. What is the difference between static and dynamic SQL?
7. How dynamic hashing differ from static hashing?
8. Write about four types (Star, snowflake, galaxy and fact constellation) of data warehouse schemas.
9. Define threats and risks.
10. What is association rule mining?

PART B — (5 × 16 = 80 marks)

11. (a) Draw an ER diagram for the “Restaurant Menu Ordering System”, which will facilitate the food items ordering and services within a restaurant. The entire restaurant scenario is detailed as follows. The customer is able to view the food items menu, call the waiter, place orders and obtain the final bill through the computer kept in their table. The waiters through their wireless tablet PC are able to initialize a table for customers, control the table functions to assist customers, orders, send orders to food preparation staff (chef) and finalize the customer’s bill. The food preparation staffs (chefs), with their touch-display interfaces to the system, are able to view orders sent to the kitchen by waiters. During preparation, they are able to let the waiter know the status of each item, and can send notifications when items are completed. The system should have full accountability and logging facilities, and should support supervisor actions to account for exceptional circumstances, such as a meal being refunded or walked out on. (16)
Or
(b) State the need for normalization of a database and explain the various normal forms (1st,2nd, 3rd, BCNF, 4th, 5th, and domain-key) with suitable examples (16)
12. (a) Consider a student registration database comprising of the below given table schema. (16)
Student_File(student_number, student_name, address, telephone)
Course_File(course_number, description, hours, professor_number)
Professor_File(Professor_number, name, office)
Registration_File(student_number, course_number, date)
Consider a suitable sample of tuples/records for the above mentioned tables and write DML statements (SQL) to answer for each queries listed below.
(i) Which courses does a specific professor teach?
(ii) What courses are taught by two specific professors?
(iii) Who teaches a specific course and where is his/her office?
(iv) For a specific student number, in which courses is the student registered and what is his/her name?
(v) Who are the professors for a specific student?
(vi) Who are the students registered in a specific course?
Or
(b) Discuss about the join order optimization and heuristic optimization algorithms. (16)
13. (a) Explain the Two-phase and Three-phase commit protocols. (16)
Or
(b) Consider the following schedules. The actions are listed in the order they are scheduled, and prefixed with the transaction name.
S1: T1:R(X), T2:R(X), T1:W(Y), T2:W(Y), T1:R(Y), T2:R(Y)
S2: T3:W(X), T1:R(X), T1:W(Y), T2:R(Z), T2:W(Z), T3:R(Z)
For each of the schedules, answer the following questions;
(i) What is the precedence graph for the schedule? (2)
(ii) Is the schedule conflict-serializable? If so, what are all the conflict equivalent serial schedules? (7)
(iii) Is the schedule view-serializable? If so, what are all the view equivalent serial schedules? (7)
14. (a) With suitable diagrams, discuss about the RAID levels (level 0, level 1, level 0+1, level 3, level 4 and level 5). (16)
Or
(b) Explain the architectural components of a data warehouse and write about data marts. (16)
15. (a) Neatly write the K-means algorithm and show the intermediate results in clustering the below given points into two clusters using K-means algorithm. (16)
P1: (0,0), P2: (1,10), P3: (2,20), P4: (1,15), P5: (1000,2000), P6: (1500,1500), P7: (1000,1250).
Or
(b) Discuss about the access control mechanisms and Cryptography methods to secure the databases. (16)

***********

 


Saturday, September 12, 2015

Database Management Systems (DBMS) Question - Pune University May 2013

Database Management Systems (DBMS) Question - Pune University May 2013 / Pune University BE (CSE) and BTech (IT) DBMS Question - May 2013


UNIVERSITY OF PUNE
[4363] – 251
T.E. (Computer & IT Semester – I) Examination, 2013
DATABASE MANAGEMENT SYSTEMS
 (2008 Pattern)
Time: 3 Hours                                           Max. Marks: 100
Instructions : 1) Answers to the two Sections should be written in separate books.
2) Black figures to the right indicate full marks.
3) Assume suitable data, if necessary.
4) Solve Section I: Q 1 or Q 2, Q 3 or Q 4, Q 5 or Q 6.
5) Solve Section II: Q 7 or Q 8, Q 9 or Q 10, Q 11 or Q 12.
SECTION – I
Q1) A) How following problems are handled with DBMS. [6]
i. Data Isolation
ii. Data Redundancy and Inconsistency
iii. Data Integrity
B) Explain with examples how ER diagrams are converted into tables. [6]
C) Explain the need of the following. [6]
i. View       ii) Foreign Key.
OR
Q2) A) Explain various database languages. [8]
B) Explain various data models used in DBMS. [10]

Q3) A) Given relation schema: R(A,B,C), S(D,E,F). Let the relation r® and s(S) be given. Convert the following SQL statements in relational algebra form.               [8]
1. select * from r where B = 17;
2. select A, F from r,s where r.C = s.D;
3. update r set B = B*15 where A = ‘aaa’;
4. select * from s where E<20;
B) Explain various operations in relational algebra. [8]
OR
Q4) A) What is Cursor? Explain various types of Cursor. [8]
B) Explain stored procedures and triggers. [8]

Q5) A) Explain why 4NF is more desirable than BCNF. Rewrite the definition of 4NF and BCNF using the notions of domain constraints and general constraints. [8]
B) Specify Armstrong’s axioms. Use Armstrong’s axioms to prove the soundness of pseudo transitivity rule. [8]
OR
Q6) A) Let R=(A,B,C,D,E) and let M be the following set of multi-valued dependencies. [8]
A →→ BC, B →→ CD, E →→ AD.
List the non-trivial dependencies in M+.
B) Describe the concept of Transitive dependency and explain how this concept is used to define 3NF. [8]
SECTION - II
Q7) A) What is ordered indices? Explain the types of ordered indices with suitable example. [9]
B) Explain detail use of B Tree as an indexing technique. Compare B tree and B+ tree. [9]
OR
Q8) A) Explain following: [9]
i. Dense index    ii. Sparse index          iii. Clustered index
B) Give the transformation rules for releational expressions. [9]

Q9) A) Explain the concept of ‘Transaction’. Describe ACID properties for transaction. [8]
B) Show the two phase locking protocol ensures conflict serializability. [8]
OR
Q10) A) Explain timestamp based protocol. [8]
B) State and explain Thomas Write rule. [8]

Q11) A) How does the concept of an object in the object oriented model differ from the concept of an entity in the ER model. [8]
B) Explain the need of backup and replication. [8]
OR
Q12) A) What is fragment of a relation? What are main types of fragments? [8]
B) Write short note on:
i. Data warehouse manager
ii. Pointers swizzling techniques.

————————


 

Friday, September 11, 2015

File organization in DBMS - Hash file organization

Hash File Organization / Advantages and Diadvantages


Hash File Organization


It is a file organization technique where a hash function is used to compute the address of a record. It uses the value of an attribute or set of attributes as input and gives the location (page/block/bucket) where the record can be stored.

For example, let us consider the following table Student;

RegNo
SName
Gen
Phone
1
Sundar
M
9898786756
3
Karthik
M
8798987867
4
John
M
7898886756
2
Ram
M
9897786772
5
Martin
M
9765430231
6
Rashmi
F
8976543990

A hash function is a function which maps the large set of values into smaller set of files/locations/values. Let us organize the above table using the phoneattribute value as input for the hash function.
h(phone mod 10)
In the above hash function, phone is the phone attribute’s value of each record. 10 is the number of buckets/pages where we want to store our table. [10 buckets means bucket0, bucket1, …, bucket9].
For our example,
For 1st record, h(9898786756 mod 10)  = 6 ie., the first record has to be stored in 6th bucket.
For 2nd record, h(8798987867 mod 10) = 7 ie., the second record has be stored in 7th bucket.
…
For 4th record, h(7898886756 mod 10) = 6 ie., the fourth record has be stored in 6th bucket [like 1st]
For 5th record, h(9765430231 mod 10) = 1 ie., the 5threcord has to be stored in 1st bucket.
For last record, h(8976543990 mod 10) = 0 ie., the last record has to be stored in 0th bucket.

Important points for consideration:



  • If bucket(s) is/are full, then overflow buckets can be used to store more records.
  • Hash function has to be chosen with extra care to avoid uneven distribution. That is, a bad hash function may assign more records to few buckets and less to others.
  • The attribute(s) that is frequently used for data manipulation can be chosen as the input for the hash function.
  • Same hash function that was used to store the records has to be used for deletion, modification or selection of records.
  • Two types of hashing : static and dynamic

How would we locate a bucket for inserting/deleting/updating/reading a record?


Let us assume that the following query is executed.

SEELCT * FROM Student WHERE phone = 8976543990;

For searching the record, we has to use the same hash function that we used for storing the records. Hence, h(8976543990 mod 10) = 0. And the result points to the 0th bucket. It actually gives us the quick access to the required record.

Advantages



  • Quick access to records in terms of selection. [If queried on the attribute that was used for hashing]
  • Easy to insert, delete, or update a record.

Disadvantages



  • Records are randomly stored in scattered locations. May waste a lot of space in case of small files.
  • For queries that involve ranges, hash file organization is not efficient. [eg. SELECT * FROM Emp WHERE Salary BETWEEN 10000 AND 25000]
  • If querying attribute is not the hashed attribute, you may need to scan the entire table for retrieval.
  • Frequent update to the hashed column results in movement of data between buckets which actually affects the system performance.