Describe statement show columns within a table and tables within a database.
The Describe statement is recommended to use before creating a new table to avoid duplicate tables.
Below is the basic syntax for describing tables within a database:
Below is the basic syntax for describing columns within a table:
table_name is the name of the table that you want to show.
To get a better understanding of a DESCRIBE statement, take a look at some examples below:
Case #1: Describe Database
1) In this example, we will figure out the columns of a part table. Run the query below:
2) As a result, you will get a list of column names, column types, and nullable options from the part table.
The example above shows that the tables reside in the public schema, the default schema in Oxla. You can also have a table from other schemas - click here for more info.
Case #2: Describe Table
1) Execute the following query to describe the database:
2) You will retrieve a list of the existing tables in the database as shown below: