SQL
zoo.net
Add a constraint to a table.
SQLite
DB2
Ingres
Access
Postgres
Oracle
SQL Server
MySQL
Mimer
Sybase
Oracle
We can add a constraint
a foreign key reference
a UNIQUE requirement
a CHECK constraint
This is in the SQL standard
ALTER TABLE
Run the
tidy
code silently
Run
set up
code
ALTER TABLE a ADD CHECK (y>0)
Specific to Oracle
ALTER TABLE t DROP COLUMN c
Related links:
CREATE, DROP and ALTER
CREATE a new table
DROP an unwanted table
Composite primary key
CREATE a foreign key
CREATE a VIEW.
Create a table with an autonumber field (also known as sequence, identity)
ALTER TABLE ... ADD COLUMN
ALTER TABLE ... DROP COLUMN
ALTER TABLE ... ADD constraint
CREATE TABLE problems: Invalid column name.
CREATE TABLE problems: Insufficient privileges.
CREATE TABLE problems: Table already exists.
DROP TABLE problems: Foreign key references.
CREATE TABLE problems: Foreign key references.
rename column