Exchanging seats of adjacent students | LEAD | LAG | SQL Problem Solving

Published: 23 August 2023
on channel: Rahul Upadhya
961
57

In this SQL problem solving session, we work on the problem to swap the seats of adjacent students using window functions - LEAD and LAG.

Table creation & insertion script:
CREATE TABLE student_info(
seat_id INT,
student_name VARCHAR(100)
);

INSERT INTO student_info VALUES(1,'Parvati'),
(2,'Rajesh'),
(3,'Aryan'),
(4,'Supriya'),
(5,'Prakash');

#sql #problemsolving #sqlprogramming #interview


Watch video Exchanging seats of adjacent students | LEAD | LAG | SQL Problem Solving online without registration, duration hours minute second in high quality. This video was added by user Rahul Upadhya 23 August 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 96 once and liked it 5 people.