คำสั่ง DESCRIBE แสดงโครงสร้างตาราง MySQL
ตัวอย่าง
สร้างตาราง Employee:
mysql> Create table Employee(ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(20)); Query OK, 0 rows affected (0.20 sec)
ใช้ DESCRIBE Employee:
mysql> Describe Employee; +-------+-------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+------------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | Name | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+------------------+ 2 rows in set (0.11 sec)
ข้อมูลที่แสดง: ชื่อคอลัมน์ (Field), ชนิดข้อมูล (Type), รองรับ NULL หรือไม่ (Null), Constraint Key (Key), ค่า Default (Default), ข้อมูลเพิ่มเติม เช่น auto_increment (Extra)