> For the complete documentation index, see [llms.txt](https://anton-veselskyi.gitbook.io/codding-problems-solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anton-veselskyi.gitbook.io/codding-problems-solutions/codewars/6-kyu/sql-basics-simple-in.md).

# SQL Basics: Simple IN

## [SQL Basics: Simple IN](https://www.codewars.com/kata/58113c03009b4fcc66000d29)

For this challenge you need to create a SELECT statement, this SELECT statement will use an IN to check whether a department has had a sale with a price over 98.00 dollars.

### departments table schema

* id
* name

### sales table schema

* id
* department\_id (department foreign key)
* name
* price
* card\_name
* card\_number
* transaction\_date

### resultant table schema

* id
* name

> NOTE: sometimes a department will not not contain a sale over $98 so just resubmit.

## Solutions

#### 🗃️ Sql

```sql
SELECT id, name
FROM departments
WHERE id IN (SELECT department_id FROM sales WHERE price > 98)
```
