Answer & Solution
Answer: Option A
Solution:
To select all data from the "student" table where the names start with the letter 'r,' you can use the
LIKE
operator in SQL. Here's an explanation of each option:
Option A:
SELECT * FROM student WHERE name LIKE 'r%';
This option selects all rows where the "name" column starts with 'r'.
Option B:
SELECT * FROM student WHERE name LIKE '%r%';
This option selects all rows where the "name" column contains the letter 'r' anywhere within the name.
Option C:
SELECT * FROM student WHERE name LIKE '%r';
This option selects all rows where the "name" column ends with the letter 'r'.
Option D:
SELECT * FROM student WHERE name LIKE '_r%';
This option selects all rows where the "name" column has 'r' as the second letter.
Since you want to select names starting with 'r,' the correct query is
Option A
, which uses
'r%'
in the
LIKE
clause to match names that start with 'r'.