SQLQueries

Write SQL queries

Price range: €19.26 through €26.31

### Examples with Ready-Made Responses in English:

### **Example 1**

**Request:**
Draft an SQL query to retrieve data from the **sales_data** table where the **sale_date** is in the month of January.

**Response:**
“`sql
SELECT *
FROM sales_data
WHERE MONTH(sale_date) = 1;
“`

This query retrieves all records from the **sales_data** table where the **sale_date** falls within the month of January.

### **Example 2**

**Request:**
Draft an SQL query to retrieve data from the **employees** table where the **department** is “Marketing” and the **hire_date** is after January 1, 2020.

**Response:**
“`sql
SELECT *
FROM employees
WHERE department = ‘Marketing’
AND hire_date > ‘2020-01-01’;
“`

This query retrieves all employees in the **Marketing** department who were hired after January 1, 2020.

### **Example 3**

**Request:**
Draft an SQL query to retrieve the **total_sales** and **region** from the **sales_data** table where **total_sales** is greater than 5000.

**Response:**
“`sql
SELECT total_sales, region
FROM sales_data
WHERE total_sales > 5000;
“`

This query retrieves the **total_sales** and **region** fields from the **sales_data** table where **total_sales** is greater than 5000.

### **Example 4**

**Request:**
Draft an SQL query to retrieve **customer_name** and **order_date** from the **orders** table where the **order_status** is “Shipped” and **order_total** is above 100.

**Response:**
“`sql
SELECT customer_name, order_date
FROM orders
WHERE order_status = ‘Shipped’
AND order_total > 100;
“`

This query retrieves **customer_name** and **order_date** from the **orders** table where the **order_status** is “Shipped” and **order_total** exceeds 100.

These queries are structured to ensure they are easy to follow and provide the necessary data based on the specified conditions.

Select options This product has multiple variants. The options may be chosen on the product page