You need to create a table named MiscellaneousPayment that meets the following requirements:
Which Transact-SQL statement should you run?
A.
CREATE TABLE MiscellaneousPayment (Id uniqueidentifier DEFAULT NEWSEQUENTIALID() PRIMARY
KEY,Reason varchar(500),Amount money)
B.
CREATE TABLE MiscellaneousPayment (Id intidentify(1,1)PRIMARY KEY,Reason nvarchar(500),Amount
numeric(19,4))
C.
CREATE TABLE MiscellaneousPayment (Id uniqueidentifier DEFAULT NEWSEQUENTIALID() PRIMARY
KEY,Reason varchar(500),Amount decimal(19,4))
D.
CREATE TABLE MiscellaneousPayment (Id uniqueidentifier DEFAULT NEWID() PRIMARY KEY,Reason
nvarchar(500),Amount decimal(19,4))
Explanation:
Incorrect Answers:
A: For column Reason we must use nvarchar, not varchar, as multilingual values must be supported.
B: We cannot use INT for the Id column as new values must be automatically generated.
C: For column Reason we must use nvarchar, not varchar, as multilingual values must be supported.
Note: Nvarchar stores UNICODE data. If you have requirements to store UNICODE or multilingual data,
nvarchar is the choice. Varchar stores ASCII data and should be your data type of choice for normal use.
https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql
wrong should be CREATE TABLE MiscellaneousPayment (Id int identify(1,1)PRIMARY KEY ,Reason nvarchar(500), Amount numeric(19,4))
B is the correct answer. INT can be used to auto generate values.
B is correct as well as D. But only D meets the requirement for “globally unique”.
D is correct
D