Notes03 - CS245:DatabaseSystem Principles...

Info iconThis preview shows pages 1–21. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 245 Notes 3 1 CS 245: Database System  Principles Notes 03: Disk Organization Hector Garcia-Molina
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 2 How to lay out data on disk How to move it to memory Topics for today
Background image of page 2
CS 245 Notes 3 3 What are the data items we want to store? a salary a name a date a picture
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 4 What are the data items we want to store? a salary a name a date a picture What we have available: Bytes 8 bits
Background image of page 4
CS 245 Notes 3 5 To represent: Integer (short): 2 bytes e.g., 35 is  00000000 00100011  Real, floating point n  bits for mantissa,  m  for exponent….
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 6 Characters   various coding schemes suggested, most popular is ascii To represent: Example: A:    1000001 a:     1100001 5:     0110101 LF:   0001010
Background image of page 6
CS 245 Notes 3 7 Boolean e.g., TRUE     FALSE 1111 1111 0000   0000 To represent:  Application specific e.g.,  RED   1    GREEN   3   BLUE   2    YELLOW   4  …
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 8 Boolean e.g., TRUE     FALSE 1111 1111 0000   0000 To represent:  Application specific e.g.,  RED   1    GREEN   3   BLUE   2    YELLOW   4  … Can we use less than 1 byte/code? Yes, but only if desperate. ..
Background image of page 8
CS 245 Notes 3 9 Dates e.g.:  - Integer, # days since Jan 1, 1900     - 8 characters, YYYYMMDD     - 7 characters, YYYYDDD (not YYMMDD! Why?) Time e.g.   - Integer, seconds since midnight     - characters, HHMMSSFF To represent:
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 10 String of characters Null terminated e.g., Length given e.g., - Fixed length c t a c t a 3 To represent:
Background image of page 10
CS 245 Notes 3 11 Bag of bits Length Bits To represent:
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 12 Key Point  Fixed length items  Variable length items - usually length given at beginning
Background image of page 12
CS 245 Notes 3 13 Type of an item:  Tells us how to  interpret (plus size if fixed) Also
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 14 Data Items Records Blocks Files Memory Overview
Background image of page 14
CS 245 Notes 3 15 Record  - Collection of related data items (called FIELDS ) E.g.: Employee record: name field, salary field, date-of-hire field, . ..
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 16 Types of records: Main choices: FIXED vs VARIABLE FORMAT FIXED vs VARIABLE LENGTH
Background image of page 16
CS 245 Notes 3 17 A SCHEMA  (not record) contains following information - # fields - type of each field - order in record - meaning of each field Fixed format
Background image of page 17

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 18 Example:  fixed format and length Employee record (1) E#, 2 byte integer (2) E.name, 10 char. Schema (3) Dept, 2 byte code 55 s m i  t   h 02 83 j o n  e  s 01 Records
Background image of page 18
CS 245 Notes 3 19 Record itself contains format “Self Describing” Variable format
Background image of page 19

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 3 20 Example:  variable format and length
Background image of page 20
Image of page 21
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2011 for the course CS 245 taught by Professor Dr.hector during the Winter '02 term at SUNY Buffalo.

Page1 / 89

Notes03 - CS245:DatabaseSystem Principles...

This preview shows document pages 1 - 21. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online