T-SQL Fundamentals and Its Role in SQL Server Quiz

  1. Basic Structure of T-SQL

    Which statement represents a correctly written T-SQL SELECT query that retrieves all columns from a table named Employees?

    1. SELECT * FROM Employees;
    2. GET ALL FROM Employees;
    3. FETCH Employees *;
    4. SELECT Employees ALL;
    5. SHOW * IN Employees;
  2. Role of T-SQL

    What is the primary purpose of T-SQL in a relational database environment?

    1. To query and manage data
    2. To create network protocols
    3. To design hardware drivers
    4. To format spreadsheets
    5. To analyze JSON files
  3. Filtering Data

    In T-SQL, which clause is used to filter rows in the result set based on a specific condition?

    1. WHERE
    2. WHEN
    3. WHILE
    4. WITHIN
    5. WHARE
  4. Aggregate Functions

    Which T-SQL aggregate function should you use to calculate the total number of rows in a Products table?

    1. COUNT
    2. SUMM
    3. TOTAL
    4. ADDS
    5. COUNTT
  5. Sorting Query Results

    How can you sort query results in ascending order by the LastName column in T-SQL?

    1. ORDER BY LastName ASC
    2. SORT LastName UP
    3. ORDER LastName UPWARDS
    4. SORT BY LastName ASCND
    5. ORDER LastName ASCENDING
  6. Inserting Data

    Which T-SQL command is used to add a new row into the Customers table?

    1. INSERT INTO Customers
    2. ADD INTO Customers
    3. APPEND Customers
    4. INJECT INTO Customers
    5. INSERT Customers IN
  7. T-SQL Variable Declaration

    How do you correctly declare a variable of type INTEGER in T-SQL?

    1. DECLARE @varName INT;
    2. DEFINE varName INTEGER;
    3. VAR @varName AS INT;
    4. SET @varName: INT;
    5. DECLAR @varName INTEGER;
  8. Updating Data

    To change the value of a column named 'Salary' to 50000 for all employees, which T-SQL command should you use?

    1. UPDATE Employees SET Salary = 50000;
    2. CHANGE Employees Salary TO 50000;
    3. MODIFY Employees Salary = 50000;
    4. SET Employees: Salary = 50000;
    5. UPDATE Salary = 50000 IN Employees;
  9. Deleting Data

    Which T-SQL statement removes all rows from the Orders table?

    1. DELETE FROM Orders;
    2. REMOVE Orders ALL;
    3. ERASE Orders;
    4. CLEAR ALL FROM Orders;
    5. DEL Orders;
  10. Joining Tables

    Which type of T-SQL JOIN returns all rows from the first table and matching rows from the second table?

    1. LEFT JOIN
    2. INNER JOIN
    3. RIGHT JOIN
    4. CROSS JOIN
    5. SIDE JOIN