If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
table create होने के बाद अगर आप चाहे तो किसी table को rename भी कर सकते हैं। इसके लिए RENAME
command का ही use किया जाता है , और एक साथ कई tables का name भी rename कर सकते हैं।
सबसे पहले देख लेते हैं की हमारे database में tables किस name से हैं -
SHOW TABLES;
Output
+---------------------+ | Tables_in_tutorials | +---------------------+ | customers | +---------------------+ 1 row in set (0.001 sec)
table को rename करने का syntax कुछ प्रकार है -
RENAME TABLE old_table_name1 TO new_table_name1, old_table_name2 TO new_table_name2 . .
हम customers table को users
नाम से rename करेंगे , ऐसा करने के लिए कुछ इस तरह से command को run किया है -
RENAME TABLE customers TO users;
अगर query का output कुछ इस तरह से है , तो table rename हो चुकी है -
Query OK, 0 rows affected (0.058 sec)
अब अगर आप फिर से tables की listing देखेंगे तो table का name change हुए मिलेंगे।
SHOW TABLES;
Output
+---------------------+ | Tables_in_tutorials | +---------------------+ | users | +---------------------+ 1 row in set (0.001 sec)
हालाँकि अगर आप चाहें तो, एकसाथ कई tables के name को rename कर सकते हैं -
RENAME TABLE old_table_name1 TO new_table_name1, old_table_name2 TO new_table_name2;
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook