Any2Quiz
Computer Science / Languages / SQL

DML Quiz - Languages SQL

Free practice quiz: DML (Languages SQL). 54 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

Play all 54 questions free

Sample questions

  1. Consider a table `Employees` with columns `EmployeeID`, `FirstName`, `LastName`, `Department`, and `Salary`. Which DML statement would you use to increase the salary of all employees in the 'Sales' department by 10%?

    1. INSERT INTO Employees SET Salary = Salary * 1.10 WHERE Department = 'Sales';
    2. UPDATE Employees SET Salary = Salary * 1.10 WHERE Department = 'Sales';
    3. MODIFY Employees SET Salary = Salary * 1.10 WHERE Department = 'Sales';
    4. ALTER Employees SET Salary = Salary * 1.10 WHERE Department = 'Sales';
    Show answer

    Answer: B. UPDATE Employees SET Salary = Salary * 1.10 WHERE Department = 'Sales';

    The UPDATE statement is used to modify existing records in a table. The SET clause specifies the column to be updated and the new value, while the WHERE clause filters the rows to be updated. Multiplying the current Salary by 1.10 increases it by 10%.

  2. Which DML statement is used to modify specific values in existing records of a table?

    1. INSERT
    2. UPDATE
    3. DELETE
    4. SELECT
    Show answer

    Answer: B. UPDATE

    The UPDATE statement is used to change the values in one or more columns of existing rows in a table.

  3. Which DML statement can be used to change the values in one or more columns for existing records?

    1. INSERT
    2. SELECT
    3. UPDATE
    4. DELETE
    Show answer

    Answer: C. UPDATE

    The UPDATE statement is used to modify existing data within a table.

  4. Consider the `Employees` table with `EmployeeID`, `Name`, `Salary`, `Department`. You want to update the `Department` of the employee with `EmployeeID` 103 to 'Marketing'. Which DML statement is correct?

    1. INSERT INTO Employees SET Department = 'Marketing' WHERE EmployeeID = 103;
    2. UPDATE Employees SET Department = 'Marketing' WHERE EmployeeID = 103;
    3. DELETE FROM Employees WHERE EmployeeID = 103;
    4. SELECT Department FROM Employees WHERE EmployeeID = 103;
    Show answer

    Answer: B. UPDATE Employees SET Department = 'Marketing' WHERE EmployeeID = 103;

    The UPDATE statement modifies the 'Department' column to 'Marketing' for the specific employee identified by 'EmployeeID = 103'.

  5. Which DML command is used to retrieve specific information from a database table?

    1. UPDATE
    2. INSERT
    3. SELECT
    4. DELETE
    Show answer

    Answer: C. SELECT

    The SELECT statement is the primary DML command for retrieving data.

Take the full quiz

More quizzes

Browse all SQL quizzes