Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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
(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 -case (i)). (c) Recompute the bytes needed for the extended record in (b) under the conditions (ii) and (iii). (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 -case (i)). (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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started