• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Understanding SQL Grammar

When you learn the grammar of a new language, it's helpful to categorize the vocabulary of the language by usage and then into the familiar parts of speech. SQL commands, therefore, first are divided into six usage categories:

  • Data Query Language (DQL) consists of commands that obtain data from tables and determines how the results of the retrieval are presented. The SELECT command is the principal instruction in this category.

  • Data Manipulation Language (DML) provides INSERT and DELETE commands, which add or delete entire rows, and the UPDATE command, which changes the values of data in specified columns within rows.

  • Transaction Processing Language (TPL) includes BEGIN TRANS[ACTION], COMMIT [TRANSACTION|WORK], and ROLLBACK [TRANSACTION|WORK], which group multiple DML operations. If one DML operation of a transaction fails, the preceding DML operations are canceled (rolled back). Jet 4.0 SQL implements BEGIN TRANSACTION, COMMIT TRANSACTION, and ROLLBACK TRANSACTION.

  • Data Definition Language (DDL) includes CREATE TABLE and CREATE VIEW instructions that define the structure of tables and views. DDL commands are used also to modify tables and to create and delete indexes. The keywords that implement data integrity are used with DDL statements. Jet SQL supports the CREATE TABLE, CREATE INDEX instructions.

  • Cursor Control Language (CCL) can select a single row of a query result set for processing. Cursor control constructs, such as UPDATE WHERE CURRENT, are handled by ADO's cursor engine or the Jet database engine, so these commands aren't discussed in this chapter.

  • Data Control Language (DCL) performs administrative functions that grant and revoke privileges to use the database, such as GRANT and REVOKE, a set of tables within the database, or specific SQL commands.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint