DESCRIBE
Example
Section titled “Example”DESCRIBE Users;Output
Section titled “Output”+--------------+--------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+--------------+--------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto_increment || username | varchar(100) | YES | | NULL | || email | varchar(100) | YES | | NULL | || password | varchar(100) | YES | | NULL | |+--------------+--------------+------+-----+---------+----------------+Explanation
Section titled “Explanation”The DESCRIBE statement in MySQL provides a summary of the metadata associated with a specified database table. Here, it describes the structure of the ‘Users’ table including details about each field or column such as name, data type, whether the field can accept null values, the key type, the default value, and any extra information.
Example
Section titled “Example”DESCRIBE employees;Output
Section titled “Output” Name Null? Type ------------------------ -------- ---------------- EMPLOYEE_ID NOT NULL NUMBER(6) FIRST_NAME VARCHAR2(20) LAST_NAME NOT NULL VARCHAR2(25) EMAIL NOT NULL VARCHAR2(25) PHONE_NUMBER VARCHAR2(20) HIRE_DATE NOT NULL DATE JOB_ID NOT NULL VARCHAR2(10) SALARY NUMBER(8,2) COMMISSION_PCT NUMBER(2,2) MANAGER_ID NUMBER(6) DEPARTMENT_ID NUMBER(4)Explanation
Section titled “Explanation”The DESCRIBE command in the Oracle SQL displays the structure of a table including columns’ names, their type, and whether they can be null or not. In this example, the DESCRIBE employees; command provides the details of the employees table structure.