Texas State Technical College DISCOVER! Cartesian Product Cover all the bases.

Slides:



Advertisements
Similar presentations
Database Management Using Microsoft Access Xinhua Chen, Ph.D. Chinese Association of Professionals in Science and Technology March 23, 2003.
Advertisements

Displaying Data from Multiple Tables
Microsoft® Office Access® 2007 Training
Basic SQL Introduction Presented by: Madhuri Bhogadi.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
1Key – Report Creation with DB2. DB2 Databases Create Domain for DB2 Test Demo.
Chapter 6 UNDERSTANDING AND DESIGNING QUERIES AND REPORTS.
COMP 3715 Spring 05. Working with data in a DBMS Any database system must allow user to  Define data Relations Attributes Constraints  Manipulate data.
Texas State Technical College DISCOVER! Second Normal Form - 2NF It has to be the whole key.
Microsoft Excel Working with Excel Lists, Subtotals and Pivot Tables.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Overview Importing text files Creating Forms Creating Reports.
Inner join, self join and Outer join Sen Zhang. Joining data together is one of the most significant strengths of a relational database. A join is a query.
Professor Michael J. Losacco CIS 1150 – Introduction to Computer Information Systems Databases Chapter 11.
Build a database IV: Create queries for a new Access database Overview: Ask your data — create queries It’s time to create queries, one of the most powerful.
Interpreting SQL Code. SQL (The language used to query a database) S is used to specify the you want to include. F is used to specify the the selected.
Microsoft Access 2010 Chapter 7 Using SQL.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Concepts of Database Management, Fifth Edition
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
Mid term Exam COVERS chapters 1-3, 7-8 Two parts In class Take home part (given on Oct 29 th, Due Nov5th in class)
SQL Review Tonga Institute of Higher Education. SQL Introduction SQL (Structured Query Language) a language that allows a developer to work with data.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Texas State Technical College DISCOVER! Database Tables The building blocks of the relational database.
Lecture 2 of Advanced Databases Advanced SQL Instructor: Mr.Ahmed Al Astal.
Chapter 9 Joining Data from Multiple Tables
Using SAS® Information Map Studio
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Using Special Operators (LIKE and IN)
What we’ve learnt Doc 5.69 Doc 5.70 Section 1-3. A simple database Related objects Tables hold the data Forms, reports, queries to access the data.
Chapter 9 Query-by-Example Pearson Education © 2009.
Week 10 Quiz 9 Answers Group 28 Christine Hallstrom Deena Phadnis.
Texas State Technical College DISCOVER! Inner Joins Let’s get together… yeah yeah yeah!
Recap of SQL Lab no 8 Advance Database Management System.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Programming in R SQL in R. Running SQL in R In this session I will show you how to: Run basic SQL commands within R.
Texas State Technical College DISCOVER! Aggregate Functions It’s a group thing.
Chapter 3 Databases and Data Warehouses: Building Business Intelligence Copyright © 2010 by the McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin.
Texas State Technical College DISCOVER! Union and Union All Bringing things together.
Indexes and Views Unit 7.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra.
(SQL - Structured Query Language)
WEEK# 12 Haifa Abulaiha November 02,
N-ary Relations & Their Applications. 2 n-ary Relations Let A 1, A 2, …, A n be sets. An n-ary relation on these sets is a subset of A 1 x A 2 x … x A.
Texas State Technical College DISCOVER! Conversion Functions “Convert this!”
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Texas State Technical College DISCOVER! Third Normal Form - 3NF It’s all about the key, the whole key, and nothing but the key.
Computer Science & Engineering 2111 Database Objects 1 CSE 2111 Introduction to Database Management Systems.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
1 Agenda TMA02 M876 Block 4. 2 Model of database development data requirements conceptual data model logical schema schema and database establishing requirements.
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
IFS180 Intro. to Data Management Chapter 10 - Unions.
3.5 Databases Relationships.
MS Access: Creating Advanced Queries
Multiplication table. x
Hierarchy of Data in a Database
Microsoft Visual Basic 2005 BASICS
CIS 336 PAPERS Education Your Life-- cis336papers.com.
Exploring Microsoft Access 2003
Access: SQL Participation Project
Structured Query Language – The Fundamentals
Chapter 9 Query-by-Example Pearson Education © 2009.
Required queries FdSc inICT Module 107.
FileMaker Pro: Using Advanced Features & Working with Layouts
Presentation transcript:

Texas State Technical College DISCOVER! Cartesian Product Cover all the bases.

Texas State Technical College DISCOVER! Cartesian Product Whenever more than one table is included in a SELECT statement, SQL must know how the individual records between the tables are to be joined. If this information is not provided, SQL defaults to a Cartesian Product between all the records. A Cartesian Product is simply a multiplication between the tables in which all possible combinations of the records are produced. Overview

Texas State Technical College DISCOVER! Visualization PRIMARY KEY Vehicle Table VehicleIDNameEngine Text SVT-C96CobraSVT-V8 TM-C96MustangTorrence-V6 [ ENGINE ] Engine Table PRIMARY KEY ManufacturerConfigurationEngineID Text FordV-6Torrence-V6 FordV-8SVT-V8 Chrysler4 CylinderCRY-4C Given these two tables from our engines and vehicles example… Cartesian Product

Texas State Technical College DISCOVER! Visualization The following code would produce a Cartesian Product between the vehicle and engine tables. SELECT*FROM engine, vehicle ; No join criteria is specified, thus Cartesian is defaulted. [ ENGINE ] Cartesian Product

Texas State Technical College DISCOVER! Visualization [ ENGINE ] Engine Table ComponentsVehicle Table Components ManufacturerConfigurationEngineIDEngineNameVehicleID Text FordV-6Torrence-V6SVT-V8CobraSVT-C96 FordV-6Torrence-V6 MustangTM-C96 FordV-8SVT-V8 CobraSVT-C96 FordV-8SVT-V8Torrence-V6MustangTM-C96 Chrysler4 CylinderCRY-4CSVT-V8CobraSVT-C96 Chrysler4 CylinderCRY-4CTorrence-V6MustangTM-C96 The results of a Cartesian Product of the two tables. Cartesian Product

Texas State Technical College DISCOVER! The number of records returned from a Cartesian Product is calculated the same way as combinations in mathematics. Problem The number of records returned by a Cartesian Product of tables 1, 2, and 3. Calculation #Results = #Records(1) * #Records(2) * #Records(3) Computation Cartesian Product

Texas State Technical College DISCOVER! Domain Marketing Company The database contains a table of customers and a table of announcements. If the boss wanted a mailing label generated for each customer for each announcement, a Cartesian product would be used to generate the label records. Usage Example Cartesian Product

Texas State Technical College DISCOVER! In Summary… Whenever multiple tables are included in a SELECT statement and no joining criteria is specified, SQL assumes it is a Cartesian Product join. A product join is the listing of all possible combinations between the records of each table. Cartesian Product