SELECT स्टेटमेंट का उपयोग करके टेबल नाम प्राप्त करने के लिए, "information_schema.tables" का उपयोग करें। आइए एक उदाहरण देखते हैं, जिसमें हमारे पास एक डेटाबेस है जिसमें 3 टेबल हैं। SELECT स्टेटमेंट की मदद से सभी टेबल नाम प्राप्त करने का सिंटैक्स।
SELECT Table_name as TablesName FROM information_schema.tables WHERE table_schema = 'yourDatabaseName';
डेटाबेस "test" का उपयोग करना, और SELECT का उपयोग करके टेबल नाम प्राप्त करने के लिए उपरोक्त सिंटैक्स लागू करना।
mysql> use test; Database changed mysql> SELECT Table_name as TablesName FROM information_schema.tables WHERE table_schema = 'test';
तीन टेबल्स के नाम के साथ आउटपुट।
+--------------------+ | TablesName | +--------------------+ | destination | | myisamtoinnodbdemo | | originaltable | +--------------------+ 3 rows in set (0.00 sec)