ExamVeda
Login
Home
This question belongs to SQL Sql Miscellaneous
Sql Miscellaneous
?

How to select all data from student table starting the name from letter 'r'?

Answer & Solution
Correct Answer: Option A
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'.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.