DESCRIBE
You may infer from its namesake that DESCRIBE
will be used to "describe" a table. But-- what does the term "describe a table" really mean?
Tables often contain data of different types
. The DESCRIBE
statement shows a column's name, type, and whether there are null
values or not. The syntax is as follows:
TEXT/X-SQL
1DESCRIBE TableName;
Another way to accomplish this is:
TEXT/X-SQL
1DESC TableName;
Let's try to describe
the table Class
from before.
TEXT/X-SQL
1DESC Class;
The above line of code will generate the following output:
TEXT/X-SQL
1StudentID int(11) YES NULL
2StudentName varchar(255) YES NULL
3CoursesEnrolled varchar(255) YES NULL
4Attendance int(11) YES NULL