SQL
zoo.net
DROP TABLE problems: Foreign key references.
SQLite
DB2
Access
Postgres
Oracle
SQL Server
MySQL
Mimer
Sybase
You may not drop a table if it is referenced by another table.
Execute tidy up
code
silently
DROP TABLE t_b; DROP TABLE t_a
Execute set up
code
CREATE TABLE t_a (i INTEGER NOT NULL PRIMARY KEY); CREATE TABLE t_b (j INTEGER, FOREIGN KEY(j) REFERENCES t_a(i));
DROP TABLE t_a
Specific to
none
Related links:
CREATE, DROP and ALTER
CREATE a new table
DROP an unwanted table
Composite primary key
Composite 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