You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- 1. Write a query to retrieve all the data from the "employees" table where the employee_id is equal to 5.
4
+
select*
5
+
from employees
6
+
where employee_id =5;
7
+
8
+
-- 2. Write a query to retrieve the first and last names of all employees from the "employees" table who were hired in the year 2022.
9
+
select*
10
+
from employees
11
+
where hire_date >=2022-01-01;
12
+
13
+
-- 3. Write a query to retrieve the first and last names of all employees from the "employees" table who have a salary greater than 50,000.
14
+
select first_name, last_name
15
+
from employees
16
+
where salary >50000;
17
+
18
+
-- 4. Write a query to retrieve the product names and prices of all products from the "products" table that have a price greater than 45000.
19
+
select product_name, price
20
+
from products
21
+
where price >45000;
22
+
23
+
-- 5. Write a query to retrieve the order dates and total amounts of all orders from the "orders" table that have a total amount greater than 50000.
24
+
select order_date, total_amount
25
+
from orders
26
+
where total_amount >50000;
27
+
28
+
-- 6. Write a query to retrieve the first and last names of all customers from the "customers" table who live in Downtown.
29
+
select first_name, last_name
30
+
from customers
31
+
where address ='Downtown';
32
+
33
+
-- 7. Write a query to retrieve the order dates and total amounts of all orders from the "orders" table that were placed in the month of January.
34
+
select order_date, total_amount
35
+
from orders
36
+
where MONTH(order_date) =1;
37
+
38
+
-- 8. Write a query to retrieve the order dates and total amounts of all order from the "order" table that have a status of "Pending".
39
+
select order_date, total_amount, status
40
+
from orders
41
+
where status ='Pending';
42
+
43
+
-- 9. Write a query to retrieve the product names and prices of all products from the "products" table that belong to the "Tablet" category and have a price less than 28000.
0 commit comments