Query Lab CSC 240 Blum1. Log on to PMA (PHPMyAdmin) and click on the Northwind database CSC 240 Blum2.

Slides:



Advertisements
Similar presentations
Microsoft Office Illustrated Fundamentals Unit K: Working with Data.
Advertisements

Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate.
Mark Dixon Page 1 02 – Queries: Query by Example.
Structured Query Language Part I Chapter Three CIS 218.
Access Presentation 3 By: Rasagnya Waghray Ali Murtuza.
Microsoft Access 2010 Chapter 7 Using SQL.
Creating FrontPage Tasks The task view allows you to add information about what you want to accomplish when creating your Web site.
Microsoft Excel Tutorial. Spreadsheet Basics! The Microsoft Excel Window  When you open Microsoft Excel, this screen will appear. Then, if necessary,
Chapter 2 Querying a Database
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
You can use a query to view a subset of your data or to answer questions about your data. For example, if you want to view a list of student names and.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Working with a Database
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
CSC 240 (Blum)1 Random Topics: OLE Objects, Mail Merge and XML Exporting.
Microsoft Access Queries Birgül Kutlu. SORTING AND FILTERING Sorting and filtering allow you to view records in a table in different ways such as: reordering.
Nasca Access BasicsMore Access Access Again Access Continued Access Leftovers.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T8: Decision Making Using Access 2007 Business Driven Technology.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Concepts of Database Management Seventh Edition
IMS 4212: Intro to SQL 1 Dr. Lawrence West, Management Dept., University of Central Florida Introduction to SQL—Topics Introduction to.
Analyzing Data Using Access. Creating a new database To create a new database 1.Start Access. In the Task Pane, click Blank Database. 2.The File New Database.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
CSC 240 (Blum)1 Forms and Importing Data in Access.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 11 Organizing the Worksheet.
Analysing Data with Excel Viewing Help To view Help 1.On the Start menu, point to Programs, and then click Microsoft Excel. 2.On the Help menu,
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
CSC 240 (Blum)1 Introduction to Data Entry, Queries and Reports.
Performing Calculations—1 of 2 In addition to using queries to retrieve, update, sort, and filter data in a database, you can use a query to perform calculations.
There are seven main components of a database in Access 2000: Tables. Use tables to store database information. Forms Use forms to enter or edit the information.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
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.
Chapter 6 Creating, Sorting, and Querying a Table
You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see.
PHP getting data from a MySQL database. Replacing XML as data source with MySQL Previously we obtained the data about the training session from an XML.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/All Programs/Microsoft Office/Microsoft Office.
FIRST COURSE Word Tutorial 6 Using Mail Merge. Objectives Learn about the mail merge process Use the Mail Merge task pane Select a main document Create.
Excel part 5 Working with Excel Tables, PivotTables, and PivotCharts.
Key Applications Module Lesson 22 — Managing and Reporting Database Information Computer Literacy BASICS.
Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that.
Microsoft Access Lesson 5 Lexington Technology Center February 25, 2003 Bob Herring On the Web at
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
Querying the State Capital Database. Click on the Query tab. Use the Column drop-downs to select the column/field names in your query, whether to show.
Access Query Design. IT Fundamentals2 Access Query Design The Query design screen provides a mechanism for selecting specific data from datafile(s) by:
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
COM621: Advanced Interactive Web Development Lecture 11 MySQL – Data Manipulation Language.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Access Chapter 2 Querying a Database.
Word Tutorial 6 Using Mail Merge
The Database Exercises Fall, 2009.
Microsoft Office Illustrated Fundamentals
Creating and Modifying Queries
CIS16 Application Programming with Visual Basic
Chapter 9 Lesson 2 Notes.
Access: SQL Participation Project
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Query Lab CSC 240 Blum1

Log on to PMA (PHPMyAdmin) and click on the Northwind database CSC 240 Blum2

Alternative place to work: CSC 240 Blum3

After choosing the Northwind database, click on the Query tab CSC 240 Blum4

