Open In App
Related Articles

SQL | DESCRIBE Statement

Improve Article
Save Article
Like Article

Prerequisite: SQL Create Clause

As the name suggests, DESCRIBE is used to describe something. Since in a database, we have tables, that’s why do we use DESCRIBE or DESC(both are the same) commands to describe the structure of a table.




DESC one;

Note: We can use either DESCRIBE or DESC(both are Case Insensitive). Suppose our table whose name is one has 4 columns named id, name, email, and age and all are of can contain null values. 


  name VARCHAR(50),
  email VARCHAR(100),
  age INT

DESC users;



Here, above on using DESC or either DESCRIBE we are able to see the structure of a table but not on the console tab, the structure of the table is shown in the describe tab of the Database System Software.

So desc or describe command shows the structure of the table which include the name of the column, the data type of the column and the nullability which means, that column can contain null values or not.

All of these features of the table are described at the time of Creation of the table.

Creating a Table or Defining the Structure of a Table


create table one
id int not null, 
name char(25)

Here, we created a table whose name is one and its columns are ID, NAME and the id is of not null type i.e., we can’t put null values in the ID column but we can put null values in the NAME column. 

Demonstrate DESC 

Step 1: Defining the structure of the table.

Creating a table:

create table one
 id int not null,
 name char(25),
 city varchar2(25)

Step 2: Displaying the structure of the table:


DESC one




Note: Here above ID column is of not null type and rest 2 columns can contain null values. Note: You have to execute the DESC command on your system software only, because this command won’t run on any editor. Make sure to run this command on your own installed Database only References: 

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.

Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation course.

Last Updated : 10 May, 2023
Like Article
Save Article
Similar Reads