You are creating a new database for your accounting department that has the tables as show in Tables 4-4, 4-5, and 4-6. Each table has a clustered index on the Name column. The accounting department expects to have about 2,000,000 rows in the Vendors table, 5,000 rows in the Receivables table, and 2,500 rows in the Payables table at any given time. How much space does the Receivables table take?

You are creating a new database for your accounting department that has the tables as show in Tables 4-4, 4-5, and 4-6. Each table has a clustered index on the Name column. The accounting department expects to have about 2,000,000 rows in the Vendors table, 5,000 rows in the Receivables table, and 2,500 rows in the Payables table at any given time. How much space does the Receivables table take?


Answer – 168 KB

(The int data type is 4 bytes, and the datetime and money data types are both 8 bytes, so the size of the columns added together is 4 + 4 + 8 + 8 = 24 bytes. The null bitmap is 2 + ((4 + 7) ÷ 8) = 3.375, or 3 bytes. The total row size is 24 + 3 = 27 bytes. Each page holds 8,096 ÷ (27 + 2) = 279 rows per page. The total number of pages in the database is 5,000 ÷ 279 = 18 pages. Each page is 8,192 bytes. Therefore, the table takes 147,456 bytes, or about 150 KB.)