U:/msu/course/cse/103 Day 08, Slide 1 Debrief Homework What problems arose in trying to import the data from Classical_Music.xls?

Slides:



Advertisements
Similar presentations
Mark Dixon Page 1 05 – Database Design: Sub-forms.
Advertisements

Mark Dixon Page 1 04 – Database Design: Forms. Mark Dixon Page 2 Session Aims & Objectives Aims –To allow easier data entry using forms Objectives, by.
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
1 CSE Students: Please do not log in yet. Check-in with Brian in the back. Review Days 3 and 4 in the book. Others: Please save your work and logout.
U:/msu/course/cse/103 Day 16, Slide 1 CSE 103 Day 16 Students: Read Day 10. If you are logged in, add records to your contacts.
U:/msu/course/cse/103 Day 23, Slide 1 Review of Day 22 What query did you use to search for an actor by name? –Return matches.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Introduction to Structured Query Language (SQL)
Relational Database Design and MySQL
Database Software Application
Databases & Data Warehouses Chapter 3 Database Processing.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Class 6 Data and Business MIS 2000 Updated: September 2012.
Introduction to SQL J.-S. Chou Assistant Professor.
U:/msu/course/cse/103 Day 25, Slide 1 Back-up PHP Files If you have not yet passed the 3.0 BT, make back-up copies of ALL.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
U:/msu/course/cse/103 Day 10, Slide 1 Multiple Table Database Review What are entities? What are records ? What are attributes?
U:/msu/course/cse/103 Day 10, Slide 1 CSE 103 Students: Your BTs have been graded. See Erica or Jo with questions or stay.
U:/msu/course/cse/103 Day 04, Slide 1 CSE students: Do not log in yet. Computers are SLOW today! Review days 13.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Programming using C# Joins SQL Injection Stored Procedures
1 Intro to JOINs SQL INNER JOIN SQL OUTER JOIN SQL FULL JOIN SQL CROSS JOIN Intro to VIEWs Simple VIEWs Considerations about VIEWs VIEWs as filters ALTER.
U:/msu/course/cse/103 Day 07, Slide 1 Day 15 Review What datatype would be an appropriate choice for: –A cell phone number.
Concepts of Database Management Seventh Edition
U:/msu/course/cse/103 Day 06, Slide 1 CSE students: Do not log in yet. Review Day 6 in your textbook. Think about.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
ACCESS CHAPTER 5 FORMS AND REPORTS Learning Objectives: Build a simple form Add a label, text box, and list controls to a form Create a multi-table form.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
Day 13, Slide 1 U:/msu/course/cse/103 CSE 103 Students: Review INNER and OUTER JOINs, Subqueries. Others: Please save your.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
1 CSE 103 Section 002: M/W 10:20am-12:10pm 216 Berkey Hall Section 004: T/R 10:20am-12:10pm 1210 Anthony Hall.
Relational Databases.  In week 1 we looked at the concept of a key, the primary key is a column/attribute that uniquely identifies the rest of the data.
McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Lab 3 Analyzing Tables and Creating.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
O FFICE M ANAGEMENT T OOL - II B BA -V I TH. Abdus Salam2 Week-7 Introduction to Query Introduction to Query Querying from Multiple Tables Querying from.
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.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
U:/msu/course/cse/103 Day 18, Slide 1 CSE 103 Day 18 If you are not enrolled in CSE 103, please save and log out by 10:10.
U:/msu/course/cse/103 Day 03, Slide 1 CSE 103 Day 15: Database Design Students: –Read Day 2 in your textbook –Your BT feedback.
Information Systems Today: Managing in the Digital World TB3-1 3 Technology Briefing Database Management “Modern organizations are said to be drowning.
U:/msu/course/cse/103 Day 21, Slide 1 CSE 103 Makeups –If you didn’t take one over the weekend, take one TUESDAY or WEDNESDAY!
U:/msu/course/cse/103 Day 17, Slide 1 CSE 103 Housekeeping: –Take a makeup BT this week if not passed the 2.0 yet –Next.
Session 1 Module 1: Introduction to Data Integrity
Databases.  Question 1: What does SQL stand for? …………………………………………………………………… (1 point)  Question 2: Considering programming paradigms, what kind of language.
U:/msu/course/cse/103 Day 08, Slide 1 CSE 103 Students: –Review days 7 and 8 if you need to go over relationships and INNER.
U:/msu/course/cse/103 Day 12, Slide 1 CSE 103 Students: Read Day 18 and learn about subqueries Others: Please save your.
Relational Database Design and MySQL Charles Severance
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Copyright © 2016 Pearson Education, Inc. CHAPTER 7: ADVANCED SQL (PART I) Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki.
Select Complex Queries Database Management Fundamentals LESSON 3.1b.
CSC314 DAY 9 Intermediate SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall USING AND DEFINING VIEWS  Views provide users controlled.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Module 11: File Structure
Indexes By Adrienne Watt.
CSE 103 Day 15: Database Design
CIS 155 Table Relationship
SQL – Subqueries.
CSE Students: Please do not log in yet.
Debrief Homework Import data from the text file CanadianUniversities06.txt into a temporary table. What is the primary key for this table? Construct an.
Use of SQL – The Patricia database
Presentation transcript:

