Chapter 12 Representing Data Elements By Yue Lu CS257 Spring 2008 Instructor: Dr.Lin.

Slides:



Advertisements
Similar presentations
Indexing Large Data COMP # 22
Advertisements

Introduction to Database Systems1 Records and Files Storage Technology: Topic 3.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 8 – File Structures.
Dr. Kalpakis CMSC 661, Principles of Database Systems Representing Data Elements [12]
Overview Begin 6:00 Quiz15 mins6:15 Review Table Terms25 mins6:40 Short Break10 mins6:50 SQL: Creating Tables60 mins7:50 Break10 mins8:00 Lab – Creating.
1 Introduction to Database Systems CSE 444 Lectures 19: Data Storage and Indexes November 14, 2007.
Tuples vs. Records CREAT TABLE MovieStar ( Name CHAR (30), Address VARCHAR (255), Gender CHAR (1), DataOfBirth Date ); Tuples are similar to records or.
Fall 2004 ECE569 Lecture ECE 569 Database System Engineering Fall 2004 Yanyong Zhang Course.
Representing Data Elements Gayatri Gopalakrishnan.
RECORD MODIFICATION AKSHAY SHENOY CLASS ID :108 Topic 13.8 Proffesor : T.Y Lin.
12.5 Record Modifications Jayalakshmi Jagadeesan Id 106.
Representing Block and Record Addresses Rajhdeep Jandir ID: 103.
Database Implementation Issues CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 5 Slides adapted from those used by Jennifer Welch.
Basic SQL types String –Char(n): fixed length. Padded –Varchar(n): variable length Number –Integer: 32 bit –Decimal(5,2): –Real, Double: 32 bit,
Chapter 12.2: Records Kristen Mori CS 257 – Spring /4/2008.
CS 104 Introduction to Computer Science and Graphics Problems Introduction to Database (2) Basic SQL 12/05/2008 Yang Song.
13.5 Representing Data Elements Fields, Records, Blocks Variable-length Data Modifying Records.
12.5 Record Modifications Sadiya Hameed ID: 206 CS257.
13.5 Arranging data on disk Meghna Jain ID-205CS257 ‏Prof: Dr. T.Y.Lin.
CS 255: Database System Principles slides: Variable length data and record By:- Arunesh Joshi( 107) Id: Cs257_107_ch13_13.7.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 3 Slides adapted from those used by Jeffrey Ullman, via Jennifer.
13.5 Arranging data on disk Meghna Jain ID-205CS257 ‏Prof: Dr. T.Y.Lin.
1 Relational Data Model CS 157B Nidhi Patel. 2 What is a Data Model? A notation for describing data or information A notation for describing data or information.
SQL Constraints & Triggers May 10 th, Agenda Big picture –what are constraints & triggers? –where do they appear? –why are they important? In SQL.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
Disk Storage Copyright © 2004 Pearson Education, Inc.
13.6 Representing Block and Record Addresses
CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 75 Database Systems II Record Organization.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
CSC 2720 Building Web Applications Database and SQL.
Chapter 3 Representing Data Elements 1.How to lay out data on disk 2.How to move it to memory.
©Silberschatz, Korth and Sudarshan11.1Database System Concepts Chapter 11: Storage and File Structure File Organization Organization of Records in Files.
CS4432: Database Systems II Record Representation 1.
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
CS 405G: Introduction to Database Systems 21 Storage Chen Qian University of Kentucky.
DAY 14: MICROSOFT ACCESS – CHAPTER 1 Madhuri Siddula October 1, 2015.
Chapter 13 Disk Storage, Basic File Structures, and Hashing. Copyright © 2004 Pearson Education, Inc.
Advanced Database CS-426 Week 1 - Introduction. Database Management System DBMS contains information about a particular enterprise Collection of interrelated.
Database Fundamentals CSC105 Furman University Peggy Batchelor.
Chapter 5 The Relational Data Model By Yue Lu CS157B Spring 2008 Instructor: Dr.Lee.
Prince Sultan University Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
# 1# 1 Creating Tables, Setting Constraints, and Datatypes What is a constraint and why do we use it? What is a datatype? What does CHAR mean? CS 105.
Lu Chaojun, SJTU Relational Data Model 1. Lu Chaojun, SJTU What’s a Data Model? A notation (collection of conceptual tools) for describing data as seen.
Chapter 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
ICOM 5016 – Introduction to Database Systems Lecture 13- File Structures Dr. Bienvenido Vélez Electrical and Computer Engineering Department Slides by.
Databases : SQL-Schema Definition and View 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey.
Jennifer Widom Relational Databases The Relational Model.
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
Chapter 31 Chapter 3 Representing Data Elements. Chapter 32 Fields, Records, Blocks, Files Fields (attributes) need to be represented by fixed- or variable-length.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
CS 257: Database System Principles Variable length data and record BY Govind Kalyankar Class Id: 107.
1 Record Modifications Chapter 13 Section 13.8 Neha Samant CS 257 (Section II) Id 222.
Relational Data Model Lu Chaojun, SJTU.
Module 11: File Structure
CS320 Web and Internet Programming SQL and MySQL
Secondary Storage Management 13.5 Arranging data on disk
Database Models Relational Model
Secondary Storage Management 13.5 Arranging data on disk
SQL OVERVIEW DEFINING A SCHEMA
CS3220 Web and Internet Programming SQL and MySQL
CS222/CS122C: Principles of Data Management Lecture #2 Storing Data: Disks and Files Instructor: Chen Li.
ICOM 5016 – Introduction to Database Systems
Chapter 4 Introduction to MySQL.
Introduction to Database Systems CSE 444 Lectures 19: Data Storage and Indexes May 16, 2008.
CS3220 Web and Internet Programming SQL and MySQL
VIJAYA PAMIDI CS 257- Sec 01 ID:102
SQL (Structured Query Language)
Presentation transcript:

