QUESTIONS CARRY 2 MARKS EACH
Consider a table Tin a relational database with a key field K. A B- tree of order p is used as an access structure on K, where p denotes the maximum number of tree pointers in a B-tree index node. Assume that K is 10 bytes long;disk block size is 512 bytes; each data pointer PD is 8 bytes long and each block pointer PB is 5 bytes long. In order for each B-tree node to fit in a single disk block, the maximum value of p is
-
Solution
key field size = 10 bytes
data pointer size = 8 bytes
block pointer size = 5 bytes
(p - 1)( key field size + data pointer size) + p * block
pointer size <=512 23p - 18 <= 512 p <= 23 Thus, option (C) is correct
QUESTIONS CARRY 2 MARKS EACH
Consider two tables in a relational database with columns and rows as follows:
Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and Student.Dept_id is a foreign key from Department.Dept_id What will happen if we try to execute the following two SQL statements?
(i)update Student set Dept_id = Null where Roll_on= 1
(ii)update Department set Dept_id = Null where Dept_id = 1
-
Solution
First query will successfully executed and after executing this statement attribute dept-id of student table become NULL which is foreign key from department’s dept-id. So second statement will not execute, condition will not satisfy in the case, by any row.
Hence correct answer is (c)
QUESTIONS CARRY 2 MARKS EACH
Consider the following schedule S of transctions T1 and T2:
T1 T2 Read
(A)A =A –10
Read(A)
Temp = 0.2*A
Write(A)
Read(B)
Write (A)
Read(B)
B = B + 10
Write(B)
B = B + Temp
Write(B)
Which of the following is TRUE about the schedule S?
QUESTIONS CARRY 2 MARKS EACH
Consider a parity check code with three data bits and four parity check bits. Three of the code words are 0101011,1001101 and 1110001. Which of the following are also code words?
I.0010111
II.0110110
III.1011010
IV.0111010
-
Solution
This is nice Question. I'm giving probable answer, which seems best to me though do comment if you feel there is any mistake.
010 1 0 1 1 => Here 1 is Even parity for 01 (starting 2 char of 010)
Here 0 is Even parity for 010 (First & last characters of 010)
Here 1 is Even parity for 010 (Last 2 character of 010)
Finally last 1 is Even parity for total string 010 10 1=> 1.
Same way you can do for 1001101 and 1110001.
If you try for using similar test for
I. 0010111 II. 0110110 III. 1011010 IV. 0111010
Then I & III pass in test.So answer is A .
QUESTIONS CARRY 2 MARKS EACH
A 20 Kbps satellite link has a propagation delay of 400 ms.The transmitter employs the “go back n ARQ” scheme with n set to 10. Assuming that each frame is 100 bytes long, what is the maximum data rate possible?
-
Solution
Consider a 10 Mbps token ring LAN with a ring latency of 400 ms. A host that needs to transmit seizes the token.Then it sends a frame of 1000 bytes, removes the frame after it has circulated all around the ring, and finally releases the token.This process is repeated for every frame. Assuming that only a single host wishes to transmit, the effective data rate is_____ Mbps.
-
Solution
Data rate = 10 Mbps
Ring latency = 400 us
So, Propagation time = 400 us
Transmission time = (1000 * 8)/(10 * 106) = 800us Efficiency :
= Transmission time/ (Transmission time + 2 *(Propagation time))
= 800 / (800 + 2 * 400) = 0.5
Effective data rate = efficiency * data rate = 0.5 * 10 = 5Mbps
A relational database contains two tables student and department in which student table has columns roll_no,name and dept_id and department table has columns dept_id and dept_name. The following insert statements were executed successfully to populate the empty tables:
Insert into department values(1, ‘Mathematics’)
Insert into department values (2, ‘Physics’)
Insert into student values (1, ‘Navin’, 1)
Insert into student values (2, ‘Mukesh’, 2)
Insert into student values(3, ‘Gita’, 1)
How many rows and columns will be retrieved by the following SQL statement?
Select * from student, department
-
Solution
After populating the table
Select * from student, department.
This query will execute natural join first and will retrieve all the row and column. Hence 6 row and 5 column will retrieve,which is same as cartessian product of these table.
Consider the following entity relationship diagram (ERD),where two entities E1 and E2 have a relation R of cardinality 1 : m.
The attributes of E1 are A11, A12 and A13 where A11 is the key attribute. The attributes of E2 are A21, A22 and A23 where A21 is the key attribute and A23 is a multi-valued at tribute.Relation R does not have any attribute.Are lational database containing minimum number of tables with each table satisfying the requirements of the third normal form (3NF) is designed from the above ERD. Then umber of tables in the database is ______________.
-
Solution
We need just two tables for 1NF.
T1: {A11, A12, A13}
T2: {A21, A22, A23, A11}
A23 being multi-valued, {A21, A23} becomes the key for T2 as we need to repeat multiple values corresponding to the multi-valued attribute to make it 1NF. But, this causes partial FD A21->A22 and makes the table not in 2NF.In order to make the table in 2NF, we have to create a separate table for multi-valued attribute. Then we get
T1: {A11, A12, A13} - key is A11
T2: {A21, A22, A11} - key is A21
T3: {A21, A23} - key is {A21, A23}
Here, all determinants of all FDs are keys and hence the relation is in BCNF and so 3NF also. So, we need minimum 3 tables
Consider the following program module:
int module 1 (int x, int y)
while (x!=y) {
if(x>y)
x=x–y;
elsey = y – x;
}
return x;
}What is Cyclomatic complexity of the above module?
Suppose that a certain computer with pages virtual memory has 4 KB pages, a 32-bit byte addressable virtual address space and a 30-bit byte addressable physical address space. The system manages an inverted page table, where each entry includes the page number plus 12 overhead bits. How big is the basic inverted page table,including page number and overhead bits?
-
Solution
Given Pages size = 4KB
Virtual address space = 32 bit byte addressable
Physical address space = 30 bit byte addressable
To find Size of inverted page table.
Solution Each page is 4 KB = 212 Bytes and physical memory is 230 Bytes,it includes 230–12=218 frames.
Virtual memory is 232 Bytes and the overhead bits are 12. So page number will be of 32 – 12 = 20 bits Number of bits in each table entryPage table size =Number of frames ×(20 + 12) = 20 bits.= 218 × 32 bits = 220 bytes