From the course: From Excel to SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Filtering rows in SQL

Filtering rows in SQL

From the course: From Excel to SQL

Start my 1-month free trial

Filtering rows in SQL

- Say you're working with an Excel spreadsheet and it's filled with thousands of rows of data. The problem is you're only interested in a small amount of that data. So what you probably do in that case, is reduce down the size of the dataset by using a filter. We can do the same thing in SQL to filter your data stored in the database. What you going to do is add a where clause to your select statement. So let's head over to DB browser and we'll take a look at how to use the where clause. Before we get started, It can be a good idea to view all the tables data using a select star statement. That way, you can get a sense of the column names and also the data within those columns. This will help you figure out how you want to filter the data. So in this case, I'm going to use select star from employees and then execute the query. So we can see that we have this department column and that's going to be useful for us.…

Contents