Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a computer database problem. Assume a table Emp(ssn, name, salary) of em

ID: 3778204 • Letter: T

Question

This is a computer database problem. Assume a table Emp(ssn, name, salary) of employee records, where ssn is the primary key. The total size of the table is 34,560MB. The table (i.e., the records of the table) is stored in a heap file in chunks of 2KB pages (all full of records) on a single disk drive. In all questions below that involve indices, assume that the number of leaf pages for B-trees and the number of buckets for hash indices are the same with the number of pages required to store the table in the heap. Now, consider this query: find the maximum salary in the Emp table; i.e., in SQL, "select max(salary) from Emp".Assuming no indexing of any kind, i.e., we just have the records of the table in the heap, what is the cost of this query (in number of disk accesses)?

Explanation / Answer

Assume 1 MB = 1000 KB and we have 10000 records in table EMP

So, Table Size = 34560 MB = 34560 * 1000 KB = 34560000 KB

Estimated cost of query = Nr * Bs + Br

= 10000 *   100     + 17280000

= 18280000 disk accesses.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote