Which of the following statements displays the correct syntax for creating a use
ID: 3576135 • Letter: W
Question
Which of the following statements displays the correct syntax for creating a user-defined table type? CREATE TYPE OrderDetails AS TABLE (OrderID INT NOT NULL, ItemDescription VARCHAR(100) NOT NULL, Quantity INT NOT NULL, UnitCost Money NOT NULL, PRIMARY KEY (OrderID)) CREATE TABLE OrderDetails AS TYPE (OrderID INT NOT NULL, ItemDescription VARCHAR(100) NOT NULL, Quantity INT NOT NULL, UnitCost Money NOT NULL, PRIMARY KEY (OrderID)) CREATE TABLE TYPE OrderDetails AS (OrderID INT NOT NULL, ItemDescription VARCHAR(100) NOT NULL, Quantity INT NOT NULL, UnitCost Money NOT NULL, PRIMARY KEY (OrderID)) CREATE TYPE OrderDetails AS CREATE TABLE (OrderID INT NOT NULL, ItemDescription VARCHAR(100) NOT NULL, Quantity INT NOT NULL, UnitCost Money NOT NULL, PRIMARY KEY (OrderID))Explanation / Answer
Answer: A
To create a user-defined table type, use the CREATE TYPE statement. To ensure that the data in a user-defined table type meets specific requirements, you can create unique constraints and primary keys on the user-defined table type.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.