MySQL INTERVIEW QUESTIONS | TCS | Mphasis | Accenture | GROUP BY |
Автор: Kongadi_Explains
Загружено: 11 мая 2025 г.
Просмотров: 10 просмотров
Interview Question to Practice
1.Find employees who were hired after January 1, 2020.
2.What is the average salary of employees in HR department?
3.How many employees are managed by Patricia Taylor?
SQL Table Code:
-- 1. Create the table
CREATE TABLE employees (
employee_id INT,
employee_name VARCHAR(100),
department VARCHAR(50),
salary float,
manager_name VARCHAR(100),
hire_date DATE,
last_login_date DATE
);
-- 2. Insert values
INSERT INTO employees (employee_id, employee_name, department, salary, manager_name, hire_date , last_login_date ) VALUES
(1, 'Julia Ramirez', 'Sales', 63112.59, 'Nicole Aguirre', '2021-12-02', '2025-03-20'),
(2, 'Jeffrey Marshall', 'HR', 45948.27, 'Patricia Taylor', '2021-07-18', '2025-03-12'),
(3, 'Kevin Rodriguez', 'Finance', 67497.96, 'Patricia Taylor', '2019-11-11', '2025-03-11'),
(4, 'Jessica Hill MD', 'HR', 72331.89, 'Teresa Smith', '2018-04-19', '2025-02-22'),
(5, 'Kenneth Chavez', 'Marketing', 119503.86, 'Jamie Hampton', '2020-09-03', '2025-03-06'),
(6, 'Brenda Johnson', 'Sales', 80900.46, 'Teresa Smith', '2019-11-26', '2025-02-25'),
(7, 'Charles Green', 'Finance', 94491.63, 'Jamie Hampton', '2015-05-05', '2025-02-28'),
(8, 'Rebecca Valdez', 'Finance', 83336.59, 'Jamie Hampton', '2020-03-13', '2025-03-02'),
(9, 'Albert Jackson', 'Finance', 100073.30, 'Teresa Smith', '2022-11-14', '2025-03-16'),
(10, 'David Perkins', 'Marketing', 56811.90, 'Nicole Aguirre', '2023-04-04', '2025-02-28'),
(11, 'Jennifer Mcmahon', 'IT', 81844.83, 'John Brown', '2017-08-20', '2025-03-09'),
(12, 'Felicia Howell', 'IT', 54990.54, 'Patricia Taylor', '2020-11-29', '2025-03-05'),
(13, 'Nancy Blair', 'Sales', 59776.60, 'Patricia Taylor', '2017-10-01', '2025-03-09'),
(14, 'Sydney Clark', 'HR', 44288.24, 'John Brown', '2015-07-04', '2025-03-02'),
(15, 'Olivia Rose', 'Marketing', 115631.90, 'Nicole Aguirre', '2023-05-10', '2025-03-19'),
(16, 'William Myers', 'IT', 105686.58, 'Patricia Taylor', '2019-04-09', '2025-03-16'),
(17, 'Heather Duncan', 'IT', 112688.69, 'Nicole Aguirre', '2018-08-03', '2025-03-18'),
(18, 'Leah Moore', 'Sales', 59611.84, 'John Brown', '2017-09-03', '2025-03-17'),
(19, 'Crystal Bradley', 'IT', 44840.69, 'Patricia Taylor', '2018-04-02', '2025-03-10'),
(20, 'Samuel Rodriguez', 'Sales', 94783.94, 'Teresa Smith', '2016-07-21', '2025-02-22');

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: