﻿ SQL: Select all columns that satisfy a specific condition - w3resource

# SQL: Select all columns that satisfy a specific condition

## SQL Basic Select Statement: Exercise-10 with Solution.

From the following table, write a SQL query to find customers whose grade is 200. Return customer_id, cust_name, city, grade, salesman_id.

Sample table: customer

Sample Solution:

``````SELECT *FROM customer

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
```

Relational Algebra Expression:

Relational Algebra Tree:

Explanation :

Pictorial presentation :

## Query Visualization:

Duration:

Rows:

Cost:

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

Test your Programming skills with w3resource's quiz.

What is the difficulty level of this exercise?

﻿

## SQL: Tips of the Day

Nested select statement in SQL Server.

You need to alias the subquery.

```SELECT name FROM (SELECT name FROM agentinformation) a
```

or to be more explicit

```SELECT a.name FROM (SELECT name FROM agentinformation) a
```

Database: SQL Server

Ref: https://bit.ly/3Qruiu5