Тёмный

SQL Interview Questions And Answers Part 64 | SQL questions for Product based companies 

ItJunction4all
Подписаться 13 тыс.
Просмотров 1,5 тыс.
50% 1

SQL Interview Questions And Answers Part 64
Problem Statement :- There are two tables namely Job_Positions and Job_Employees
Write an SQL query to get the expected output as shown in next slide. Basically it should display not filled posts as ‘Vacant’ along with the details of the employee:-
-------------------------------------------------------------------------
𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
-------------------------------------------------------------------------
*Instagram :
/ itjunction4all
*Twitter:
/ sunilkr5672
-------------------------------------------------------------------------
Table and Insert SQL Script :
-------------------------------------------------------------------------
create table job_positions
(
id int,
title varchar(100),
groups varchar(10),
levels varchar(10),
payscale int,
totalpost int
);
insert into job_positions values (1, 'General manager', 'A', 'l-15', 10000, 1);
insert into job_positions values (2, 'Manager', 'B', 'l-14', 9000, 5);
insert into job_positions values (3, 'Asst. Manager', 'C', 'l-13', 8000, 10);
create table job_employees
(
id int,
name varchar(100),
position_id int
);
insert into job_employees values (1, 'John Smith', 1);
insert into job_employees values (2, 'Jane Doe', 2);
insert into job_employees values (3, 'Michael Brown', 2);
insert into job_employees values (4, 'Emily Johnson', 2);
insert into job_employees values (5, 'William Lee', 3);
insert into job_employees values (6, 'Jessica Clark', 3);
insert into job_employees values (7, 'Christopher Harris', 3);
insert into job_employees values (8, 'Olivia Wilson', 3);
insert into job_employees values (9, 'Daniel Martinez', 3);
insert into job_employees values (10, 'Sophia Miller', 3);
#SQL #SQLInterviewQuestionsandanswers #sqlInterviewQuestions #ITJunction4All

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@AdityaKaajol
@AdityaKaajol Месяц назад
Great question.. even though by looking at it initially, I understood this will be done by Recursive CTE , but it took me some time to set this logic up
@ItJunction4all
@ItJunction4all 27 дней назад
Thank you ! With continuous practice, you will be able to build logic faster.
@vijay.s-ll1yq
@vijay.s-ll1yq 4 месяца назад
with calculations as (select id,title,groups,levels,payscale,totalpost,1 as rnk from job_positions union all select id,title,groups,levels,payscale,totalpost,rnk+1 from calculations where rnk+1
@mohdhammadkhan5570
@mohdhammadkhan5570 6 месяцев назад
sir your playlist is amazing
@ItJunction4all
@ItJunction4all 6 месяцев назад
Thank you so much 😍
@arjunkandoth2580
@arjunkandoth2580 6 месяцев назад
🔥🔥🔥
@ItJunction4all
@ItJunction4all 5 месяцев назад
Thanks Arjun for liking the video !
Далее
#kikakim
00:10
Просмотров 8 млн