PrepAway - Latest Free Exam Questions & Answers

You need to create a table named MiscellaneousPayment t…

You need to create a table named MiscellaneousPayment that meets the following requirements:

Which Transact-SQL statement should you run?

PrepAway - Latest Free Exam Questions & Answers

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

8 Comments on “You need to create a table named MiscellaneousPayment t…

  1. wellgo says:

    D is correct
    INSERT INTO EnglishStudents1 VALUES (default,’Shane’)
    INSERT INTO EnglishStudents1 VALUES (default,’Jonny’)

    go

    select * from EnglishStudents1

    result

    Id StudentName
    ———————————— ————————————-
    ED8F436A-5E86-41C9-AF16-716DF4DB2D17 Jonny
    20BA5F8C-4BC8-4CB1-8709-9EB4EDD26005 Shane




    0



    0

Leave a Reply