MySQL + SQL · Lesson 37

ALTER TABLE और DROP Commands

ALTER — Structure बदलें

ALTER TABLE students ADD email VARCHAR(60);     -- column जोड़ें
ALTER TABLE students MODIFY name VARCHAR(80);   -- type बदलें
ALTER TABLE students DROP COLUMN email;         -- column हटाएं
ALTER TABLE students RENAME TO learners;        -- table rename

DROP — Object हटाएं

DROP TABLE students;       -- पूरी table delete
DROP DATABASE school;      -- पूरा database delete
DROP structure और सारा data स्थायी रूप से हटा देता है। सावधान रहें!

सारांश

  • ALTER table का structure बदलता है (add/modify/drop column, rename)।
  • DROP पूरी table या database स्थायी रूप से delete करता है।
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।