U:/msu/course/cse/103 Day 08, Slide 1 Debrief Homework What problems arose in trying to import the data from Classical_Music.xls? –Duplicate entries (both Artists and Albums) –Need to enter foreign key into the table tbl_Albums rather than the actual label name –Need to enter foreign keys into the table tbl_PerformsIn rather than the actual artist name and album title So copy the file musicDay08.mdb to use

U:/msu/course/cse/103 Day 08, Slide 2 Debrief Relations What are the three types of relations? What are examples of each type in our databases? How do you implement each type?

U:/msu/course/cse/103 Day 08, Slide 3 Database Design Using tables and relations between the tables allows us to store information with a minimum of redundancy How do we extract information from a multi-table database? –How do multi-table queries incorporate the relations between the tables? –e.g., Which albums were released on the Sony label?

U:/msu/course/cse/103 Day 08, Slide 4 Questions about JOINS The JOIN operation is discussed on 8-2 and 8-3 of the textbook. What are the three steps in the JOIN operation called? What is meant by each of these terms?

U:/msu/course/cse/103 Day 08, Slide 5 Pencil and Paper JOIN Exercise Worksheet with two tables –tbl_Tracks and tbl_Albums The JOIN table is partially complete –First operation is unfinished Complete all steps of the JOIN operation Which rows are left in the final JOIN table? How many columns are there?

U:/msu/course/cse/103 Day 08, Slide 6 Constructing a Multi-Table Query in SQL on musicDay08 First operation: PRODUCT SELECT AlbumID, AlbumTitle, AlbumYear, LabelID, NumTracks, NumDiscs, TrackID, TrackNumber, Title, Album, [Secondary Artist], Duration FROM tbl_Albums, tbl_Tracks WHERE (AlbumID=15 OR AlbumID=28 OR AlbumID=33) AND (TrackID=85 OR TrackID=88 OR TrackID=279 OR TrackID=413 OR TrackID=415) AND (TrackID=85 OR TrackID=88 OR TrackID=279 OR TrackID=413 OR TrackID=415)

U:/msu/course/cse/103 Day 08, Slide 7 Query Construction, cont. What condition should we enforce to get only those records from the two tables that match on the common attribute? (SELECT) How many rows are returned now? How can we remove the duplicate column? (PROJECT) How can we construct this same query in Design View?

U:/msu/course/cse/103 Day 08, Slide 8 Compare Generated SQL What is different about the SQL in this query? –It uses (tbl_Albums INNER JOIN tbl_Tracks ON tbl_Albums.AlbumID = tbl_Tracks.Album) instead of restricting in the WHERE clause. Is there any difference in the results when you run the query? This syntax is newer and now preferred. –Easier for the RDBMS to optimize

U:/msu/course/cse/103 Day 08, Slide 9 Multiple Table Queries in SQL Construct the following queries in SQL View –list the albums (title and year) with the name of their label (qry_day08_albums_with_labels) [42] –list the digital tracks with their title, duration, and digital filesize (qry_day08_digital_tracksizes) [362] –list the tracks in the database (track number and title) with the name of their secondary artist (qry_day08_secondary_artists) [9]

U:/msu/course/cse/103 Day 08, Slide 10 Pencil and Paper Exercise on Relation Tables Does it matter which tables we join first? What does the shaded area in the upper right-hand corner of the worksheet represent? Which two tables should be joined next to complete the relational JOIN table? How many rows does the resulting JOIN have?

U:/msu/course/cse/103 Day 08, Slide 11 Verify your results using Access The AlbumIDs and ArtistIDs in the worksheet correspond with those in the music database in the Day 08 AFS space –Sufficient to restrict the tbl_PerformsIn to have ID’s from those listed in both columns –tbl_Artists and tbl_Albums need only restrict the ID Construct a query that performs the join of all three tables (qry_day08_three_table_join)

U:/msu/course/cse/103 Day 08, Slide 12 Bridge Task 1.5 INDIVIDUAL, not group work Everyone should come –You will get the next BT you have not yet passed, either 1.0 or 1.5 –If you take the 1.0 BT, you can schedule a makeup to take the 1.5 BT as soon as you pass the 1.0 Material on days 6, 7 and 8, –Importing, Relations, Joins, Multi-Table Queries Bring textbook, all notes, etc.

U:/msu/course/cse/103 Day 08, Slide 13 Bridge Task 1.5 Review textbook, Web pages, homework All class, homework materials on AFS space –Today's classwork files –Today’s homework

U:/msu/course/cse/103 Day 08, Slide 14 Homework Check the link on the today page for homework to do in advance of the BT on Day 9. You need to construct some queries on your contacts database.