Use the drop-down to choose `customers`.* Then check the Show checkbox. Then click The Update Query button CSC 240 Blum5 The marks around the table name seen here are called tick marks or back-ticks. They slant and are above the Tab on the upper left of the keyboard. They are NOT single quotes. They are not necessary in this case but PMA includes them.

Key words SELECT – In SQL a SELECT statement is one that looks at a subset of data – As opposed to adding data (INSERT), taking away data (DELETE) and changing data (UPDATE) FROM – FROM indicates the source of the data – which tables that data comes from CSC 240 Blum6

Next click the Submit Query button CSC 240 Blum7

Result: 94 records (displaying 30 per page) CSC 240 Blum8

Click on Northwind to move from the specific customers table to the more general Northwind database CSC 240 Blum9

Click on the Query tab. This time select specific fields (instead of * for all fields). Remember to check Show and click Update Query. CSC 240 Blum10

Result from clicking the Submit Query button. It produces the same number of records but fewer fields per record. CSC 240 Blum11

Projection In “relational algebra” the previous query is an example of a projection – we have projected out some of the fields. (Don’t be intimidated by the term “relational algebra” it just means things we can do to database tables.) CSC 240 Blum12

YOU DO #1 Make a Word document and paste into the SQL for – The first name and last name of Employees CSC 240 Blum13

Return to Northwind/Query. Choose `customers`.* and Show for one column and `customers`.`City` and ='London' as the Criteria CSC 240 Blum14

Click Update to show the query CSC 240 Blum15

WHERE – selection The new keyword appearing is WHERE – It is used to limit the record that will display to those that meet some condition In relational algebra, this procedure of limiting the number of records is known as selection Note in this case that the WHERE condition uses single quotes – different from ticks CSC 240 Blum16

Result of selecting customers whose city is London. 4 records. CSC 240 Blum17

Compound condition: City is London or Berlin CSC 240 Blum18

Results of Compound condition: City is London or Berlin CSC 240 Blum19

YOU DO #2 Paste into your Word document the SQL for – Suppliers whose Country is France or Germany CSC 240 Blum20

Compound condition: contactTitle is Owner and Country is Mexico CSC 240 Blum21

Result of Compound condition: contactTitle is Owner and Country is Mexico CSC 240 Blum22

YOU DO #3 Paste into your Word document the SQL for – Employees whose Title is sales Representative and Country is USA CSC 240 Blum23

Combining selection and projection CSC 240 Blum24 selection projection

Result of selection and projection CSC 240 Blum25

Sort result by choosing Ascending or descending from the drop-down under a field. CSC 240 Blum26

Keywords for sorting ORDER BY – Is followed by the field (or fields) upon which the sorting will be based ASC – Indicates the results will be shown from lowest to highest numerically or in alphabetic order for text/strings DESC – Highest to lowest or reverse alphabetical CSC 240 Blum27

Results of query sorted on CompanyName CSC 240 Blum28

YOU DO #4 Paste into your Word document the SQL for – Products sorted by ProductName CSC 240 Blum29

Obtaining a list of customer countries CSC 240 Blum30

Result of customer country query (so far). Click on Edit to work on further. CSC 240 Blum31

SQL editing dialog box arises CSC 240 Blum32

Add keyword DISTINCT to eliminate duplicate country results CSC 240 Blum33

Click Go. Query updated. And only unique countries occur in result CSC 240 Blum34

YOU DO #5 Paste into your Word document the SQL for – Distinct cities of employees CSC 240 Blum35

Criteria other than equality: Products with a UnitPrice less than 20 CSC 240 Blum36

Result of Products with a UnitPrice less than 20 CSC 240 Blum37

Products with a UnitPrice greater than or equal to 30 CSC 240 Blum38

Result of Products with a UnitPrice greater than or equal to 30 CSC 240 Blum39

Switching >= to > CSC 240 Blum40

A BETWEEN query criteria: UnitPrice between 20 and 30 CSC 240 Blum41

Results of BETWEEN query: UnitPrice between 20 and 30 CSC 240 Blum42

YOU DO #6 Paste into your Word document the SQL for – Products having a UnitsInStock less than or equal to 15 CSC 240 Blum43