CS FundamentalsHardGATE CS (PYQ pattern)
A heap file stores 1,000,000 fixed-length records of 150 bytes in 8192-byte blocks with no block header; records do not span blocks. How many blocks does the file need, and how many bytes are wasted per full block?
- A. 18,311 blocks; 92 bytes
- B. 18,519 blocks; 92 bytes
- C. 18,519 blocks; 102 bytes
- D. 19,519 blocks; 92 bytes
Correct answer: B. 18,519 blocks; 92 bytes
Blocking factor = floor(8192 / 150) = 54; blocks = ceil(1,000,000 / 54) = 18,519; waste per block = 8192 - 54 x 150 = 92 bytes. Ignoring the unspanned waste gives 18,311.
More DBMS and SQL questions
- R(A, B, C, D, E, F) has the functional dependencies BC → D, F → D, F → C, C → D, E → C, DC → E. Counting only the listed dependencies, how…
- R(A, B, C, D, E, F) has the functional dependencies B → E, E → D, B → E, EB → A, A → F. Decompose R into BCNF by this procedure: while…
- R(A, B, C, D, E, F) has FDs A → B, B → C, C → A, AD → E, E → F. How many candidate keys does R have?
- A relation R(A, B, C) holds the tuples (1,x,10), (1,x,20), (1,y,10), (1,y,20), (2,x,10), (2,y,20). Which statement is correct?
- R(A, B, C, D, E) has FDs A → B, C → D, BD → E. How many of the following decompositions are lossless-join? (1) (AB) , (CD) , (ACE) (2)…
- S1(s): a, b, c, d. C1(c): x, y. T1(s, c): (a,x), (a,y), (b,x), (c,y), (c,x), (c,y). How many rows does SELECT s FROM S1 WHERE NOT EXISTS…