Oracle: DESCRIBE Command

DESCRIBE or DESC in Oracle helps to describe the structure of the table in a database. The description contains the column name, Datatype belong to that column, along its size. Also, It tells about the Nullibity of the Column, which is mentioned at the time of the creation of the table.

Syntax:

DESCRIBE Table_name;

 Table_name stands for the name of the Table.

Example - 1:

Refer to the Stu table from the previous contents:

DESCRIBE Stu;

Output:

describe

Example - 2:

Now, If we declare Roll_No Column as a Primary Key (Does not contain Null values) In the above Stu Table:

CREATE TABLE emp(Name Varchar(20),
Section Varchar(10),
Roll_No number(20),
Subject Varchar(20),
Primary Key(Roll_No));

Output

desc