Question 1
Correct
Mark 1.00 out of 1.00
Which of the following includes a set of commands used to control access to the data within the database, including security?
Select one:
a. DML
b. DAL
c. DCL
d. DDL
Your answer is correct.
The correct answer is: DCL
Create Table SALE(
SaleID integer,
SaleDate date,
Tax decimal,
Total decimal
);
Create Table ITEM(
ItemID integer,
Name char(30),
Cost decimal,
Price decimal
);
Create Table SALE_ITEM(
SaleID integer,
SaleItemID integer
);
Considering the SQL create statements; assume that SALE, SALE_ITEM and ITEM tables were created without Primary Keys and Foreign Keys.
Which of the following SQL statements gives an error?
Select one:
a. Alter Table SALE Add Primary Key (SaleID);
Alter Table SALE_ITEM Add Primary Key (SaleID, SaleItemID);
Alter Table SALE_ITEM Add Unique (SaleID);
Alter Table ITEM Add Primary Key (ItemID);
Alter Table SALE Add Foreign Key (SaleID) References SALE_ITEM;
b. Alter Table SALE Add Primary Key (SaleID);
Alter Table SALE_ITEM Add Primary Key (SaleID, SaleItemID);
Alter Table SALE_ITEM Add Unique (SaleID);
Alter Table SALE Add Foreign Key (SaleID) References SALE_ITEM (SaleID);
c. Alter Table ITEM Add Primary Key (ItemID);
Alter Table SALE_ITEM Add Primary Key (SaleID, SaleItemID);
Alter Table SALE_ITEM Add Unique (SaleID);
Alter Table ITEM Add Foreign Key (ItemID) References SALE_ITEM;
d. Alter Table SALE Add Primary Key (SaleID);
Alter Table SALE Add Foreign Key (SaleID) References SALE_ITEM;
Your answer is incorrect.
The correct answer is: Alter Table ITEM Add Primary Key (ItemID);
Alter Table SALE_ITEM Add Primary Key (SaleID, SaleItemID);
Alter Table SALE_ITEM Add Unique (SaleID);
Alter Table ITEM Add Foreign Key (ItemID) References SALE_ITEM;



Answer :

Other Questions