Consider the following statement:
ALTER VIEW v_city AS SELECT Name FROM City WHERE CountryCode
Which of the following statements are equivalent to the above example?
A.
mysql> DROP VIEW v_city;
mysql> CREATE VIEW v_city AS
-> SELECT Name FROM City WHERE CountryCode = ‘FIN’;
B.
mysql> CHANGE VIEW v_city AS
-> SELECT Name FROM City WHERE CountryCode = ‘FIN’;
C.
mysql> DROP VIEW v_city;
mysql> ALTER VIEW v_city AS
-> SELECT Name FROM City WHERE CountryCode = ‘FIN’;
D.
mysql> DROP VIEW IF EXISTS v_city;
mysql> CREATE VIEW v_city AS
-> SELECT Name FROM City WHERE CountryCode = ‘FIN’;
Explanation:
Alter discards the current fdefinition for the view and replaces it with the new definition – like DROP and reCREATE.
— b(FIN1)X, c(Can’t alter if dropped)X, d(IF EXISTS – not an option within alter).