Data Definition



next up previous
Next: Query-by-Example (QBE) Up: SQL Previous: Views

Data Definition

  1. The SQL DDL (Data Definition Language) allows specification of a set of relations and the following information for each relation:
  2. An SQL relation is defined by:

    where is the relation name, is the name of an attribute, and is the domain of that attribute.

  3. A newly loaded table is empty. The insert command can be used to load it.

  4. To remove a relation from the database, we can use the drop table command:

    This is not the same as

    which retains the relation, but deletes all tuples in it.

  5. The alter table command can be used to add attributes to an existing relation:

    where is the attribute and is the domain to be added. This command appears in some versions of SQL, but not in the SQL standard.



Page created and maintained by Osmar R. Zaï ane
Last Update: Mon Oct 16 16:41:58 PDT 1995