The Relational Model. CS157A Chris Pollett Sept. 19, 2005.

Similar documents
Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

CS275 Intro to Databases

IBM. Updating the Oracle database for V5.2.2

2. Software Oracle 12c is installed on departmental server machines.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition)

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

Updating the Oracle server for V5.2.1 manually IBM

SIT772 Database and Information Retrieval

The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

CSIT5300: Advanced Database Systems

Class Information. Textbooks. Grading. Final Project. Grading. CS 440: Database Management Systems. Instructor:

LAB 3 Notes. Codd proposed the relational model in 70 Main advantage of Relational Model : Simple representation (relationstables(row,

How connect Oracle Database with Ms SQL Server Database By shoaib

Chapter 1 SQL and Data

Getting Started With Oracle

THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E)

Database Management System 9

ECE 650 Systems Programming & Engineering. Spring 2018

Conceptual Design. The Entity-Relationship (ER) Model

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints

CSC 742 Database Management Systems

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, Normal Forms. University of Edinburgh - January 30 th, 2017

Full file at

1Z Oracle Database 11g Essentials Exam Summary Syllabus Questions

CS143: Relational Model

ORACLE Reference. 2. Modify your start-up script file using Option 1 or 2 below, depending on which shell you run.

Relational Database Systems Part 01. Karine Reis Ferreira

Lecture 1: Relational Databases

CS530 Database Architecture Models. Database Model. Prof. Ian HORROCKS. Dr. Robert STEVENS. and Design The Relational

The Relational Data Model and Relational Database Constraints

Working with Data. L1 Introduction to Database & SQL

Database Systems CSE 303. Lecture 02

Database Systems CSE 303. Lecture 02

CS 377 Database Systems

Data Modelling and Databases. Exercise Session 7: Integrity Constraints

Using Connection Manager to manage seamless seamless HA (RAC & DG) DB connectivity. Mark Abell Oracle DBA / Developer since 1985 (V4)

Steps in normalisation. Steps in normalisation 7/15/2014

Chapter 1: Introduction

Assertions, Views, and Programming. CS157A Chris Pollett Oct. 31, 2005.

Database Applications (15-415)

Operating systems fundamentals - B07

Database Technology Introduction. Heiko Paulheim

Database Instance Setup and Configuration. Oracle Database 10g

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Chapter 2 Introduction to Relational Models

The Entity-Relationship Model (ER Model) - Part 2

Chapter 5. The Relational Data Model and Relational Database Constraints. Slide 5-١. Copyright 2007 Ramez Elmasri and Shamkant B.

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 5-1

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008.

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 2

Handout 4. Logical Database Modeling, Part 1: Relational Data Model. Transforming EER model to Relational.

Database Administration and Management

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, normal forms. University of Edinburgh - January 25 th, 2016

CS54100: Database Systems

CSE 132A Database Systems Principles

SQL Data Definition: Table Creation

Getting started with Oracle

Laboratory Handout Introduction to Oracle

Data about data is database Select correct option: True False Partially True None of the Above

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<

Editors in Unix come in two general flavours:

Relational Databases

CMPT 354: Database System I. Lecture 2. Relational Model

Comp 5311 Database Management Systems. 2. Relational Model and Algebra

DS Introduction to SQL Part 1 Single-Table Queries. By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford)

Chapter 5. Relational Model Concepts 5/2/2008. Chapter Outline. Relational Database Constraints

Unit I. By Prof.Sushila Aghav MIT

CS425 Fall 2016 Boris Glavic Chapter 2: Intro to Relational Model

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

Using Relational Databases for Digital Research

Chapter 5. Relational Model Concepts 9/4/2012. Chapter Outline. The Relational Data Model and Relational Database Constraints

Lecture 11 - Chapter 8 Relational Database Design Part 1

Announcements (September 18) SQL: Part II. Solution 1. Incomplete information. Solution 3? Solution 2. Homework #1 due today (11:59pm)

CS448 Designing and Implementing a Mini Relational DBMS

Using MySQL on the Winthrop Linux Systems

Relational Data Model. Christopher Simpkins

A l Ain University Of Science and Technology

1. Using Bitvise SSH Secure Shell to login to CS Systems Note that if you do not have Bitvise ssh secure shell on your PC, you can download it from

The Relational Data Model and Relational Database Constraints

A l Ain University Of Science and Technology

CS54100: Database Systems

The Relational Model. Week 2

