Southern Methodist University CSE 2337 1 CSE 2337 Introduction to Data Management Chapter 2.

Slides:



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

The Relational Model J.G. Zheng May 15 th Introduction Edgar F. Codd, 1970 One sentence to explain relational database model: Data are organized.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Chapter 6 UNDERSTANDING AND DESIGNING QUERIES AND REPORTS.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
Chapter 8 Embedded SQL.
Exploring Microsoft Access 2003 Chapter 6 Many-to-Many Relationships: A More Complex System.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Query by example (based on notes by Silberchatz,Korth, and Sudarshan.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Chapter 2 Querying a Database
Concepts of Database Management Sixth Edition
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
Microsoft Access 2010 Chapter 7 Using SQL.
Concepts of Database Management, Fifth Edition
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Copyright © 2003 by Prentice Hall Module 4 Database Management Systems 1.What is a database? Data hierarchy and data organization Field, record, file,
Chapter 3 Single-Table Queries
Microsoft Access 2010 Chapter 7 Using SQL. Change the font or font size for SQL queries Create SQL queries Include fields in SQL queries Include simple.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Microsoft Access Intro Class 5 Working with Queries.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
1 Chapter 7 Query-By-Example by Monica Chan CS157B Professor Lee.
 Continue queries ◦ You completed two tutorials with step-by-step instructions for creating queries in MS Access. ◦ Now must apply knowledge and skills.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Analyzing Data For Effective Decision Making Chapter 3.
1 A Guide to MySQL 2 Database Design Fundamentals.
Relational Databases (MS Access)
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
1 A Guide to MySQL 2 Database Design Fundamentals.
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE)
Querying a Database Access Project 2. 2 What is a Query?  In general, a query is a form of questioning, in a line of inquiry. A query may also refer.
ACCESS CHAPTER 4 Tables and Queries Learning Objectives: Define table structure Enter data into a table Alter table structure Set a table’s field properties.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
IBS 520 Introduction to Internet Technology Database Fundamentals Week 4.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
IS201 Agenda: 09/19  Modify contents of the database.  Discuss queries: Turning data stored in a database into information for decision making.  Create.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra.
Mining real world data RDBMS and SQL. Index RDBMS introduction SQL (Structured Query language)
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
Drill Consider the following tables with the following fields: Student: FName, LName, StudentID, Age, Yr, Course Grades: ID, P1, P2, P3 1.Display the.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
 Review quiz. Answer questions.  Discuss queries: ◦ What is a query? Turning data stored in a database into information for decision making. ◦ You: Completed.
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.
Chapter 6 Many-to Many Relationship. Agenda AutoNumber Many-to-many relationship Cascaded updating and deleting Auto Lookup Parameter query Total query.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
A Guide to SQL, Eighth Edition
MIS2502: Review for Exam 1 Aaron Zhi Cheng
Yong Choi School of Business CSU, Bakersfield
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 2

Southern Methodist University CSE Overview The Relational Model Relations vs. Tables Queries Query-by-example Relational Algebra

Southern Methodist University CSE Relational Database A relational database is a collection of relations –Each entity has is represented by its own relation –Each attribute is a field or column in that relation –Relationships are common attributes in two or more relations

Southern Methodist University CSE Relation Two dimensional grid in which: –Entries are single-valued –Each column (field or attribute) has a distinct name –All values in a column represent the same attribute –Order of columns and tuples are immaterial –Each tuple is distinct

Southern Methodist University CSE In Access (and other DBMSs) Relation is represented as a table Attributes are represented as columns in the table Order of columns rows in the table is immaterial

Southern Methodist University CSE Common Notation for Tables Name of table List attributes of table in parentheses Rep (RepNum, LastName, FirstName, Street, City, State, Zip, Commission, Rate)

Southern Methodist University CSE SMU Student (StudentID, FirstName, LastName) Professor (FacultyID, FirstName, LastName) Class (ClassNum, Department, FacultyID) Enroll (StudentID, ClassNum, Semester)

Southern Methodist University CSE Primary Key The column or collection of columns that uniquely identifies one row in a table from all other rows in that table. Identify the primary keys in the Premier Products Database.

Southern Methodist University CSE Premier Products Sample Data

Southern Methodist University CSE Premier Products Sample Data

Southern Methodist University CSE Query A question posed to a DBMS in a form or way in which the DBMS can understand and process the question

Southern Methodist University CSE Query Example Find all order numbers for Customer 608 SELECT OrderNum FROM Orders WHERE CustomerNum = 608 SQL

Southern Methodist University CSE SQL Structured Query Language –Entire computer programming language that allows one to ask simple and sophisticated questions to the DBMS Based on Relational Algebra Operations Focus of Chapter 3……

Southern Methodist University CSE Query-By-Example aka QBE Visual/Drag-and-drop approach to writing queries in a RDBMS One of the methods available in MS- Access to write queries

Southern Methodist University CSE The Query Window in Access Execute Query Table Fields

Southern Methodist University CSE Simple Criteria Criteria - conditions that data must satisfy Criterion - a single condition To display specific query results, enter the condition in the appropriate column in the design grid

Southern Methodist University CSE Query with Simple Criteria

Southern Methodist University CSE Comparison (Relational) Operators Helps find something other than exact match Relational Operators are: = > < >= <= NOT (not equal to)

Southern Methodist University CSE Query With Comparison Op

Southern Methodist University CSE Compound Criteria Combines comparison operators AND / OR used between simple criteria AND - both criteria must be true OR - overall criterion is true if either of the individual criteria is true

Southern Methodist University CSE Query Using AND

Southern Methodist University CSE Query Using OR

Southern Methodist University CSE Using Computed Fields Computed field /attribute is one that can be computed on-the-fly rather than stored in the database Can be included in queries when needed Use square brackets if field name contains spaces

Southern Methodist University CSE Query with Computed Fields

Southern Methodist University CSE Query With Computed Field Right-click the column in the Field row and choose Zoom

Southern Methodist University CSE Calculating Statistics Count Sum Avg Max Min StDev Var First Last Built-in statistics (called aggregate functions in Access):

Southern Methodist University CSE Example with Statistics

Southern Methodist University CSE ?