When I want to work with SQL, I start off as if I am doing a regular query.

Slides:



Advertisements
Similar presentations
Accessing electronic journals from off- campus This causes lots of headaches, but dont despair, heres how to do it! (Please note – this presentation is.
Advertisements

Microsoft® Access® 2010 Training
Intro to Access 2007 Lindsey Brewer CSSCR September 18, 2009.
Using the What Am I Template Copy the presentation to your hard drive. Open the slides using slide sorter and copy slides #3, 4 and 5 for each question.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Accessing and Using the e-Book Collection from EBSCOhost ® When an arrow appears, click to proceed to the next slide at your own pace. To go back, click.
TEA/TUG + ALDOT(Mobile) = H(O+I) The TEA/TUG being hosted by ALDOT in Mobile causes Hurricanes to come to Alabama. The TEA/TUG being hosted by ALDOT in.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Chapter 2 Querying a Database
Adding metadata to intranet documents Please note: this is a temporary test document for use in internal testing only.
Queries and SQL in Access Please use speaker notes for additional information!
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
MBAC 611.  We have been using MS Access to query and modify our databases.  MS Access provides a GUI (Graphical User Interface) that hides much of the.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
FIRST COURSE Access Tutorial 1 Creating a Database.
Self Guided Tour for Query V8.4 Basic Features. 2 This Self Guided Tour is meant as a review only for Query V8.4 Basic Features and not as a substitute.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
PHP meets MySQL.
HTML Hyper Text Markup Language A simple introduction.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
Getting Started with HTML Please use speaker notes for additional information!
1 Working with MS SQL Server Textbook Chapter 14.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with MSSQL Server Code:G0-C# Version: 1.0 Author: Pham Trung Hai CTD.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
4th Grade Book Publishing Project: Animal ABC Book
Array - adding to array at run time Please see speaker notes for additional information!
Office Management Tools II Ms Saima Gul. Office Management Tools II Ms Saima Gul.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
Introduction to Access 2010 CIS120first.accdb is the database I am creating.
Variety of JavaScript Examples Please use speaker notes for additional information!
I want to do SQL, I start as if I am doing a regular query.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
1 Database Programming with ADO.NET Kashef Mughal.
CS116 COMPILER ERRORS George Koutsogiannakis 1. How to work with compiler Errors The Compiler provide error messages to help you debug your code. The.
This shows CIS17 and the first day introduction..
A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on.
LOGIN PAGE Login Page Support CRM:
Finish ing the logic flowc harts from week 3.. if invcd = “A” and (amtfst > 500 or amtsnd > 200) move “OKAY” to msg end if With the parenthesis, invcd.
Creating a database - I clicked on blank database and am saving it as books10.mdb. For more information see the practice example under week #1. I am going.
This is the software we will use to load our html page up to the server. You can download a copy for home if you want to.
The data in the table.. Starting a query. Two criteria in an AND relationship.
Using a set-up file to read ASCII data into Stata
This shows the user interface and the SQL Select for a situation with two criteria in an AND relationship.
Access Database for CIS17
Please use speaker notes for additional information!
Conditions and Ifs BIS1523 – Lecture 8.
Week 3. criteria must be true..
Using SQL with Access I am adding queries to the stu table in SecondDB.accdb – a database that I created in class. SQL stands for structured query language.
Miscrosoft Office..
I am opeing Access 2003 in the Microsoft Office.
First, open your Workbench
You can read it better when I make the change.
These are user interface queries
On new..
Access Database for CIT12
Please use speaker notes for additional information!
Done with SQL..
This is the example I want the class to put up to become comfortable with creating and populating a table in Access.
Notes on SQL This slide show will introduce SQL using Access. It assumes only an introductory level of knowledge about Access.
Introduction to Access 2010
Scripts In Matlab.
Queries and SQL in Access
Using SQL with Access I create a database named
I am now going to do queries in SQL
either of two other things (an OR relationship between them)
Access Click on file and then you want a new database.
Presentation transcript:

When I want to work with SQL, I start off as if I am doing a regular query.

When I get to the user interface, I add the table and then I go to the icon that lets me look at how to view what I did. From there, I select SQL. In this example, it brought up SELECT FROM books; I wanted to see all fields, so I put in the * after SELECT. Therefore, I am selecting all fields from the table named books.

Now, I want to see specific fields. I am going to change the * and list the fields that I want to see. Note: What your seeing displayed on top of the Access view is a separate Notepad file that was resized to make it easier for you to see the SQL statement. I am going to copy and paste over the query that now says SELECT * FROM books; Please note the semi-colon at the end of the SQL command.

My final SQL SELECT statement has been changed to: SELECT ISBN, title, publisher Note that this is still searching within the “books” table. To execute this, I must click on the icon to display the results.

If I put a field that does not exist in the field list, I get this response. There is no field called yr on the table.

I have now corrected it and replaced yr with the accurate field name of yearPub.

This is WRONG. The order of the clauses are important! The FROM clause should be on the second line and the WHERE clause should be on the third line.

Now, it is correct! Please note again that there is a semi-colon only after all of the clauses. Also remember, this is just a copy in notepad so you can see the code better. This is Query3 that I will run.

I showed the result and I showed the separate copy in notepad since I cannot show the query code and the result at the same time. Again, this is just a copy in notepad.

It is important that when I compare fields, I reference fields of the same type. I put the ABC in quotes because it is a text/string field and therefore must be enclosed in quotes. If I did not use quotes, it would assume that ABC was the name of a field. Numerical data should not be surrounded by quotes if it is being compared to a numeric field.

I made some changes in the structure and added an “Edition” filed.

Here I am checking two things using an AND relationship. The second thing is comparing “edition” (which I made numeric) to “2”, which is testing a numeric to a numeric reference.

The text fields are pushed against the left wall and the numeric fields are pushed against the right wall.

This shows the SQL and the user interface. Please note that sometimes when you bring up the user interface it changes the code in the SQL by putting in a lot of parenthesis, etc. that are not necessary.

This shows the SQL generated by Access. This is NOT the way I want you to write it. Note that books.ISBN means the ISBN field within the books table, but since I am only using one table, these are not necessary. Also note the parenthesis, none of which are needed in this example.

I changed the AND to an OR so I get records that either have ABC or have edition 2.

This is an OR relationship.

Now I want to do this problem - see the next few pages.

This is not what I wanted. It reads publisher ABC and edition 2 OR just yearPub > 2003.

When I put it within parenthesis, it renders correctly. This reads publisher ABC AND either edition 2 OR yearPub > 2003.

This is how the SQL shows up on the query user interface. Note that ABC is repeated because it has to be true.

This is the way that it is generated by Access.

This does not have the parenthesis so it will not solve my problem - it will render incorrectly.

This shows the fact that I get the wrong output - one of the records has CDE. Note that I went back and changed the data for better results. See list of data on one of the previous slides.

This shows the wrong code in the user interface.

When I want to copy a database, I go into windows explorer and drag it to another drive. This mdb is also what I would attach to an for submission. Please keep in mind that the 2007 version of Access uses a different filename extension.