要删除 Student 表的 Birthyear 列,同时删除所有引用该列的视图

考试题库2022-08-02  40

问题 要删除 Student 表的 Birthyear 列,同时删除所有引用该列的视图和约束。下列哪一个 SQL 语句正确表达了这一删除要求( )。A.ALTER TABLE Student DROP Birthyear RESTRICTB.ALTER TABLE Student DELETE Birthyear CASCADE.C.ALTER TABLE Student DROP Birthyear CASCADE.D.ALTER TABLE Student DELETE Birthyear RESTRICT

选项 A.ALTER TABLE Student DROP Birthyear RESTRICT
B.ALTER TABLE Student DELETE Birthyear CASCADE.C.ALTER TABLE Student DROP Birthyear CASCADE.D.ALTER TABLE Student DELETE Birthyear RESTRICT

答案 C

解析 要删除 Student 表的 Birthyear 列,同时删除所有引用该列的视图和约束,SQL 语句是 ALTER TABLE Student DROP Birthyear CASCADE;。CASCADE 表示相关视图和约束一并被删除。
转载请注明原文地址:https://tihaiku.com/gongwuyuan/2556417.html

最新回复(0)