Lecture 3 The Relational DB Model. Learning Objectives That the relational database model takes a logical view of data That the relational model’s basic.

Slides:



Advertisements
Similar presentations
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Advertisements

Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
The Relational Database Model – some relations you might want to avoid!!!
The Relational Database Model
Accounting System Design
ITS232 Introduction To Database Management Systems
The Relational Database Model
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Chapter 2 The Relational Database Model
The Relational Database Model
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Database Architecture The Relational Database Model.
Database Systems Lecture 5 Natasha Alechina
The Relational Database Model
3 The Relational Model MIS 304 Winter Class Objectives That the relational database model takes a logical view of data That the relational model’s.
The Relational Database Model
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
SQL Structured Query Language Programming Course.
Copyright © Curt Hill The Relational Model of Database Basic organization and terms.
The Relational Database Model
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
1 Database & DBMS The data that goes into transaction processing systems (TPS), also goes to a database to be stored and processed later by decision support.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
3 1 Database Systems The Relational Database Model.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Chapter 3: Relational Databases
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
The Relational Database Model
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Database Systems: Design, Implementation, and Management Tenth Edition
Data Models.
Chapter 4 Relational Model Characteristics
CIS 207 The Relational Database Model
Lecture 2 The Relational Model
Chapter 3 The Relational Database Model
The 1:M Relationship (continued)
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Database Systems: Design, Implementation, and Management Ninth Edition
DATABASE SYSTEM.
The Relational Database Model
DCT 2053 DATABASE CONCEPT Chapter 2.2 CONTINUE
DATABASE Purpose of database
Database Systems: Design, Implementation, and Management
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Chapter 3 The Relational Model
Presentation transcript:

Lecture 3 The Relational DB Model

Learning Objectives That the relational database model takes a logical view of data That the relational model’s basic components are entities, attributes, and relationships among entities How entities and their attributes are organized into tables About relational database operators, the data dictionary, and the system catalog How data redundancy is handled in the relational database model Why indexing is important

Oracle log on procedures Can log from home Download putty shell

Two steps Log on to UNIX Log on to ORACLE To change ORACLE Password: Sql> ALTER USER username IDENTIFIED BY newpassword;

to get information on your table: sql> DESC tablename to get a list of your tables: Sql> SELECT TABLE_NAME FROM USER_TABLES; To save Sql> commit; To unsave Sql> rollback;

Scope of SQL DDL statements: Sql>Create Sql>Drop Sql>Alter DML statements Sql>Select Sql>Update Sql>Delete Sql>Insert

Creating DB Structure Steps create SCHEMA (already done for you) create TABLES –FK & PK create VIEWS create indexes

Relational table Two Dim structure Order of rows is NOT important Cols represent attributes Row represent an occurrence of an entity Each column has a set of allowable values, called domain Each table has a primary key Intersection of row/column represent a single value

Data Structure & Data Types Data Structure: Domain Relationship relational DB Keys (PK & FK) Data Type: Numeric/Character Date Logical Pictures Graphical

Relation Relation is a table of n columns and m rows., Referred to as: m x n rows define CARDINALITY (m), cols define DEGREE (n) relations are represented as: relation (attribute names..) ex; STUDENT (student name, student ss#, student address, GPA)

Relational DB a collection of relations Keys Primary Candidate Foreign Secondary

Primary Key (PK) (page 66) a unique identifier guarantees that each row of a relation can be uniquely addressed, in other words, if I give you the value of a primary key,we should get one and only one tuple (row) from the table. It is usually a field from the table or a combination of fields (also called concatenated or composite key) from the table.

Foreign key Relates two tables An attribute in ONE table which relates PK in another table Candidate key Secondary key

Functional dependency A--  B (A, B)--  C

Integrity Rules Entity integrity Referential integrity

Relational Algebra (p 72 & p298) Union compatible Operations Union Difference Intersect

Relationship among databases 1:1 1:m M:n recursive

ER Diagrams and their conversion to relations 1:1 1:m M:n

The Data Dictionary and System Catalog (page 78) Data dictionary –Used to provide detailed accounting of all tables found within the user/designer- created database –Contains (at least) all the attribute names and characteristics for each table in the system –Contains metadata—data about data –Sometimes described as “the database designer’s database” because it records the design decisions about tables and their structures

The Data Dictionary and the System Catalog (continued ) System catalog –Contains metadata –Detailed system data dictionary that describes all objects within the database –Terms “system catalog” and “data dictionary” are often used interchangeably –Can be queried just like any user/designer- created table

Indexes Unique Non-unique Index points to the records in the table

Q1,4, 5 and 6/p96