-
Command to create a relation
- create table [table_name] (
- [attr_name] [data_type], ...,
- primary key ([attribute_name], ...)
- foreign key ([attribute_name], ...) references
- [other_table]([attributes from other table])
- on [foreign_key_condition] [action] %Can repeat%
- );
-
One delete/update actions
- Cascade
- Set null
- Restrict (no action)
-
Command to insert a tuple (known order of attributes)
insert into [table_name] values ([value_name], ...)
-
Command to insert a tuple (user specified values)
insert into [table_name]([attribute_name], ...) values ([attribute_name], ...)
-
Command to delete all tuples from a table
delete from [table_name]
-
Command to delete specific tuples from a table
- delete from [table_name] where [selection_predicate]
- Update is the same, just replace 'delete' with 'update'
-
command to retrieve all information from a table
select * from [table_name]
-
Retrieve specific values from a table
select [value_name], .... from [table_name];
-
Retrieve data from multiple tables
- select [attribute], ...
- from [table], ...
- where [join_conditions], ... and [selection_conditions], ...
|
|