CS157b
Chris Pollett
Feb 3, 2020
Which of the following statements is true?
Disk1blk1: 1001 Disk2blk1: 1111 Disk3blk1: ???? ParityBlk1:0010Then Disk3blk1 must be:0100
How do we store relations and objects to disk?
Consider trying to implement a record format for the table created by the following SQL statement:
CREATE TABLE MovieStar( name CHAR(30) PRIMARY KEY, address VARCHAR(255), gender CHAR(1), birthdate DATE );
We now discuss how to represent various kinds of data elements:
Record: | name | address | gender | birthdate | |
---|---|---|---|---|---|
Byte positions: | 0 | 30 | 286 | 286 | 297 |
Sometimes need to store addition info besides the value of each field. This data could be things like:
Record: | schema ref | length | timestamp | name | address | gender | birthdate | |
---|---|---|---|---|---|---|---|---|
Byte positions: | 0 | 4 | 8 | 12 | 44 | 300 | 304 | 316 |
header | Rec `1` | ... | Rec `n` |