Home » Microsoft » 70-461 v.2 » Which three Transact-SQL segments should you use to develop the solution?
DRAG DROP
You use a Microsoft Azure SQL Database instance named ContosoDb. ContosoDb contains a table named Products that has existing records.
The Products table has columns named Code and QuantityOnHand.
You need to create a new column in the Products table named Category that allows null values and sets the value of the Category column to General for all existing records.
Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.
Select and Place:
Correct Answer:
Explanation/Reference:
Explanation:
NULL or NOT NULL specifies whether the column can accept null values. Columns that do not allow null values can be added with ALTER TABLE only if they have a default specified or if the table is empty. NOT NULL can be specified for computed columns only if PERSISTED is also specified. If the new column allows null values and no default is specified, the new column contains a null value for each row in the table. If the new column allows null values and a default definition is added with the new column, WITH VALUES can be used to store the default value in the new column for each existing row in the table.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql