Talking to Databases: SQL for Designers



Similar documents
Online shopping store

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Database Query 1: SQL Basics

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

ICADBS504A Integrate database with a website

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

ODBC Overview and Information

Developing Web Applications for Microsoft SQL Server Databases - What you need to know

Access Queries (Office 2003)

and what does it have to do with accounting software? connecting people and business

Equipment Room Database and Web-Based Inventory Management

Information Server Documentation SIMATIC. Information Server V8.0 Update 1 Information Server Documentation. Introduction 1. Web application basics 2

ICAB4136B Use structured query language to create database structures and manipulate data

Using AND in a Query: Step 1: Open Query Design

Short notes on webpage programming languages

Trial version of GADD Dashboards Builder

Click to create a query in Design View. and click the Query Design button in the Queries group to create a new table in Design View.

Microsoft Access 2007

SQL Injection for newbie

REP200 Using Query Manager to Create Ad Hoc Queries

Chapter 4 Accessing Data

Introduction to Microsoft Jet SQL

MySQL for Beginners Ed 3

Equipment Room Database and Web-Based Inventory Management

InfiniteInsight 6.5 sp4

Creating Web Pages With Dreamweaver MX 2004

Inquiry Formulas. student guide

Data Mining Commonly Used SQL Statements

WRITING EFFICIENT SQL. By Selene Bainum

DALHOUSIE NOTES ON PAYROLL EXPENSE DETAIL IN FINANCE SELF SERVICE. QUICK REFERENCE As of September 1, 2015

Oracle 10g PL/SQL Training

DIPLOMA IN WEBDEVELOPMENT

SQL Server Integration Services Using Visual Studio 2005

Getting Started with Dynamic Web Sites

Tutorial 3 Maintaining and Querying a Database

Acrobat 6.0: Professional for Creative and Print Professionals (Windows) (Self-Paced Course)

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package Data Federation Administration Tool Guide

To use MySQL effectively, you need to learn the syntax of a new language and grow

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

Relational Database: Additional Operations on Relations; SQL

Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced

Adding Digital Signature and Encryption in Outlook

Database Linker Tutorial

MICROSOFT ACCESS 2003 TUTORIAL

SQL SELECT Query: Intermediate

1352 Blue Oaks Blvd. Suite 180 Roseville, CA (916) Arroyo Consulting Dynamic Website Storyboard

TaskCentre v4.5 Run Crystal Report Tool White Paper

Building Queries in Microsoft Access 2007

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables

Sample- for evaluation only. Introductory Access. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

Real SQL Programming 1

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

INTRODUCING ORACLE APPLICATION EXPRESS. Keywords: database, Oracle, web application, forms, reports

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

This is a training module for Maximo Asset Management V7.1. It demonstrates how to use the E-Audit function.

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX

Tutorial 3. Maintaining and Querying a Database

Microsoft Office 2010

The Whole OS X Web Development System

Application Servers G Session 2 - Main Theme Page-Based Application Servers. Dr. Jean-Claude Franchitti

Xtreeme Search Engine Studio Help Xtreeme

Web Intelligence User Guide

FileMaker 12. ODBC and JDBC Guide

Business Objects Version 5 : Introduction

OBJECTSTUDIO. Database User's Guide P

Databases in Engineering / Lab-1 (MS-Access/SQL)

Create a New Database in Access 2010

Use the ADO Control in your Visual Basic 6 projects

A basic create statement for a simple student table would look like the following.

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Success Factor LMS - Learner Mode

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

Lesson 7 - Website Administration

Microsoft Access 2007 Advanced Queries

Dreamweaver CS3 THE MISSING MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Tech Note 663 HMI Reports: Creating Alarm Database (WWALMDB) Reports

Video Administration Backup and Restore Procedures

Creating a Participants Mailing and/or Contact List:

ecart Adding Coupons to Your Cart

Financial Data Access with SQL, Excel & VBA

MySQL Manager. User Guide. July 2012

Microsoft Access 3: Understanding and Creating Queries

Review of SwisSQL Data Migration Tool

IS466 Decision Support Systems. SQL Server Business Intelligence Development Studio 2008 User Guide

Online Database Management System

MULTICULTURAL CONTENT MANAGEMENT SYSTEM

Creating and Using Databases with Microsoft Access

Rapid SQL 7.6 Evaluation Guide. Published: January 12, 2009

Six Steps to Completing a Mail-Merge

Oracle Database 10g: Introduction to SQL

4. The Third Stage In Designing A Database Is When We Analyze Our Tables More Closely And Create A Between Tables

Converting an Excel Spreadsheet Into an Access Database

Working with SQL Server Integration Services

Connecting to your Database!... 3

Sequential Query Language Database Networking Using SQL

Search help. More on Office.com: images templates

Advantage Database Server

Unit 10: Microsoft Access Queries

A Brief Introduction to MySQL

1. INTRODUCTION TO RDBMS

Transcription:

Biography Sean Hedenskog Talking to Databases: SQL for Designers Sean Hedenskog Agent Instructor Macromedia Certified Master Instructor Macromedia Certified Developer ColdFusion / Dreamweaver Reside in Naperville, IL Since 1998 has successfully taught hundreds of classes for Allaire, Macromedia and their partners Ideas in motion. Overview Static Web Pages Static pages v. Dynamic pages What is SQL? Anatomy of a SQL statement Connecting to a database dialog box simple mode SQL in Code View Modifying an existing query dialog box advanced mode Static pages are processed like this: http://www.macromedia.com/software/index.htm http Web Web Browser Server <html> ColdFusion Dreamweaver Flash </html> Dynamic Web Pages Benefits of Building Dynamic Pages Dynamic pages are processed like this: http://www.macromedia.com/software/index.cfm Automatically reflect changes in data Content management by non technical business users Web Browser http Web Server Application Server Database Maintaining site is easier <html> ColdFusion Dreamweaver Flash </html> 1

