SQL Interview questions & Answers | Part-5

Published: 23 August 2024
on channel: Sagar's Data Journey
325
9

This is the 5th video of our series on SQL interview questions and answers. This series is specifically designed for people targeting jobs as data analysts, data scientists, data engineers, business analysts and Software Engineer. Also this video is helpful for those students who are studying in Computer Science Engineering and AI and DSA.

In this video, I have explained Answer for
Problem Statement:-
Write a SQL code to find employees hired in last ‘N’ months/day/year

Use below script to create the Tables:-
Create Employee Table
Create table Employee
(
ID int primary key auto_increment,
FirstName varchar(50),
LastName varchar(50),
Gender varchar(50),
Salary int,
HireDate Date
);

Insert records in Employee Table
INSERT INTO Employee (FirstName, LastName, Gender, Salary, HireDate)
VALUES
('Mark', 'Hastings', 'Male', 60000, '2023-10-05'),
('Steve', 'Pound', 'Male', 45000, '2023-04-20'),
('Ben', 'Hoskins', 'Male', 70000, '2023-04-05'),
('Philip', 'Hastings', 'Male', 45000, '2023-03-11'),
('Mary', 'Lambeth', 'Female', 30000, '2023-03-10'),
('Valarie', 'Vikings', 'Female', 35000, '2023-02-09'),
('John', 'Stanmore', 'Male', 80000, '2023-02-22'),
('Able', 'Edward', 'Male', 5000, '2023-01-22'),
('Emma', 'Nan', 'Female', 5000, '2023-01-14'),
('Jd', 'Nosin', 'Male', 6000, '2023-01-10'),
('Todd', 'Heir', 'Male', 7000, '2023-02-14'),
('San', 'Hughes', 'Male', 7000, '2023-03-15'),
('Nico', 'Night', 'Male', 6500, '2023-04-19'),
('Martin', 'Jany', 'Male', 5500, '2023-05-23'),
('Mathew', 'Mann', 'Male', 4500, '2023-06-23'),
('Baker', 'Barn', 'Male', 3500, '2023-07-23'),
('Mosin', 'Barn', 'Male', 8500, '2023-08-21'),
('Rachel', 'Aril', 'Female', 6500, '2023-09-14'),
('Pameela', 'Son', 'Female', 4500, '2023-10-14'),
('Thomas', 'Cook', 'Male', 3500, '2023-11-14'),
('Malik', 'Md', 'Male', 6500, '2023-12-14'),
('Josh', 'Anderson', 'Male', 4900, '2024-01-05'),
('Geek', 'Ging', 'Male', 2600, '2024-01-04'),
('Sony', 'Sony', 'Male', 2900, '2024-04-30'),
('Aziz', 'Sk', 'Male', 3800, '2024-03-01'),
('Amit', 'Naru', 'Male', 3100, '2024-03-31');

Join My Telegram Channel to download the notes👇:
Telegram : https://t.me/+SphVEMyx2m02NWJl

⚠️Don't Forget to Subscribe My Channel !

Follow me on👇
Instagram :   / sagar.dodamani  
LinkedIn :   / sagardodamani  
GitHub : https://github.com/Dodamanisagar
Telegram : https://t.me/+SphVEMyx2m02NWJl

#sql
#sqlinterview
#sqlinterviewquestionsandanswers
#sqlinterviewquestions
#dataanalyst
#datascience


Watch video SQL Interview questions & Answers | Part-5 online without registration, duration hours minute second in high quality. This video was added by user Sagar's Data Journey 23 August 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 325 once and liked it 9 people.