1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra.

Slides:



Advertisements
Similar presentations
The Relational Model DB Chapter 2 (and some from chapter 4, 5) J.G. Zheng June 27 th 2005.
Advertisements

What is a Database By: Cristian Dubon.
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Copyright © 2004 Pearson Education, Inc.. Chapter 15 Algorithms for Query Processing and Optimization.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
The Relational Database Model
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
ACCESS PART 2. Objectives Database Tables Table Parts Key Field Query and Reports Import from Excel Link to Excel.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
1 1 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 1 Introduction to Database Management.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Concepts of Database Management, 4th Edition, Pratt & Adamski
3 1 Chapter 3 The Relational Database Model Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Concepts of Database Management Sixth Edition
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
The Relational Database Model
Concepts of Database Management, Fifth Edition
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Chapter 3 Single-Table Queries
Concepts of Database Management Seventh Edition
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
1 Chapter 7 Query-By-Example by Monica Chan CS157B Professor Lee.
Introduction to Microsoft Access Overview 1. Introduction What is Access? A relational database management system What is a Relational Database? Organized.
10/31/2012ISC239 Isabelle Bichindaritz1 SQL Graphical Queries Design Query By Example.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Concepts of Database Management, Fifth Edition
1 A Guide to MySQL 2 Database Design Fundamentals.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
The Relational Database Model
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
Concepts of Database Management Seventh Edition
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Chapter 9 Query-by-Example Pearson Education © 2009.
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.
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
CS424 Relational Data Manipulation Relational Data Manipulation Relational tables are sets. Relational tables are sets. The rows of the tables can be considered.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
The Relational Model Pratt & Adamski, Chapter 2. Relational Algebra zProject zSelect zJoin z Union z Intersect z Subtract z Product z Division.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Microsoft Access 2010 Chapter 11 Database Design.
1 Chapter 3 Single Table Queries. 2 Simple Queries Query - a question represented in a way that the DBMS can understand Basic format SELECT-FROM Optional.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 2.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
A Guide to SQL, Eighth Edition
Database Systems: Design, Implementation, and Management Tenth Edition
CIS 207 The Relational Database Model
Lecture 2 The Relational Model
Theory behind the relational engine
Theory behind the relational engine
Databases.
Database Systems: Design, Implementation, and Management
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra

2 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Objectives u Describe the relational model u Understand Query-by-Example (QBE) u Use Criteria in QBE u Create Calculated Columns in QBE u Calculate Statistics in QBE

3 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Objectives (con’t.) u Sort data in QBE u Join Tables in QBE u Update data using QBE u Understand relational algebra

4 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Relational Databases u Collection of tables l Each entity in own table l Attributes are fields (columns) in table l Relationships are common columns in two or more tables u Order of rows and columns is immaterial u Repeating groups are not permitted u Entries with repeating groups are unnormalized

5 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Relations u Two dimensional table in which: l Entries are single-valued l Each column (field or attribute) has a distinct name l All values in a column represent the same attribute l Order of columns is immaterial l Each row (record or tuple) is distinct l Order of rows is immaterial

6 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query-by-Example (QBE) u Query l Questions represented in a way the DBMS can recognize and process u QBE l Visual approach to writing queries l Used in MS-Access

7 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Simple Queries Figure 2.3

8 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Simple Queries (con’t.) Figure 2.4

9 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query that Includes All Fields Figures 2.5 – 2.6

10 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query with Simple Criteria Figures 2.7 – 2.8

11 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query Using AND Criteria Figures 2.9 – 2.10

12 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query Using OR Criteria Figures 2.11 – 2.12

13 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query Using Two Conditions on a Single Field Figures 2.13 – 2.14

14 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query Using Computed Field Figures 2.15 – 2.16

15 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Count Records Figures 2.17 – 2.18

16 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Calculate an Average Figures 2.19 – 2.20

17 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Sort Records Figures 2.23 – 2.24

18 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Sort on Multiple Keys Figure 2.27

19 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Sort on Multiple Keys (con’t.) Figure 2.28

20 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Join Tables Figure 2.29

21 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Join Tables (con’t.) Figure 2.30

22 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Query to Restrict Records in a Join Figures 2.31 – 2.32

23 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Update Query Figure 2.35

24 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Delete Query Figure 2.36

25 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Make-Table Query Figure 2.37

26 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Make-Table Query (con’t.) Figure 2.39

27 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Relational Algebra u Theoretical way of manipulating a relational database to produce new tables u Major commands l SELECT u Retrieves certain rows l PROJECT u Include certain columns l JOIN u Pull data from more than one table

28 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Customer & Sales Rep Tables Figure 2.40

29 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Join of Customer and Sales Rep Figure 2.41

30 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Outer Join of Customer and Sales Rep Figure 2.42

31 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Normal Set Operations u Union of two tables l Result contains all rows that are in either the first table, the second table, or both u Intersection of two tables l Result contains all rows common to both u Difference of tables l Result is the set of rows in one table but not the other

32 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Normal Set Operations (con’t.) u Product of two tables l Result contains Cartesian product l Obtained by concatenating every row in first table with every row in second table u Division Process l Result contains quotient

33 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Product of Two Tables Figure 2.43

34 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Dividing One Table by Another Figure 2.44