Logical Operators in SQL such as AND, OR, and NOT are used to combine multiple conditions in WHERE and HAVING clauses. They help control complex filtering and decision-making in queries.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which operator returns true if at least one condition is true?
Correct
Incorrect
Question 3 of 15
3. Question
What does the NOT operator do in SQL?
Correct
Incorrect
Question 4 of 15
4. Question
What will the result be for: WHERE age > 18 AND age < 30?
Correct
Incorrect
Question 5 of 15
5. Question
Which of these returns records where either city = ‘Delhi’ OR city = ‘Mumbai’?
Correct
Incorrect
Question 6 of 15
6. Question
What is the result of this query: SELECT * FROM users WHERE NOT age > 60;
Correct
Incorrect
Question 7 of 15
7. Question
Which statement returns rows where salary is greater than 50000 and department is ‘IT’?
Correct
Incorrect
Question 8 of 15
8. Question
What does this condition do: WHERE NOT (status = ‘Inactive’)
Correct
Incorrect
Question 9 of 15
9. Question
Which operator has the highest precedence in SQL logical expressions?
Correct
Incorrect
Question 10 of 15
10. Question
What will this return: WHERE NOT (age < 20 OR age > 50)?
Correct
Incorrect
Question 11 of 15
11. Question
Which query shows students from ‘Science’ or ‘Commerce’ but not ‘Arts’?
Correct
Incorrect
Question 12 of 15
12. Question
What is the result of WHERE NOT (marks < 35)?
Correct
Incorrect
Question 13 of 15
13. Question
What will SELECT * FROM emp WHERE dept = ‘HR’ OR NOT dept = ‘Finance’; return?
Correct
Incorrect
Question 14 of 15
14. Question
What is the result of WHERE (gender = ‘Male’ AND age < 25) OR (gender = ‘Female’ AND age > 30)?
Correct
Incorrect
Question 15 of 15
15. Question
Which clause can use logical operators in SQL?
Correct
Incorrect
Summary
This quiz covers essential SQL logical operators (AND, OR, NOT) to help learners understand conditional logic in SQL queries. Mastery of these operators is crucial for writing effective and complex SQL filters.
At QuizOrbit, our team specializes in fun, informative quizzes across topics like general knowledge, technology, and entertainment. Boost your knowledge with our expert-designed quizzes.