Chapter 12 Representing Data Elements By Yue Lu CS257 Spring 2008 Instructor: Dr.Lin

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Data Elements and Fields Representing Relational Database Elements Representing Relational Database Elements –Consider the MovieStar relation below declared in SQL CREATE TABLE MovieStar ( CREATE TABLE MovieStar ( name CHAR(30) PRIMARY KEY, name CHAR(30) PRIMARY KEY, address VARCHAR(255), gender CHAR(1), birthdate DATE ); –DBMS has to represent and store the relation

Data Elements and Fields Issues in representing relational DB elements Issues in representing relational DB elements –How to represent SQL datatypes as fields –How to represent tuples as records –How to represent collections or records in blocks of memory –How to represent and store relations as collections of blocks –How to cope with record sizes –What if the size of a record changes due to updating

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Data Elements and Fields Representing Objects Representing Objects –Objects can have methods or special- purpose functions associated with them –Objects may have an object identifier(OID), which is an address that refers uniquely to that object

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Data Elements and Fields

Representing Data Elements Representing Data Elements –Fixed-Length Character Strings CHAR(n): n bytes CHAR(n): n bytes –Pad characters are used if the actual value is shorter than n –Variable-Length Character Strings VARCHAR(n): n+1 bytes VARCHAR(n): n+1 bytes –Length plus content: # of bytes in the string + characters of the string –Null-terminated string: characters of the string + “null” character

Data Elements and Fields Representing Data Elements (con.) Representing Data Elements (con.) –Dates and Times Date: 10 bytes (YYYY-MM-DD) Date: 10 bytes (YYYY-MM-DD) Time: 8 bytes (HH:MM:SS) Time: 8 bytes (HH:MM:SS) –May need more bytes to include fraction of a second –Bits –Enumerated Types

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Records Building Fixed-Length Records Building Fixed-Length Records –All the fields of the record have a fixed length –E.g. A MovieStar record

Records Building Fixed-Length Records Building Fixed-Length Records –Sometimes, it is more efficient to align fields starting at a multiple of 4

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Records Record Headers Record Headers –Pointer to the record schema –Length of the record –Timestamp

Contents Data Elements and Fields Data Elements and Fields –Representing Relational Database Elements –Representing Objects –Representing Data Elements Records Records –Building Fixed-Length Records –Record Headers –Packing Fixed-Length Records into Blocks

Records Packing Fixed-Length Records into Blocks Packing Fixed-Length Records into Blocks

Records Header Header –Links to other blocks –Information about the role played by this block in such a network –Information about which relation the tuples of this block belong to –Directory giving the offset of each record in the block –Block ID –Timestamp

References Database Systems The Complete Book by Hector Garcia- Molina, Jeffrey D.Ullman and Jennifer Widom Fundamentals of Database Systems The Complete Book by Hector Garcia- Molina, Jeffrey D.Ullman and Jennifer Widom Fundamentals of Principles of Database Systems with Internet and Java Applications by Greg Riccardi Principles of Database Systems with Internet and Java Applications by Greg Riccardi Database Systems by Elmasri Navathe Database Systems by Elmasri Navathe 07spring.dir/chap3.pdf 07spring.dir/chap3.pdf