ITPEC FE Subject A April 2026 Question 22

Topic: DatabasesAlso asked in Spring 2021

A student’s ID, name, and class ID are recorded in the Student table. Which of the following is the SQL statement that returns records of all students whose names start with A?

Explanation

name LIKE 'A%' — the literal A is fixed at the start and the wildcard after it matches whatever follows.

In a LIKE pattern, % matches any sequence of characters, including none, and _ matches exactly one character. So 'A%' reads "A, then anything": it matches Anna, Ali and a name that is just A.

Answer (d)

Why not others:

  • •(a) — '%A' is "anything, then A", so it returns names that end with A
  • •(b) — '%A_' puts A in the second-to-last position, followed by exactly one character
  • •(c) — 'A_' matches only two-character names that begin with A; Anna would not match

Key rule: The position of % sets the anchor: a trailing % means "starts with", a leading % means "ends with", % on both sides means "contains", and _ stands for exactly one character.

Databases · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.