![]() ![]() Note that the YES in NULL column says that the value for that specific column of table can be NULL and NO denotes we cannot place or insert NULL values. The data type values with its length and NULL attribute with YES/NO values for its presence and PRIMARY key are also provided in the structure of the table. Now, let us apply simply the DESCRIBE TABLE query written as below:Īs you can see in the output above that the column names of the table Books with Type, NULL attribute, Key, Default values and even Extra attribute are described by the DESCRIBE TABLE statement. The contents of the table can be shown as below: We have a table named Books in our database with fields as BookID, BookName, Language, Price and each having different data type defined at the time of table creation. Suppose, we have taken a table as demo to use the DESCRIBE. Simple Example using DESCRIBE TABLE command. Given below are the examples of SQL DESCRIBE TABLE: Example #1 Thus, the SQL DESCRIBE TABLE is beneficial for fetching out details about the current table present in the database.The SQL DESCRIBE TABLE query will make us to know about the organization of table that consists of name of table column with data type values such as VARCHAR, CHAR, INT, FLOAT, TIME, DATE, NUMBER or any XML type, used for the respective fields in the table, also it displays column having NULL or NOT NULL database objects that says if the column do include null values or not.When we execute DESCRIBE TABLE command in our database we will be able to view the structure of the table in a describe tab but not on the console tab of the system software.Therefore, using DESCRIBE TABLE in SQL it will tell you either about the columns present in that specific table or its current values type and also the default values for a table’s stage properties. ![]() These both statements when executed will provide information about all table columns. DESCRIBE can be said as a synonym for the command EXPLAIN TABLE.Also, it should be remembered that the query with criteria TYPE = STAGE cannot be applied for views as views do not contain stage properties.But by default the server uses TYPE = COLUMNS, if the TYPE keyword not provided in the query.The TYPE = (STAGE | COLUMNS) term defines whether to show the table columns or the stage properties which comprises of their default and current values for the table.We can enclose the whole string using double quotes which are case-sensitive when the identifier includes spaces or special characters. We can also monitor another syntax type in advance level as follows: TABLE defines an identifier for the particular table mentioned to describe it. ViewName also denotes the name of the view created for the table and we wish to describe the view structure.The TableName denotes the name of the table in the database for which we want to see the structure.
0 Comments
Leave a Reply. |