Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain to me how to describe a table in SQL?

1 Answer

0 votes
by (119k points)
edited by

We can use Describe or desc command to describe the table in SQL. Here is the syntax to use describe command in SQL:

DESCRIBE table_name

or

DESC table_name

Here is how you can use describe statement in SQL:

Step1: Create a table using the following create statement:

CREATE TABLE Employee (

E_Id     int not null,

E_Name char (25),

Location varchar2 (25)

)

Step2: Use the following statement to display the structure of the table:

DESCRIBE Employee

Or

DESC Employee

The following would be the output:

Name        NULL                TYPE

E_ID         Not Null            INT

E_Name                          CHAR (25)

CITY                               VARCHAR2 (25)

You can enroll in this Microsoft SQL Server Certification program by Intellipaat to learn writing SQL queries.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Apr 19, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...