Table of Contents
1 SQL Data Definition and Data Types
1.1 Schema and Catalog
1.2 CREATE TABLE Command
1.3 Data Types
2 Specifying Constraints in SQL
2.1 Attribute Constraints
2.2 Key and Referential Integrity Constraints
2.3 Naming Constraints
2.4 Using CHECK
3 Basic Retrieval Queries in SQL
3.1 SELECT FROM WHERE
3.2 Qualifying Attribute Names
3.3 Querying without WHERE Clause and Using the Asterisk
3.4
Duplicate Tuples and Distinct Tuples
3.5
LIKE Operator, Arithmetic Operators, BETWEEN...AND Operator
3.5 Ordering-Query-Results
4 INSERT, DELETE, and UPDATE Statements
4.1 INSERT
4.2 DELETE
4.3 UPDATE
The SQL language is a standard for relational databases:
- since database systems share a standard language, migrating a database application to another relational database is a quick and inexpensive process
- database application programs can access data stored in multiple relational DBMSs using the same database language
The practical SQL vs the relational algebra
- the SQL language is a high level declarative language for the relational model: with a query in the SQL language, the user must only indicate how the result is to be and the DBMS decides how to execute the query
- the relational algebra is a formal language for the relational model: with a query in the relational algebra, the user must specify a sequence of low-level operations. Relational algebra operations are not suitable for most DBMS users
The SQL name stands for Structured Query Language
- the SQL language is a standard by the American National Standards Institute (ANSI) and the International Standards Organization (ISO)
- on the wikipedia page about SQL, you can find out the history of the versions of the SQL standard