Delete Query


  1. In the following query how many rows will be deleted?
    DELETE Student
    WHERE stu_id < 10;
    /*person_id is a primary key */











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    0-9


  1. In the following query how many rows will be deleted?
    DELETE Employee
    WHERE Emp_id=101;
    /*person_id is a primary key */











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    1



  1. Which keyword is used to delete all the rows from the table?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The ‘TRUNCATE’ keyword in MySQL is used to delete all the rows from the table and also free the space containing the table. Its syntax is: TRUNCATE TABLE my_table. This deletes all rows from my_table.


  1. Qualifying the name of column with the table name is not necessary in single-table updates.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    When it comes to single table ‘UPDATE’ and ‘DELETE’ operations, the qualification of a column name with the table name is not necessary. So the table name qualifier can be omitted.



  1. What is abc in the following statement?
    DELETE FROM Student WHERE Student_id= 0050;











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The ‘DELETE’ operation is being performed in the statement. The table names are ‘x’ and ‘y’. The column name is ‘col’. The rows from left join of x and y get deleted according to the condition given.