April 2002
Intermediate to advanced
416 pages
11h 50m
English
The DROP TABLE statement removes a table and all its contents from the database. After you remove a table, the data it contains is gone forever; therefore, you should be careful with this command.
The database will not let you drop a table that is the master table in a relational constraint. For instance, consider the following SQL script. In this example, the EmployeeId field in the Departments table refers to the EmployeeId field in the Employees table. The database will not let you drop the Employees table even if there are no records in either table:
CREATE TABLE Employees ( EmployeeId NUMERIC UNIQUE NOT NULL ); CREATE TABLE Departments ( DepartmentId NUMERIC NOT NULL, EmployeeId NUMERIC REFERENCES Employees(EmployeeId) ); DROP ...
Read now
Unlock full access