Disclaimer

Introduction to SQL

CS 284 (CSA), Spring 2005

Table of contents

Standards and DBMSs

Types and values

SQL Statements

All SQL statements are terminated with a semicolon ;. Two dashes -- introduce a comment; /* ... */ comments are also available.

We will consider a database implementation of a simplified telephone-address book as a running example, e.g., perhaps representing the address by only a state field.

Names of commands, fields, types, etc., are all case insensitive. We will use all caps for SQL keywords (e.g., parts of commands) and use all lower case for (user-selected) names of tables, fields, etc. Of course, the case of characters appearing within strings is preserved, e.g., 'Hello'.

All information is for Postgres; see the Postgres reference manual for actual specifications and more information.

CREATE TABLE

INSERT

Introduction to SELECT

UPDATE

DELETE

DROP

File interface





rab@stolaf.edu, October 09, 2006