CBSE Class 12 Informatics Practices
Question 13 of 103
Review of Database Concepts & SQL — Question 2
Back to all questions 2
Question Mr. Shivaya is using a table 'COURSE' with the following columns: COURSE_ID, COURSE_NAME. He needs to display the names of all the courses which end with "SCIENCE". He has written the query mentioned below, which is not giving the desired result.
SELECT COURSE_ID, COURSE_NAME FROM COURSE WHERE COURSE_NAME = '_SCIENCE';Help Mr. Shivaya to write the correct query.
SELECT COURSE_ID, COURSE_NAME FROM COURSE WHERE COURSE_NAME LIKE '%SCIENCE';The "=" operator is used for exact matching and the "_" wildcard character in SQL is used to match a single character, not a sequence of characters. To achieve the desired result, Mr. Shivaya should use the LIKE operator with the "%" wildcard character, which matches any sequence of characters.