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.
अभी तक आपने View को create और use करना सीखा , इस topic में सीखेंगे कि view को drop / delete कैसे करते हैं।
Well , MySQL में किसी existing view को drop करने के लिए DROP VIEW
statement का use किया जाता है। जिसका syntax कुछ इस तरह से होता है।
DROP VIEW view_name;
DROP VIEW के बाद आपको बस view का नाम देना है जिसे आप drop करना चाहते हैं।
हालाँकि आप एक साथ comma separated कई views का name भी दे सकते हैं हैं , जैसे -
DROP VIEW view1, view2, view3;
view drop करने से पहले अच्छा होगा कि आप check कर लें कि exist
है या नहीं , otherwise error आएगी। drop करते समय check करने के लिए आप IF EXISTS
का use कर सकते हैं।
DROP VIEW IF EXISTS myview;
or
DROP VIEW IF EXISTS myview1, myview2, myview3;
SHOW FULL TABLES
statement का use करके आप किसी database के अंदर मौजूद सभी views को देख सकते हैं।
SHOW FULL TABLES WHERE Table_type="View";
+---------------------+------------+ | Tables_in_tutorials | Table_type | +---------------------+------------+ | userorders | VIEW | +---------------------+------------+
पिछले topic में हमें userorders
name का view बनाया था , और उसे drop करने का example देखेंगे -
DROP VIEW IF EXISTS userorders;
Query OK, 0 rows affected (0.078 sec)
Query OK है, मतलब view drop हो चुका है।
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