DBMS TUTS

                  
                 


         

MANAV RACHNA UNIVERSITY, FARIDABAD

                          Department of Computers Science And

 Engineering

 

                                                                                                                                                                                                                                                                      Course: B.Tech                            Semester: III                                                                                  Session: 2020-21                      Subject:  Database Management System (CSH202B-T)

Tutorial: 00  

Learning Outcome CO1:  Student will be able to revise Discrete Mathematics

 

 

1.     Consider two sets A= {a, b, c} and B = {1, 2}. What is the Cross product of these sets?

 

2.     Write the extended cross product of the sets A and B as above and C={X, Y, Z}

 

3.     There are two sets Person = {P1, P2, P3} and Name = {Rama, Radha, Krishna}. Define a 1:1 onto function between these. What is the significance of this function?

 

4.     Define the cross product of the sets in question 3. Which relation corresponds to the function you defined there?

 

5.     Consider Officer = {O1, O2, O3} and Department = {Maths, Physics, Chemistry}. Define its cross product and identify those relations that correspond to a 1:1, 1: N, and M: N relationship between these respectively.

 

6.     What are the three main differences in opening a file in text mode and binary mode?

 

7.     What are the different values that can be given as third argument in fseek()?

 

8.     Discuss the functions required for reading and writing records onto a file.

 

9.     Identify valid domains

a.      {2, 3, 4, 5}

b.     {2.0, 3, 4, 8.0}

c.      {23.1, 24.3, 53.6, 37.5}

 

10.  Consider the following domains pair-wise. Which pairs are unions compatible?

A: {2, 3, 4, 5}      

B: {23.1, 24.3, 53.6, 37.5}






Tutorial: 01   

Learning Outcome CO1:  Student will be able to understand how file is organized using Hashing in memory.

1. What do you mean by hashing? Explain any five popular hash functions.

 

2. The following values are to be stored in a hash table 25, 42, 96, 101, 102, 162, 197. Describe how the values are hashed by using division method of hashing with a table size of 7. Use chaining as the method of collision resolution. 

 

3. Given the values {2341, 4234, 2839, 430, 22, 397, 3920}, a hash table of size 7, and hash function h(x) = x mod 7, show the resulting tables after inserting the values in the given order with each of the collision strategies.

 

4. A file includes records with following hash-keys: - 5659, 1074, 1620, 3943, 9208, 2369, 3760, 4692, 4871, 1821, 7115. The file uses eight buckets – 0 to 7. Each bucket is one disk block and holds two records. Load these records into the file in the given order using hash function h(K) = k mod 8.

 

5. Differentiate between ordered and unordered file organisations.

 

6. A PARTS file with Part # as the hash  key includes records with the following Part# values: 2369, 3760, 4692, 4871, 5659, 1821, 1074, 7115, 1620, 2428, 3943,

4750, 6975, 4981, and 9208. The file uses eight buckets, numbered 0 to 7. Each bucket is one disk block and holds two records. Load these records into the file in the given order, using the hash function h(K) = K mod 8. Calculate the average number of block accesses for a random retrieval on Part#.

 

7. A file has r = 20,000 STUDENT records of fixed length. Block size B = 512 bytes, Each record has the following fields: Name (30 bytes), Ssn (9 bytes), Address (40 bytes), PHONE (10 bytes), Birth_date (8 bytes), Sex (1 byte), Major_dept_code (4 bytes), Minor_dept_code (4 bytes), Class_code (4 bytes, integer), and Degree_program (3 bytes). An additional byte is used as a deletion marker.

a. Calculate the record size R in bytes.

b. Calculate the blocking factor bfr and the number of file blocks b, assuming an unspanned organization.

c. Calculate the average time it takes to find a record by doing a linear search on the file.

d. Assume that the file is ordered by Ssn ; by doing a binary search, calculate the time it takes to search for a record given its Ssn value.

 

8. Suppose that only 80 percent of the STUDENT records from Question 7 have a value for Phone , 85 percent for Major_dept_code , 15 percent for Minor_dept_code , and 90 percent for Degree_program ; and suppose that we use a variable-length record file. Each record has a 1-byte field type for each field in the record, plus the 1-byte deletion marker and a 1-byte end-of-record marker. Suppose that we use a spanned record organization, where each block has a 5-byte pointer to the next block (this space is not used for record storage).

a. Calculate the average record length R in bytes.

b. Calculate the number of blocks needed for the file.


TUT 1 PDF

1. List four examples of database systems other than those listed in slides.

 

2. Define the terms:

a)     Data

b)    Database

c)     Database management system

d)    Meta data

e)     Data independence

f)     Data abstraction

 

3. Describe the functions that should be provided by a database management system.

 

4. What are the important responsibilities of a DBA?

 

5. Explain, giving example, why concurrency control techniques play an important role?

 

6. Describe the three schema architecture. Why do we need mappings between schema levels?

 

7. List significant differences between a file-processing system and a DBMS.

 

8. Name 4 DBMS packages along with the companies whose product they are. 

DBMS TUT-3 SOLVED























Comments

Post a Comment