DROP TABLE problems: Foreign key references.

From SQLZOO
Revision as of 09:43, 17 July 2012 by Marek (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

DROP TABLE problems: Foreign key references.

schema:scott

You may not drop a table if it is referenced by another table.

DROP TABLE t_b;
DROP TABLE t_a
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
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense