Representing Data Elements Gayatri Gopalakrishnan.

Slides:



Advertisements
Similar presentations
CIT 613: Relational Database Development using SQL Revision of Tables and Data Types.
Advertisements

Database Chapters.
Dr. Kalpakis CMSC 661, Principles of Database Systems Representing Data Elements [12]
Database Design -- Basic SQL
Database Basics I101 Summer 2006 Copyright 2004, Matt Hottell.
Database Modifications, Data Types, Views. Database Modifications A modification command does not return a result as a query does, but it changes the.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 28 Database Systems I The Relational Data Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 SQL: Data Definition, Constraints, and Basic Queries and Updates.
Fall 2001Arthur Keller – CS 1808–1 Schedule Today Oct. 18 (TH) Schemas, Views. u Read Sections u Project Part 3 extended to Oct. 23 (T). Oct.
1 A GUIDE TO ORACLE8 CHAPTER 2: Creating and ModifyingDatabaseTables 2.
CIT 381 Data Types - data types - create table statement - constraints.
Winter 2002Arthur Keller – CS 1808–1 Schedule Today: Jan. 29 (T) u Modifications, Schemas, Views. u Read Sections Assignment 3 due. Jan. 31 (TH)
Basic SQL types String –Char(n): fixed length. Padded –Varchar(n): variable length Number –Integer: 32 bit –Decimal(5,2): –Real, Double: 32 bit,
13.5 Representing Data Elements Fields, Records, Blocks Variable-length Data Modifying Records.
Database Modifications A modification command does not return a result as a query does, but it changes the database in some way. There are three kinds.
13.5 Arranging data on disk Meghna Jain ID-205CS257 ‏Prof: Dr. T.Y.Lin.
Chapter 12 Representing Data Elements By Yue Lu CS257 Spring 2008 Instructor: Dr.Lin.
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.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Structured Query Language (SQL) A2 Teacher Up skilling LECTURE 2.
CSE314 Database Systems Lecture 4 Basic SQL Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
ORDBS1 Object Relational Database Systems: 1. Introduction 2. Objects in SQL3 3. Comparison of ODL/OQL and SQL3 Approaches CIS 671.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
1 The Relational Model Instructor: Mohamed Eltabakh
Chapter 8 Part 1 SQL-99 Schema Definition, Constraints, Queries, and Views.
Winter 2006Keller Ullman Cushing8–1 Turning in Assignments Please turn in hard copy (use only in the direst of circumstances). I am not your secretary.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Chapter 3 Representing Data Elements 1.How to lay out data on disk 2.How to move it to memory.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
Data Definition After this lecture, you should be able to:
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Tables and Constraints Oracle PL/SQL. Datatypes The SQL Data Definition Language Commands (or DDL) enable us to create, modify and remove database data.
SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.
Data types  CHAR (size): This data type is used to store character strings values of fixed length. The size in brackets determines the number of characters.
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.
Week 8-9 SQL-1. SQL Components: DDL, DCL, & DML SQL is a very large and powerful language, but every type of SQL statement falls within one of three main.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
1 CS 430 Database Theory Winter 2005 Lecture 11: SQL DDL.
Pointers in C++. Topics Covered  Introduction to Pointers  Pointers and arrays  Character Pointers, Arrays and Strings  Examples.
Academic Year 2015 Autumn. MODULE CC2006NI: Data Modelling and Database Systems Academic Year 2015 Autumn.
Jennifer Widom Relational Databases The Relational Model.
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
Chapter 31 Chapter 3 Representing Data Elements. Chapter 32 Fields, Records, Blocks, Files Fields (attributes) need to be represented by fixed- or variable-length.
Creating Database Objects
CPSC-310 Database Systems
Relational Data Model Lu Chaojun, SJTU.
CS 480: Database Systems Lecture 13 February 13,2013.
Secondary Storage Management 13.5 Arranging data on disk
Attributes and Domains
Designing Tables for a Database System
Database Models Relational Model
Relational Databases The Relational Model.
Relational Databases The Relational Model.
SQL OVERVIEW DEFINING A SCHEMA
Database systems Lecture 2 – Data Types
Defining a Database Schema
Local Variables, Global Variables and Variable Scope
Oracle Data Definition Language (DDL)
SQL-1 Week 8-9.
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Chapter 4 Introduction to MySQL.
CMSC-461 Database Management Systems
Creating Database Objects
Database Instructor: Bei Kang.
SQL (Structured Query Language)
Presentation transcript:

Representing Data Elements Gayatri Gopalakrishnan

Contents Representing Relational Database Elements Representing Objects Representing Data Elements Records Reference

Representing Relational Database Objects CREATE TABLE StudentDetail( name CHAR(35), studentid INT(6) PRIMARY KEY, dept VARCHAR(50) );

Object as a Tuple How are an Object’s Methods stored Object Identifiers Accessing Methods Relation between objects Representing Objects

Representing Data Elements Character Data types Bit Strings Enumerated Types Integer and Float Dates and Times

Character Strings Fixed Length Character strings Described by SQL as CHAR (n), stored as an array of n bytes If actual string < n, the array is filled out with pad characters Default minimum size 1 byte maximum size 2000 bytes

Variable Length Character Strings Described by SQL as VARCHAR(n) Stored as an array of n+1 bytes Default minimum size 1 byte maximum size 4000 bytes Two representations of VARCHAR strings  Length plus content  Null Terminated string Character Strings contd..

Bits Described by SQL as BIT(n) If n is not divisible by 8, ignore the unused bits of the last byte Enumerated Types Attributes whose values take on a small fixed set of values Example Color = {RED,BLUE,GREEN,YELLOW}

Integer and Floats Integer Described by SQL as INTEGER Float Described by SQL as DECIMAL(p,s) p is the precision s is the scale Date and Time Date is represented as a fixed length character string Format

Date and Time contd.. Time is represented as a character string SQL standard allows value of TIME to include fractions of second – This can represented as VARCHAR or variable length values Time with time zone example 12:00: TIMESTAMP example :00: Timestamp can also include time zone

Thank You