Databases Explained What is SQL? Collection of data stored in some organized fashion Tables Column and Datatypes Rows Primary Keys For this session we will be using two tables Structured Query Language Standard language for getting information from and updating database data Some relational databases that use SQL are Oracle, Microsoft SQL Server, Access, Sybase, Informix and DB2 All contain the commands to Select, Insert, Update, Delete, Create and Drop SQL Code Example Anatomy of a SQL Statement SELECT {Field(s)} SELECT ProductName, Price, Description ORDER BY Price DESC FROM {Table(s)} WHERE {Join Condition and Filter(s)} ORDER BY {Field(s)} Basic SQL Code Examples SELECT * SELECT ProductID, ProductName, Price ORDER BY ProductName SELECT ProductName, Description WHERE ProductID = 2 Understanding Relational Tables Imagine you have a table containing product information Product name, product description, price and vendor information Multiple catalog items created by the same vendor Where would you store the information? 2

Understanding Relational Tables You wouldn t want to store that data along with the products Because vendor information is same for each product, you repeat the information and waste time and storage space If vendor changes you will have to update all the vendor information When data is repeated you increase the chances that the data will be entered differently Why Use Joins More efficient data storage, easier manipulation and greater scalability If data is stored in multiple tables how can you retrieve the data? The answer is to use a join. It associates tables within a SELECT statement. On the fly Joining 2 or More Tables Join Types Example Data If you are using more than one table you MUST join the tables If you forget you will return a cross join or Cartesian product Two options are available to join tables: Option 1 in the WHERE clause Option 2 in the FROM clause You have two tables Don t Forget to Join the Tables, Tables Joined in the WHERE Clause, WHERE.CategoryID =.CategoryID 95 records 16 records 3

Tables Joined in the FROM Clause You have three options: Option 1 INNER JOIN Returns all rows from both tables where there is a match. If there are rows in one table that do not have matches in the other, those rows will not be listed. Option 2 LEFT OUTER JOIN Returns all the rows from the first table, even if there are no matches in the second table. Option 3 RIGHT OUTER JOIN Returns all the rows from the second table, even if there are no matches in the first table. INNER JOIN INNER JOIN ON.CategoryID =.CategoryID 16 records LEFT OUTER JOIN LEFT OUTER JOIN ON.CategoryID =.CategoryID RIGHT OUTER JOIN RIGHT OUTER JOIN ON.CategoryID =.CategoryID 19 records 17 records Filtering Data Filtering Data The previous examples would retrieve all rows from the tables Retrieving just the data you want involves specifying a search criteria, also known as a filter Data is filtered by specifying the search criteria in the WHERE clause In addition, you can use AND, OR and NOT SELECT ProductName, Price WHERE Price < 500 SELECT ProductName, Price WHERE ProductName = ColdFusion MX Standard OR ProductName = Dreamweaver 8 4

Wildcard Filtering Review So Far Filtering against unknown values Use the LIKE operator, with wildcards % (percent sign) 0 or more characters _ (underscore) character Dynamic pages are good SQL will help create dynamic pages SQL is easy to learn and not so scary anymore SELECT ProductName, Price WHERE ProductName LIKE C% Resources SQL for Designers Teach Yourself SQL in 10 minutes by Ben Forta http://www.forta.com/books/0672325675/ SQL: Visual QuickStart Guide, 2 nd edition by Chris Fehily http://www.peachpit.com/title/0321334175 Best part Dreamweaver will generate the SQL code for you Could be easily accomplished for ASP, ColdFusion, JSP and PHP applications In this session, we will use ColdFusion Interactive Online SQL Training for Beginners http://sqlcourse.com/ Connecting to a Database Connecting to a Database To create a dynamic page we first need to connect to a database We connect to the database by creating a datasource Dreamweaver enables you to create connections On the Database tab in the Application panel, click the + (plus) button and select the type of database Datasource will then be available to us via the Databases panel in Dreamweaver 5

Connecting to a Database Connecting to a Database Microsoft Access Connection Dialog Once you have created the datasource you can view its contents in the Databases tab Creating a Introducing the Dialog Box To begin, click the plus sign on the Bindings tab and select (Query) Using the form fields construct your SQL statement Code View Modifying an Existing Query Dreamweaver automatically generates the SQL code To modify an existing query simply double click the in the Bindings tab <cfquery name= qget datasource= sa106w > SELECT ProductName, Price, Description ORDER BY ProductName ASC </cfquery> 6

Introducing the Dialog Box Advanced Summary This dialog allows for multi table queries Dynamic web pages are good SQL is the translation language between our applications and the database data SQL is easy to learn Dreamweaver generates SQL for ASP, ColdFusion, JSP and PHP applications Resources Macromedia Dreamweaver MX 2004 with ASP, ColdFusion, and PHP: Training from the Source by Jeff Bardzell http://www.peachpit.com/title/0321241576/ Macromedia Hands On Training Macromedia Dreamweaver MX 2004: Dynamic Application Development Fast Track to ColdFusion MX 7 http://www.macromedia.com/training/ Thank you. Ideas in motion. 7