RelationalDBDesign RelationalDBDesign


DB Creation   «Prev  Next»
Lesson 10 The DESCRIBE Command
Objective Server Manager's DESCRIBE command to show structure

Oracle DESCRIBE Column

Viewing a list of columns

Use Server Manager's DESCRIBE command to show the structure of a table.
A very useful Server Manager command is the DESCRIBE command.
DESCRIBE is usually used to view a list of columns in a database table or view.
A datatype describes data, it does not store data. You cannot store data in a NUMBER datatype, and you cannot store data in a dataype that you define.
To store data, you have to create a table that uses your datatype.
The following command creates a table named CUSTOMER . A customer has a Customer_ID and all the attributes of a person (via the PERSON_TY datatype).

create table CUSTOMER
(Customer_ID NUMBER,
Person  PERSON_TY);

What happens if you describe the CUSTOMER table?
The output will show the following column definitions:
Name  Null? Type
-------------- ------ -----------
CUSTOMER_ID  NUMBER
PERSON   PERSON_TY

DESCRIBE command

The describe command shows that the Person column of the CUSTOMER table has been defined using the PERSON_TY datatype. You can further explore the data dictionary to see the construction of the PERSON_TY datatype. The columns of an abstract datatype are referred to as its attributes. Within the data dictionary, the USER_TYPE_ATTRS view displays information about the attributes of a user's abstract datatypes.
Go ahead and try these these commands by clicking the link below.
Ora Describe Command