No video

SQL Interview Question - Solution (Part - VII) | Data Analyst | Data Engineer Interviews

  Рет қаралды 408

MeanLifeStudies

MeanLifeStudies

Күн бұрын

#sql #dataengineers #dataanalyst #interview #datascience #sqlinterveiw
#sqlfunctions
Here are My profiles that will definitely help your preparation for data analyst or data engineer roles.
Medium: / mahendraee204
Github: github.com/mah...
Do you want to clear your doubts about becoming a data analyst/data engineer or any guidance you require? don't hesitate to book a call at Topmate with lower prices. The link is mentioned below.
Topmate.io :- Topmate.io/mahendra204
Here are the create and insert statements for the given data:
-------------------------------------------------------------------------------------------
create table bookings(
Booking_id varchar(5)
,Booking_date date
,userid varchar(5)
,Line_of_business varchar(10)
);
insert into bookings values ('b1','2022-05-23','u1','Flight'),
('b2','2022-05-27','u2','Flight'),('b3','2022-03-28','u1','Hotel'),
('b4','2022-02-11','u4','Flight'),('b5','2022-04-02','u1','Hotel'),('b6','2022-04-02','u2','Flight'),
('b7','2022-01-26','u5','Flight'),('b8','2022-03-06','u6','Hotel'),('b9','2022-05-06','u2','Flight'),
('b10','2022-07-10','u1','Flight'),('b11','2022-04-12','u4','Flight'),('b12','2022-05-16','u1','Flight'),
('b13','2022-08-19','u2','Flight'),('b14','2022-04-20','u5','Hotel'),('b15','2022-08-22','u6','Flight'),
('b16','2022-02-26','u4','Hotel'),('b17','2022-03-28','u2','Hotel'),('b18','2022-07-30','u1','Hotel');
('b19','2022-04-04','u4','Hotel'),
('b20','2022-05-06','u1','Flight');
create table users(userid varchar(5) ,Slot varchar(5))
insert into users values ('u1','s1'),('u2','s1'), ('u3','s1'),('u4','s2'),
('u5','s2'),('u6','s3'), ('u7','s3'),('u8','s3'),('u9','s3'), ('u10','s3');

Пікірлер: 5
@VARUNTEJA73
@VARUNTEJA73 2 ай бұрын
with cte as( select userid,booking_date, dense_rank()over(partition by month(booking_date),userid order by booking_date)ranks from bookings group by userid,booking_date,booking_id) select userid,month(booking_date)as month from cte where ranks>2
@VARUNTEJA73
@VARUNTEJA73 2 ай бұрын
In result Is any problem occurs when we use two columns in partition sir ?
@MeanLifeStudies
@MeanLifeStudies 2 ай бұрын
No
@VARUNTEJA73
@VARUNTEJA73 2 ай бұрын
Ok sir tqs for reply
@saravanansevanan
@saravanansevanan 14 күн бұрын
select userid from ( select *, count(booking_id) over(partition by userid, extract(month from booking_date) order by booking_date) as cunt_of_tick_booking from bookings_mls) where cunt_of_tick_booking > 2
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 20 МЛН
Oh No! My Doll Fell In The Dirt🤧💩
00:17
ToolTastic
Рет қаралды 9 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 15 МЛН
Top 10 Data Analyst Interview Questions (with answers)
15:58
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 20 МЛН