Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What Happens to Indexes If You Drop a Table
What Happens to Indexes If You Drop a Table? - Oracle DBA FAQ - Managing Oracle Table Indexes
✍: FYIcenter.com
If you drop a table, what happens to its indexes? The answer is that if a table is dropped, all its indexes will be dropped too. Try the following script to see yourself:
CREATE TABLE student (id NUMBER(5) PRIMARY KEY, first_name VARCHAR(80) NOT NULL, last_name VARCHAR(80) NOT NULL, birth_date DATE NOT NULL, social_number VARCHAR(80) UNIQUE NOT NULL); Table created. CREATE INDEX student_birth_date ON student(birth_date); Index created. SELECT index_name, table_name, uniqueness FROM USER_INDEXES WHERE table_name = 'STUDENT'; INDEX_NAME TABLE_NAME UNIQUENES ----------------------- --------------------- --------- SYS_C004141 STUDENT UNIQUE SYS_C004142 STUDENT UNIQUE STUDENT_BIRTH_DATE STUDENT NONUNIQUE DROP TABLE STUDENT; Table dropped. SELECT index_name, table_name, uniqueness FROM USER_INDEXES WHERE table_name = 'STUDENT'; no data found
No records in USER_INDEXES view found for your name STUDENT, after you dropped STUDENT table.
2007-05-02, 6696👍, 0💬
Popular Posts:
How To Select an Oracle System ID (SID)? - Oracle DBA FAQ - Creating New Database Instance Manually ...
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
.NET INTERVIEW QUESTIONS - What is COM ? Microsoft’s COM is a technology for component software deve...
How To Delete All Rows a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statement...