1546
GB
What is the effect of DROP COLUMN on a table with indexes and foreign keys referencing that column?
IN
उस कॉलम को संदर्भित करने वाली अनुक्रमणिका और विदेशी कुंजियों वाली तालिका पर DROP COLUMN का क्या प्रभाव होता है?
A
It silently preserves all indexes with NULL values for the dropped column
यह गिराए गए कॉलम के लिए NULL मान वाले सभी इंडेक्स को चुपचाप संरक्षित करता है
B
It drops only the column data but keeps the indexes
यह केवल कॉलम डेटा छोड़ता है लेकिन इंडेक्स रखता है
C
Most DBMS automatically drop all indexes that include the dropped column and reject the operation if any foreign key references the dropped column (requiring you to drop the FK first) - or CASCADE can be used to drop dependent objects too
अधिकांश DBMS स्वचालित रूप से सभी इंडेक्स को हटा देते हैं जिसमें गिरा हुआ कॉलम शामिल होता है और यदि कोई विदेशी कुंजी गिराए गए कॉलम को संदर्भित करता है तो ऑपरेशन को अस्वीकार कर देता है (आपको पहले FK को छोड़ने की आवश्यकता होती है) - या CASCADE का उपयोग निर्भर वस्तुओं को छोड़ने के लिए भी किया जा सकता है
D
It converts the column to NULL before dropping
यह ड्रॉप करने से पहले कॉलम को NULL में बदल देता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
DROP COLUMN behavior: dependent indexes on that column are automatically dropped. FK constraints referencing the column as a foreign key (in other tables) are typically rejected - you must DROP the FK first or use DROP COLUMN CASCADE (PostgreSQL). CHECK constraints using the column are also dropped.
व्याख्या (हिन्दी)
ड्रॉप कॉलम व्यवहार: उस कॉलम पर निर्भर इंडेक्स स्वचालित रूप से हटा दिए जाते हैं। कॉलम को एक विदेशी कुंजी (अन्य तालिकाओं में) के रूप में संदर्भित करने वाली FK बाधाओं को आम तौर पर अस्वीकार कर दिया जाता है - आपको पहले FK को छोड़ना होगा या DROP COLUMN CASCADE (PostgreSQL) का उपयोग करना होगा। CHECK कॉलम का उपयोग करने वाली बाधाएं भी हटा दी गई हैं।