Access The L Line The Express Line to Learning 2007 L Line L © Wiley Publishing All Rights Reserved.
SQL: The Structured Query Language 13 * Introducing Structured Query Language * Discovering Access data types * Learning SQL's sub-languages * Operating on databases with SQL Stations Along the Way
Introducing Structured Query Language Uses the acronym SQL (pronounced ess-que-ell) Is supported (to some degree) by all modern relational databases Contains three sub-languages Interfaces directly with Access table data Can connect to external data sources
SQL as an Action Language Syntax: Specifies the order and spelling of words in SQL statements Semantics: Imparts meaning Commands: Demand action from a database Keywords: Specify the action in a command
Data Types for SQL Statements In Access, column data types tell you… …the type of data in a column and …what you can do with it Define column data types for the data’s intended use
SQL Syntax Definitions Symbol / ConventionWhat It Does ALL CAPSIdentifies a keyword lowercaseIdentifies table and field names [ ] (square brackets)Enclose optional keywords... (ellipsis)Signifies continuation,... (comma + ellipsis)Marks multiple entries of one type { } (curly brackets)Contain alternative required options
SQL Sub-Languages Sub-LanguageCommon Keywords Data Definition Language (DDL) ALTER CREATE DROP Data Manipulation Language (DML) DELETE INSERT SELECT SELECT...INTO TRANSFORM UPDATE Data Control Language (DCL)GRANT REVOKE
Data Definition Language Defines the database landscape Creates database objects with CREATE: Tables Views Indexes Deletes database objects with DROP Modifies table structure with ALTER
Data Manipulation Language Manipulates data in a database Writes data to a table or tables with INSERT Pulls data from a database with SELECT Makes a new table from one or more tables with SELECT... INTO Change or correct table data with UPDATE Remove table data (not objects) with DELETE
Data Control Language Supports user-level security for pre-2007 Access databases Bestows user privileges with GRANT Removes user privileges with REVOKE
Discussion Topics What is Structured Query Language? Is SQL really a language? Why does SQL have sub-languages?