SQL: Display all information using OR, NOT operator with specified conditions
SQL Boolean Operator Statement : Exercise-4 with Solution
Write a SQL statement to display all the customers, who are either belongs to the city New York or not had a grade above 100.
Sample table: customer
SELECT * FROM customer WHERE city = 'New York' OR NOT grade>100;
Output of the Query:
customer_id cust_name city grade salesman_id 3002 Nick Rimando New York 100 5001 3007 Brad Davis New York 200 5001 3009 Geoff Cameron Berlin 100 5003
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a SQL statement to display all customers, who are either belongs to the city New York or had a grade above 100.
Next: Write a SQL query to display those customers who are neither belongs to the city New York nor grade value is more than 100.
What is the difficulty level of this exercise?