SQL MCQs

20 practice MCQs on this page Page 3 of 4

Tap an option to check your answer — the correct answer and full explanation appear after you choose.

Computer ScienceSQL BPSCID: BPP-2747

Which SQL command is used to modify existing data?

  1. ADROP
  2. BSELECT
  3. CUPDATE ✓ Correct answer
  4. DINSERT
Computer ScienceSQL BPSCID: BPP-2748

Which SQL command removes data from a table?

  1. AREMOVE
  2. BDELETE ✓ Correct answer
  3. CTRUNCATE
  4. DDROP
Computer ScienceSQL FPSCID: FPP-11388

Which SQL statement is used to create a database?

  1. AADD DATABASE
  2. BCREATE DATABASE ✓ Correct answer
  3. CMAKE DATABASE
  4. DNEW DATABASE
Computer ScienceSQL FPSCID: FPP-11391

Which of the following is a DDL command?

  1. AUPDATE
  2. BSELECT
  3. CINSERT
  4. DCREATE ✓ Correct answer
Computer ScienceSQL FPSCID: FPP-11392

Which of the following is a DML command?

  1. ACREATE
  2. BDROP
  3. CINSERT ✓ Correct answer
  4. DALTER
Computer ScienceSQL PPSCID: LTP-7771

Which SQL statement is used to change the values in existing rows?

  1. ASELECT
  2. BCREATE
  3. CGRANT
  4. DUPDATE ✓ Correct answer
Computer ScienceSQL PPSCID: LTP-7772

Which SQL statement is used to remove rows from a table?

  1. ADELETE FROM ✓ Correct answer
  2. BDROP TABLE
  3. CTRUNCATE TABLE
  4. DREMOVE FROM
Computer ScienceSQL PPSCID: LTP-7773

What is the difference between DROP TABLE and TRUNCATE TABLE?

  1. ATRUNCATE removes the whole table; DROP removes only its rows
  2. BDROP removes the whole table; TRUNCATE removes only its rows ✓ Correct answer
  3. CBoth delete the database
  4. DBoth only delete one row
Computer ScienceSQL PPSCID: LTP-7774

Which SQL statement is used to change the structure of an existing table?

  1. AUPDATE TABLE
  2. BMODIFY DATA
  3. CALTER TABLE ✓ Correct answer
  4. DCHANGE ROW
Computer ScienceSQL PPSCID: LTP-7775

Which SQL clause is used to filter rows before they are returned?

  1. AHAVING
  2. BORDER BY
  3. CGROUP BY
  4. DWHERE ✓ Correct answer
Computer ScienceSQL PPSCID: LTP-7776

In SQL, which operator is used with WHERE to match a pattern in text?

  1. ALIKE ✓ Correct answer
  2. BBETWEEN
  3. CIN
  4. DIS
Computer ScienceSQL PPSCID: LTP-7777

In SQL, the BETWEEN operator is used to select values:

  1. AOutside all ranges
  2. BWithin a given range ✓ Correct answer
  3. COnly equal to zero
  4. DOnly in text columns
Computer ScienceSQL PPSCID: LTP-7778

In SQL, the IN operator is used to:

  1. ADelete a list
  2. BSort a list
  3. CMatch any value in a list ✓ Correct answer
  4. DCreate a list
Computer ScienceSQL PPSCID: LTP-7779

In SQL, which condition correctly tests whether a column has no value?

  1. A= NULL
  2. B== NULL
  3. CIS EMPTY
  4. DIS NULL ✓ Correct answer
Computer ScienceSQL PPSCID: LTP-7780

In SQL, ORDER BY with DESC sorts the results in which order?

  1. ADescending order ✓ Correct answer
  2. BAscending order
  3. CRandom order
  4. DNo order
Computer ScienceSQL PPSCID: LTP-7781

Which SQL function returns the average value of a numeric column?

  1. ASUM
  2. BAVG ✓ Correct answer
  3. CCOUNT
  4. DMAX
Computer ScienceSQL PPSCID: LTP-7782

Which SQL function returns the largest value in a column?

  1. AMIN
  2. BCOUNT
  3. CMAX ✓ Correct answer
  4. DSUM
Computer ScienceSQL PPSCID: LTP-7783

In SQL, a subquery is best described as:

  1. AA deleted query
  2. BA printed report
  3. CA database backup
  4. DA query nested inside another query ✓ Correct answer
Computer ScienceSQL PPSCID: LTP-7784

In SQL, the AS keyword is used to:

  1. AGive a column or table an alias ✓ Correct answer
  2. BDelete a column
  3. CSort the results
  4. DCreate a database
Computer ScienceSQL PPSCID: LTP-7785

In Oracle, the DUAL table is best described as:

  1. AA table with all user data
  2. BA one-row dummy table used for calculations ✓ Correct answer
  3. CA backup table
  4. DA table of passwords

Practice these MCQs interactively