w3resource
SQL exercises

SQL Subquery Exercises: Find all those customers whose grade are not as the grade, belongs to the city Paris

SQL SUBQUERY: Exercise-29 with Solution

29. Write a query to find all those customers whose grade are not as the grade, belongs to the city Paris.

Sample table: Customer


Sample Solution:

SELECT *
FROM customer 
WHERE grade NOT IN
   (SELECT grade
	FROM customer
	WHERE city='Paris');

Sample Output:

customer_id	cust_name		city		grade	salesman_id
3002		Nick Rimando		New York	100	5001
3007		Brad Davis		New York	200	5001
3005		Graham Zusi		California	200	5002
3008		Julian Green		London		300	5002
3004		Fabian Johnson		Paris		300	5006
3009		Geoff Cameron		Berlin		100	5003
3003		Jozy Altidor		Moscow		200	5007
3001		Brad Guzan		London			5005

Practice Online


HR database model

Query Visualization:

Duration:

Query visualization of Find all those customers whose grade are not as the grade, belongs to the city Paris - Duration

Rows:

Query visualization of Find all those customers whose grade are not as the grade, belongs to the city Paris - Rows

Cost:

Query visualization of Find all those customers whose grade are not as the grade, belongs to the city Paris - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to get all the information for those customers whose grade is not as the grade of customer who belongs to the city London.
Next: Write a query to find all those customers who hold a different grade than any customer of the city Dallas.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming