w3resource
SQL exercises

SQL: Select all columns against a specified condition

SQL Basic Select Statement : Exercise-10 with Solution.

Write a SQL statement to display all the information for those customers with a grade of 200.

Sample table: customer


Sample Solution :

SELECT *FROM customer
WHERE grade=200;

Output of the Query:

customer_id	cust_name	 city	    grade	salesman_id
3007		Brad Davis	New York	200		5001
3005		Graham Zusi	California	200		5002
3003		Jozy Altidor    Moscow		200		5007

Explanation :

Syntax of select all columns against a specified condition

Pictorial presentation :

Result of select all columns against a specified condition

Query Visualization:

Duration:

Query visualization of Select all columns against a specified condition - Duration

Rows:

Query visualization of Select all columns against a specified condition - Rows

Cost:

Query visualization of Select all columns against a specified condition - Cost

 

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query to display names and city of salesman, who belongs to the city of Paris.
Next: Write a sql query to display the order number followed by order date and the purchase amount for each order which will be delivered by the salesman who is holding the ID 5001.

What is the difficulty level of this exercise?



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