Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
3Activity

Table Of Contents

SQL Queries
SQL Data Manipulation Language (DML)
SQL Data Definition Language (DDL)
SQL The SELECT Statement
The SELECT Statement
Syntax
"Persons" table LastName FirstName Address City
Result LastName FirstName
Select All Columns
Result LastName FirstName Address City
The Result Set
Semicolon after SQL Statements?
The SELECT DISTINCT Statement
Using the DISTINCT keyword
"Orders" table Company OrderNumber
Result Company
Result: Company
SQL The WHERE Clause
The WHERE Clause
Operator Description
Using the WHERE Clause
"Persons" table LastName FirstName Address City Year
Result LastName FirstName Address City Year
Using Quotes
The LIKE Condition
Using LIKE
The INSERT INTO Statement
Insert a New Row
Insert Data in Specified Columns
SQL The UPDATE Statement
The Update Statement
Person: LastName FirstName Address City
Update one Column in a Row
Result: LastName FirstName Address City
Update several Columns in a Row
The Delete Statement
Delete a Row
Delete All Rows
Test your SQL Skills
Try it Yourself
The ORDER BY keyword is used to sort the result
Sort the Rows
Company OrderNumber
Example
Result: Company OrderNumber
AND & OR
Original Table (used in the examples)
IN
Example 1
BETWEEN ... AND
With SQL, aliases can be used for column names and table names
Column Name Alias
Example: Using a Column Alias
Family Name
Example: Using a Table Alias
LastName FirstName
Joins and Keys
Orders: Prod_IDProduct Employee_ID
Referring to Two Tables
Result Name Product
Result Name
Using Joins
Example INNER JOIN
Example LEFT JOIN
Example RIGHT JOIN
UNION
Employees_Norway: Employee_ID E_Name
Using the UNION Command
UNION ALL
Using the UNION ALL Command
Create a Database
Create a Table
Data Type Description
Create Index
A Unique Index
A Simple Index
Drop Index
Delete a Table or Database
Truncate a Table
ALTER TABLE
Person: LastName FirstName Address
Result: LastName FirstName City
SQL has a lot of built-in functions for counting and calculations
Function Syntax
Types of Functions
Aggregate functions
"Persons" table (used in most examples)
Name Age
Aggregate functions in MS Access
Function Description
Scalar functions
Useful Scalar Functions in MS Access
Aggregate functions (like SUM) often need an added GROUP BY functionality
GROUP BY
GROUP BY Example
Company Amount
Company SUM(Amount)
The SELECT INTO Statement
Make a Backup Copy
A view is a virtual table based on the result-set of a SELECT statement
What is a View?
Using Views
SQL Quick Reference from W3Schools. Print it, and fold it in your pocket
0 of .
Results for:
No results containing your search query
P. 1
SQL Printout

SQL Printout

Ratings: (0)|Views: 41|Likes:
Published by asif4frnds

More info:

Published by: asif4frnds on Jan 04, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

02/16/2015

pdf

text

original

You're Reading a Free Preview
Pages 5 to 41 are not shown in this preview.

Activity (3)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->