Which of the following query is correct for using comparison operators in SQL?
Which of the following query is correct for using comparison operators in SQL? Correct Answer [ <p><span>A. SELECT name, course_name FROM student WHERE age>50 and <p><span>B. SELECT name, course_name FROM student WHERE age>50 and age
In SQL, comparison operators are used to compare values in the WHERE clause to filter rows based on specified conditions. The correct usage of these operators is as follows:Greater than (>): Compares if a value is greater than another.
Less than ( Compares if a value is less than another.
The correct SQL syntax for using comparison operators to filter rows where the "age" column is greater than 50 and less than 80 is as shown in "Option B."
Let's break down the correct query:
SELECT name, course_name: This part of the query specifies the columns to be retrieved in the result.
FROM student: It specifies the table from which the data is retrieved.
WHERE age > 50 and age This part specifies the conditions for filtering the rows. It correctly uses the ">" and "
The correct option, therefore, is "Option B."
মোঃ আরিফুল ইসলাম
Feb 20, 2025