Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Describe the ethical issues involved in conducting HRD evaluation

Answered: 1 week ago