From the course: Quick Start Guide to SQL
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Comparison conditions
From the course: Quick Start Guide to SQL
Comparison conditions
- [Instructor] Let's learn about the comparison conditions. Usually there are large sets of data but we do not need the entire data every single time. Based on the requirement, we filter our data using the WHERE conditions. We can have one or multiple conditions in the WHERE. Let's take a look at an example to understand the WHERE condition and how it is used. I give SELECT emp number, name, salary FROM emp_tab WHERE salary greater than 3,000 and I run this. By giving this WHERE condition, we are eliminating all the unnecessary information and just fetching the data we need. In this case, we are fetching employee salaries that are greater than 3,000 only. Alias names cannot be given in the WHERE condition. If we give a condition value in the condition, then we need to keep the value in single quotes as it is case sensitive. If we are using dates, then we need to keep them in single quotes too as they are format…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.