← Back to MySQL Course | Chapter 19: Advanced & Reference | Lesson 1 of 5

SHOW TABLES और DESCRIBE

SHOW TABLES cabinet में सब कुछ list करता है, और DESCRIBE एक table खोलकर उसके column names और हर एक क्या रखता है दिखाता है।
Syntax
sql
SHOW TABLES;
DESCRIBE table_name;

सभी Tables दिखाना

SHOW TABLES currently selected database में exist करने वाली हर table list करता है, जो आमतौर पर पहला command है जो आप किसी unfamiliar schema के अंदर orient होते समय चलाते हैं।

उदाहरण: Showing All Tables

sql
SHOW TABLES;

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

DESCRIBE से Table Metadata पाना

DESCRIBE एक नज़र में किसी table का structure reveal करता है — इसके column names, उनके data types, और हर column NULL रख सकता है या नहीं — बिना original CREATE TABLE statement खोलने की ज़रूरत के।

उदाहरण: Getting Table Metadata with DESCRIBE

sql
CREATE TABLE users (id INT, email TEXT, active BOOLEAN);
DESCRIBE users;

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

Table Status दिखाना

SHOW TABLE STATUS किसी table के operational details surface करता है, इसका storage engine, इसमें कितनी rows हैं, और यह कब बना, जो performance या storage questions diagnose करने के लिए उपयोगी है।

उदाहरण: Showing Table Status

sql
SHOW TABLE STATUS LIKE 'users';

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

CREATE TABLE Statement दिखाना

MySQL से exact CREATE TABLE statement दिखाने को कहना जो किसी table को बनाने के लिए इस्तेमाल हुआ था किसी दूसरे server पर same structure recreate करने का सबसे तेज़ तरीका है बिना इसे column by column manually reverse-engineer किए।

उदाहरण: Showing the CREATE TABLE Statement

sql
CREATE TABLE users (id INT, email TEXT);
SHOW CREATE TABLE users;

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

Columns और Indexes दिखाना

किसी table के columns और indexes को साथ inspect करना confirm करने में मदद करता है कि आप actually जो queries चलाते हैं उन्हें तेज़ करने के लिए सही keys मौजूद हैं, बिना check किए indexing सही मानने के बजाय।

उदाहरण: Showing Columns and Indexes

sql
CREATE TABLE users (id INT, email TEXT);
CREATE INDEX idx_email ON users (email);
SHOW COLUMNS FROM users;
SHOW INDEX FROM users;

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. बिना कोई database select किए SHOW TABLES चलाना, जो No database selected देता है।
  2. DESCRIBE (column details) को SHOW TABLE STATUS (engine, rows, size) से confuse करना।
  3. guessed structure पर SHOW CREATE TABLE के बजाय भरोसा करना, जो keys और defaults दिखाता है।
🔒

Chapter Quiz — Complete all 5 topics to unlock

0/5 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.