Question: (a) Consider the following schema: Purchase (Custname, amount, date, time) where Custname, amount, date, time, and price are character strings of length 15, integers

(a) Consider the following schema: Purchase (Custname, amount, date, time) where Custname,

(a) Consider the following schema: Purchase (Custname, amount, date, time) where Custname, amount, date, time, and price are character strings of length 15, integers of 2 bytes, 7 byte date type, and 8 byte time type, respectively. Assume we represent a tuple as fixed-length record. How many bytes does the record take if: (i) fields can start at any byte; ii) fields must start at a byte that is a multiple of 4, and iii) fields must start at a byte that is a multiple of 8? (b) Now we extend the Purchase schema (containing the four fixed-length field) with three variable-length fields: tid, address, and product. If pointers within a record require 4 bytes, a record length is a 4-byte integer, and we need to use a record header for record length and pointers, how many bytes in total, exclusive of the space needed for the variable-length fields, are needed for the record? (assume fields can start at any byte). (c) Recompute the bytes needed for the extended record in (b) under the conditions (ii) and (iii).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a i If fields can start at any byte Custname 15 bytes amount 2 bytes date 7 bytes time 8 bytes Total ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!