QA

Team-Fly    

 
Sams Teach Yourself SQL in 24 Hours, Third Edition
By Ronald R. Plew, Ryan K. Stephens
Table of Contents
Hour  3.  Managing Database Objects


Q&A

Q1:

When I name a table that I am creating, is it necessary to use a suffix such as _TBL ?

A1:

Absolutely not. You do not have to use anything. For example, a table to hold employee information could be named similar to the following, or anything else that would refer to what type of data is to be stored in that particular table:

 EMPLOYEE  EMP_TBL EMPLOYEE_TBL EMPLOYEE_TABLE WORKER 
Q2:

Why is it so important to use the schema name when dropping a table?

A2:

Here's a true story about a new DBA that dropped a table: A programmer had created a table under his schema with the same name as a production table. That particular programmer left the company. The programmer's database account was being deleted from the database, but the DROP USER statement returned an error due to the fact that outstanding objects were owned by the programmer. After some investigation it was determined that the programmer's table was not needed, so a DROP TABLE statement was issued.

It worked like a charmbut the problem was that the DBA was logged in as the production schema when the DROP TABLE statement was issued. The DBA should have specified a schema name, or owner, for the table to be dropped. Yes, the wrong table in the wrong schema was dropped. It took approximately eight hours to restore the production database.


Team-Fly    
Top
 


Sams Teach Yourself SQL in 24 Hours
Sams Teach Yourself SQL in 24 Hours (5th Edition) (Sams Teach Yourself -- Hours)
ISBN: 0672335417
EAN: 2147483647
Year: 2002
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net