Our experts have gathered these Transact-SQL (T-SQL) MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of Transact-SQL (T-SQL) by answering these 20 multiple-choice questions.
Get started now by scrolling down!
A. Nonclustered
B. Unique
C. Heap
D. Hash
A. Joining operations
B. Linking operations
C. Criteria operations
D. Logical operations
A. TRUNCATE TABLE
B. DELETE
C. MERGE
D. DROP
A. WHERE LastName = A*
B. WHERE LastName = LIKE '%A%'
C. WHERE LastName LIKE 'A%'
D. WHERE LastName IN ('A*')
A. SELECT LIMIT(2) first_name, department, team FROM Students ORDER BY points ASC;
B. SELECT TOP(2) first_name, deprtment, team FROM Students ORDER BY points DESC;
C. SELECT TOP(2) WITH TIES first_name, department, team FROM Students ORDER BY points;
D. SELECT BOTTOM(2) first_name, department, team FROM Students ORDER BY points ASC;
A. SELECT FLOOR(-1234.321)
B. -1234.3
C. -1234
D. -1235
E. 1234.321
A. UPDATE Students SET last_name = 'Smith' WHERE email = 'dfiggins@rouxacademy.com';
B. UPDATE Students SET last_name = 'Figgins' WHERE email = 'dfiggins@rouxacademy.com';
C. UPDATE Students SET last_name = 'Figgins' WHERE last_name = 'Smith' AND first-name = 'Donette';
D. UPDATE Students SET last_name = 'Smith' WHERE last_name = 'Figgins' AND first-name = 'Donette';
A. Real
B. Bit
C. Decimal
D. Numeric
A. TRUNCATE FROM Products *;
B. DELETE FROM Products;
C. DELETE * FROM Products;
D. TRUNCATE TABLE Products;
A. 0
B. 0.5
C. Error
D. 2
A. Float
B. Int
C. Tinyint
D. Bigint
A. abc\def
B. abcdef
C. error
D. abc def
A. SELECT TOP(1) first_name, last_name FROM Students ORDER BY NEWID();
B. SELECT TOP(1) RAND(first_name, last_name) FROM Student;
C. SELECT TOP(1) first_name, last_name FROM Student;
D. SELECT TOP(1) first_name, last_name FROM RAND(Student);
A. ALTER USER Sharon WITH DEFAULT_SCHEMA = Sales;
B. ALTER USER Sharon SET SCHEMA Sales;
C. CREATE SCHEMA Sales SET OWNER Sharon;
D. CREATE SCHEMA Sales AUTHORIZATION Sharon;
A. 1024
B. 20
C. 9
A. WHERE SerialNumer LIKE '%10_3'
B. WHERE SerialNumer LIKE ('%10'+'_'+'3')
C. WHERE SerialNumer LIKE '%10
D. WHERE SerialNumer LIKE '%10[_]3'
A. INNER
B. RIGHT
C. LEFT
D. FULL
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
A. That only records from the rightmost table will be displayed
B. That no records from the rightmost table are displayed if the records dont have corresponding records in the left table
C. That records from the rightmost table will be displayed only if the records have a corresponding value in the leftmost table
D. That all records from the rightmost table are represented in the result, even if there are no corresponding records in the left table
A. SELECT StudentName FROM Students WHERE Grade = MAX(Grade);
B. SELECT TOP(1) StudentName FROM Students ORDER BY Grade;
C. SELECT TOP(1) WITH TIES StudentName FROM Students ORDER BY Grade DESC;
D. SELECT StudentName, MAX(Grade) FROM Students ORDER BY Grade DESC;
A. Only records that have corresponding entries in table1 and table2 are displayed.
B. No records from table1 are ever displayed.
C. All records from table1 are displayed, regardless of whether the records have a corresponding row in table2
D. Only records that have no corresponding records in table1 or table2 are displayed.
A. TRUNCATE TABLE Students;
B. TRUNCATE * FROM Students;
C. DROP TABLE Students;
D. REMOVE * FROM Students;
A. You should create a DML trigger on the server.
B. You should create a DDL trigger on the database.
C. You should create a DML trigger on TableA.
D. You should create a DML trigger on TableB.
A. Error
B. '123''123'
C. 123123
D. 246
A. DEDUPE
B. SELECT
C. MERGE
D. UNION
A. ALTER SCHEMA Products TRANSFER Warehouse.Inventory;
B. ALTER TABLE Warehouse.Inventory TRANSFER Products.Inventory;
C. ALTER TABLE Warehouse.Inventory ADD SCHEMA Products;
D. ALTER SCHEMA Warehouse ADD TABLE Inventory;
A. BACKUP MyDatabase TO LOCATION = 'Z:\Backups\MyDatabase.bak';
B. CREATE BACKUP (DATABASE = 'MyDatabase' TO DISK = 'Z:\Backups\MyDatabase. bak');
C. BACKUP DATABASE MyDatabase ON 'Z:\Backups\MyDatabase.bak';
D. BACKUP DATABASE MyDatabase TO DISK = 'z:\Backups\MyDatabase.bak';
A. All statements must end with a semicolon.
B. All statements must operate on a table of data.
C. All statements must always be written in uppercase letters.
D. All statements must include more than one variable.
A. UPDATE Students SET last_name='Smith', email = 'dsmith@rouxacademy.com' WHERE id='56295';
B. UPDATE Students SET last_name='Smith', email = 'dsmith@rouxacademy.com' WHERE id=56295;
C. UPDATE Students SET last_name='Smith' AND email = 'dsmith@rouxacademy.com' WHERE id=56295;
D. UPDATE Students SET last_name='Smith' AND email = 'dsmith@rouxacademy.com' WHERE id='56295';