1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
With SQL, how do you select all the records from a table named "tbIDepartment" where the value of
the column "depName" is "E&D department"?
Choose correct answers.
A. SELECT * FROM tblDepartment WHERE depName LIKE "%E&D department"
B. SELECT * FROM tblDepartment WHERE depName = "E&D department"
C. SELECT * FROM tblDepartment WHERE depName LIKE "E&D department"
D. SELECT * FROM tblDepartment WHERE depName = "%E&D department%"
BC
What are some benefits of normalization when converting an ERD to a relational model?
A. Increased storage space efficiency
B. Reduced update anomalies
C. Simplified database queries
D. Enhanced data security
FORU
AB
What is the result of the below query: SELECT SUBSTRING('FPTUDN', 1, 3) AS 'Substring'
Hoàng Hoàng
A. FPT
B. UDN
C. T
D. TUN
FORU
A
What is the value of the query:
SELECT 'Agnes' + NULL + 'Allison'
A. Agnes
B. Allison
C. NULL
D. Agnes Allison
C
Which of the following wildcard characters matches any sequence of zero or more characters in a
string comparison?
A. &
B. S
C ._
D. %
D
Which of the following represents Armstrong's Axiom of Transitivity?
A. If A B, then AC BC
B. If A B and B C, then A C
C. If A B, then B A
D. If A B, then A BC
B
(Choose 1 answer)
Which statement is the best represents Armstrong's Axiom of Decomposition?
A. If A B and A C, then A BC
B. If A B and B C, then A C
C. If A B, then AC BC
D. If A B, then B C
A
(Choose 1 answer)
Which of the following SQL statement remove all of the content from a table name "employees" but
keep the schema?
A. DELETE FROM employees;
B. TRUNCATE * FROM employees;
C. DROP TABLE employees;
D. REMOVE * FROM employees;
A
Which of the following queries deletes employees who are not assigned to any department?
A. DELETE FROM Employees WHERE DepartmentID IS NULL;
B. DELETE FROM Employees WHERE DepartmentID =";
C. DELETE FROM Employees WHERE DepartmentID = 0;
D. DELETE FROM Employees WHERE DepartmentID IS NOT NULL;
A
Which of the following SQL statement returns only matching records between Customers and SalesInvoice based on custID?
A. SELECT * FROM Customers LEFT JOIN SalesInvoice ON Customers.custID = SalesInvoice.custID;
B. SELECT * FROM Customers INNER JOIN SalesInvoice ON Customers.custID = SalesInvoice.custID;
C. SELECT * FROM Customers RIGHT JOIN SalesInvoice ON Customers.custID = SalesInvoice.custID;
D. SELECT * FROM Customers FULL JOIN SalesInvoice ON Customers.custID = SalesInvoice.custID;
B
Which statement is used to change the data type of a column named E in table A?
A. ALTER TABLE A ALTER COLUMN E [DataType]
B. ALTER TABLE A ALTER COLUMN E
C. ALTER TABLE A ALTER E [DataType]
D. ALTER TABLE A DROP COLUMN E [DataType] F O R U
A
Which statement is used to disable a foreign key constraint named fk_name during INSERT and
UPDATE transactions in table B?
A. ALTER TABLE B DROP CONSTRAINT fk_name
B. ALTER TABLE B DISABLE CONSTRAINT fk_name
C. ALTER TABLE B DISABLE fk_name
D. ALTER TABLE B NOCHECK CONSTRAINT fk_name
D
Which syntax is commonly used for the rename operation in Relational Algebra?
A. RENAME relation TO new_relation
B. RENAME attribute IN relation TO new_attribute
C. ALTER TABLE relation RENAME TO new_relation O R U
D. SELECT * FROM relation AS new_relation
A
Which SQL statement selects all rows from table called Contest, with column ContestDate having values
greater or equal to May 25, 2006?
A. SELECT * FROM Contest WHERE ContestDate >='05/25/2006'
B. SELECT * FROM Contest GROUPBY ContestDate >= '05/25/2006'
C. SELECT * FROM Contest WHERE ContestDate <= '05/25/2006'
D. SELECT " FROM Contest HAVING ContestDate >= '05/25/2006'
A
Which of the following is correct?
A. SELECT datepart(DATE, '10-jan-24')
B. SELECT datepart('10-jan-24', DATE)
C. SELECT datepart('10-jan-24', DAY)
D. SELECT datepart(DAY, '10-jan-24')
D
Which one of the following SQL statements returns the name of the employee (employeeename, dept_code,salary) receiving the maximum salary in a particular department?
A. Select employeeename, dept_code, salary From employee Where employee.salary in (select (salary) from
Employee group by dept_code having Max(salary))
B. Select employeeename, dept_code, salary From employee Where employee.salary in (select Max(salary) from Employee group by dept_code)
C. Select employeeename, dept_code, salary From employee Where employee.salary in (select Max(salary))
from Employee group by dept_code having Max(salary))O R U
D. Select employeeename, dept_code, salary From employee Where employee.salary =(select Max(salary)
from Employee group by dept_code.
B
Which is the SQL statement that creates an updatable view? In this question, all the tables in the SQL
statements are updatable.
A. CREATE VIEW Ordered_Product(Product_No) AS SELECT DISTINCT Product_No FROM Order
B. CREATE VIEW Order_List(Order_No, Product_Name, Order_Quantity) AS SELECT Order_No,Product_Name, Order_Quantity FROM Order, Product WHERE Order.Product_No=Product.Product_No
C. CREATE VIEW Product_Order(Product_No, Order_Quantity) AS SELECT Product_No,SUM(Order_Quantity) FROM Order GROUP BY Product_No
D. CREATE VIEW Expensive_Product(Product_No, Product_Name) AS SELECT Product_No,Product_Name FROM Product WHERE Product_Unit_Price>1000
D
(Choose 1 answer)
Which statement is used to remove a column named E into the relation R?
A. ALTER TABLE R DROP COLUMN E [DataType]
B. ALTER TABLE R DROP COLUMN E
C. ALTER TABLE R DELETE COLUMN E
D. ALTER TABLE R DELETE COLUMN E [DataType]
B
When does the Deleted temporary trigger table become populated?
A. With DELETE and INSERT triggers
B. With DELETE triggers only
C. With DELETE, UPDATE, and INSERT triggers
D. With DELETE and UPDATE triggers
D