SQL

All Questions for: SQL

Question 51: What happens if you execute DELETE FROM table_name without a WHERE clause?

  • A Nothing happens
  • B All rows are deleted
  • C Only first row is deleted

Explanation: The correct option is: Option B

Question 52: Which SQL keyword is used to give a column a temporary name?

  • A RENAME
  • B ALIAS
  • C AS

Explanation: The correct option is: Option C

Question 53: Which SQL operator is used to test whether a value matches any value in a list?

  • A IN
  • B ANY
  • C MATCHES

Explanation: The correct option is: Option A

Question 54: Which SQL comparison is used to check if a value is NULL?

  • A value = NULL
  • B value IS NULL
  • C value == NULL

Explanation: The correct option is: Option B

Question 55: Is the SQL BETWEEN operator inclusive of boundary values?

  • A Yes, it includes both values
  • B No, it excludes both values
  • C Yes, but only the lower value

Explanation: The correct option is: Option A

Question 56: Which statement is true regarding DROP and DELETE?

  • A DROP removes rows, DELETE removes table
  • B Both commands remove only rows
  • C DELETE removes rows, DROP removes the table

Explanation: The correct option is: Option C

Question 57: Which SQL command is used to change an existing table structure?

  • A ALTER TABLE
  • B CHANGE STRUCTURE
  • C MODIFY TABLE

Explanation: The correct option is: Option A

Question 58: What does COUNT(*) return in SQL?

  • A The count of non-null values only
  • B The total number of rows including NULLs
  • C The count of unique values

Explanation: The correct option is: Option B

Question 59: Which SQL query updates salary to 50000 and commission to 10 for employee_id = 101?

  • A UPDATE employees SET salary=50000, commission=10 WHERE employee_id=101;
  • B UPDATE employees SET (salary, commission)=(50000,10) WHERE employee_id=101;
  • C MODIFY employees SET salary=50000 AND commission=10 WHERE employee_id=101;

Explanation: The correct option is: Option A

Question 60: What happens if you execute DELETE FROM table_name without a WHERE clause?

  • A Nothing happens
  • B All rows are deleted
  • C Only first row is deleted

Explanation: The correct option is: Option B