## Introduction  
Welcome to Lesson 3.1: Basic SQL Queries. This lesson is part of Module 3: Core Skills - Data Analysis Techniques in the Data Analytics for Developers course. In this lesson, we'll explore the structure of SQL queries, how to use SELECT statements, and how to filter data with the WHERE clause. By the end of this lesson, you will be able to write basic SQL queries to retrieve and filter data effectively, empowering you to analyze information relevant to your business.

## Main Content  

### Introduction to SQL Query Structure  
Structured Query Language, or SQL, is a powerful tool used for managing and manipulating databases. At its core, an SQL query consists of several key components that dictate what data is retrieved from a database. The basic structure of an SQL query follows this pattern:  
```sql
SELECT column1, column2 
FROM table_name 
WHERE condition;
```
- **SELECT** is the command that tells the database which columns of data you want to retrieve.  
- **FROM** specifies the table from which to pull the data.  
- **WHERE** is an optional clause that allows you to filter the results based on specific conditions.  

Understanding this structure is crucial as it forms the foundation for constructing more complex queries. 

### Using SELECT Statements  
The SELECT statement is central to retrieving data in SQL. When you want to find information in your database, you begin with SELECT. Here’s a simple example:  
```sql
SELECT first_name, last_name 
FROM employees;
```
This query retrieves the first and last names of all employees from the "employees" table. You can also use the wildcard (*) to select all columns:  
```sql
SELECT * 
FROM employees;
```
While using SELECT, it’s important to remember that the order of the columns listed will match the order they appear in the result set. This allows you to display data in a meaningful way, tailored to your requirements.

### Filtering Data with WHERE  
The WHERE clause is where the real power of SQL comes into play. It enables you to filter the results based on specific criteria. For example, if you want to find employees in a particular department, your query might look like this:  
```sql
SELECT first_name, last_name 
FROM employees 
WHERE department = 'Sales';
```
This query will return only the first and last names of employees who work in the Sales department. You can also use other operators such as LIKE for pattern matching, or logical operators like AND and OR to combine multiple conditions. For instance:  
```sql
SELECT first_name, last_name 
FROM employees 
WHERE department = 'Sales' AND status = 'Active';
```
This query filters to show only those employees who are active and work in Sales.

## Examples  
To make the concepts more relatable, let’s look at a couple of practical examples relevant to a business context.  

**Example 1: Customer Data Retrieval**  
Suppose you manage a customer database for your business. If you want to retrieve the names of customers who have made purchases over a certain amount, you can execute the following query:  
```sql
SELECT customer_name 
FROM purchases 
WHERE amount > 100;
```
This would return a list of customers who have spent more than $100.

**Example 2: Employee Roles**  
Let’s say you want to check the roles of employees within your organization. You might run:  
```sql
SELECT first_name, role 
FROM employees 
WHERE role LIKE '%Manager%';
```
This query finds all employees whose roles contain the word "Manager," helping you identify leadership positions within your company.

## Conclusion  
In this lesson, we covered the basics of SQL queries, focusing on the structure, the use of SELECT statements, and filtering data with the WHERE clause. Mastering these fundamental skills will empower you to retrieve and analyze data effectively, enhancing your decision-making capabilities in your business. As you progress in this course, you'll build on these skills to tackle more complex data analysis tasks.

## Reflection Questions  
1. How can you apply the SELECT statement to retrieve specific information relevant to your business?  
2. In what scenarios would you find the WHERE clause most beneficial for filtering data?  
3. What challenges do you foresee in constructing SQL queries, and how might you address them?  

**Word Count:** 1,015 words.