SQL: Part II. Announcements (September 18) Incomplete information. CPS 116 Introduction to Database Systems. Homework #1 due today (11:59pm)

Steps how to duplicate a database to a new machine. Version 10gR2

Database Management Systems,

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

The Relational Data Model. Data Model

CSC 261/461 Database Systems Lecture 10

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

More Normalization Algorithms. CS157A Chris Pollett Nov. 28, 2005.

SQL Simple Queries. Chapter 3.1 V3.01. Napier University

The Relational Model. Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC)

Introduction to SQL Part 1 By Michael Hahsler based on slides for CS145 Introduction to Databases (Stanford)

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations

CSCD43: Database Systems Technology. Lecture 4

Contents I Introduction 1 Introduction to PL/SQL iii

Transcription:

The Relational Model CS157A Chris Pollett Sept. 19, 2005.

Outline A little bit on Oracle on sigma Introduction to the Relational Model

Oracle on Sigma Two ways to connect: connect to sigma, then connect to the DBMS connect directly to DBMS

Method I ssh username@sigma.cs.sjsu.edu (Off campus you might have to ssh to your cs110l account and then go from there to sigma) At the unix prompt type source /cs157aenv Then type sqlplus. You will be prompted for you Oracle password and login.

Method II Use sqlplus on your home machine: sqlplus username@connect_identifier You need to set up a connect_identifier e for this to work.

One way to set up a service Drill down $ORACLE_HOME --> network --> admin. Open file tnsnames.ora in a text editor. Add an entry like: CS157A = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = sigma.cs.sjsu.edu)(port = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = cs157a.cs.sjsu.edu) ) ) CS157A will be your connect_identifier.

Some Basic SQLPLUS commands EXIT -- leave sqlplus @filename -- execute a sequence of SQL commands in a file. HELP command -- get help for syntax of a command HOST - execute OS command. SPOOL filename -- start sending everything typed to a file. (SPOOL OFF to stop). EDIT -- load contents of buffer into editor to edit. Very useful if make typos SET -- used to set an oracle variable. Example: set echo on SHOW ALL - show all variables DESCRIBE table -- show columns of a table DEFINE _editor=pico -- set the default editor.

Buffer Manipulation Commands are stored in a buffer which can be altered to correct for typos. To see the contents of the buffer can type list or list n m. Typing a number<ret> at the prompt will go to that line of the buffer. SQL> 5 5* where streets= no_name ; append text -- adds text as last line of buffer. change /old/new -- changes old to new on current line of buffer del -- deletes current line clear buffer -- deletes contents of buffer. save file -- saves buffer contents to file.

Introduction to the Relational Model So far we have been working with Conceptual models (i.e., ER diagrams) to figure out how to organize our data in the database. We are now going to look at the most popular representational model: the Relational Model. It was developed by Codd in 1970.

Relational Model Concepts In the relational model, a database is viewed as a collection of relations. A relation can be thought of as a table of values: Student Name StudentNumber Class Major Bob 123456789 Jr CS Sally 912345678 Sr PolySci

Parts of a Relation Notice in our relation on the previous slide the relation has a name, and the column headings have names. The column names are called attributes. The space of possible values for entries under a given column are called the attribute s domain. For example, StudentNumber might be an INTEGER. A row out of our relation is called a tuple.

Relational Schemas A relational schema R is used to specify the format of a relation. It is made up of a relation name followed by a list of attributes. For example, R(A 1,,A n ). We denote the domain of each A i by dom(a i ). We will assume a value in a domain is always atomic as far as the database goes. That is, indivisible. The degree of a relation R is the number of attributes in it. For above case, we have n. Using this notation our STUDENT example above would be written: STUDENT(Name: VARCHAR(20), Student Number: INTEGER, Class :{Fr, So, Jr, Sr}, Major : CHAR(2))

Relations We can now talk about a relation r(r) (aka a relation state) for a given relational schema R(A 1,,A n ). r(r) is a set of tuples {t 1,.. t m } such that each t i belongs to dom(a 1 ) x x dom(a n ).

Characteristics of Relations We now discuss some properties of relations that make them independent of how the data is physically stored. 1. Ordering of tuples in a Relation does not matter. i.e., relations are sets of tuples not lists of tuples. 2. Can modify our definition above so that ordering of attributes within a tuple does not matter as well. 3. Values and nulls in tuples. Atrributes are assumed to be atomic, not composite or multivalued. A special value null is used when the attribute does not apply.