No video

#sql

  Рет қаралды 7,858

Daily life of a Data Engineer

Daily life of a Data Engineer

Жыл бұрын

Hi All,
This is Ankit Shrivastava and I am working as Data Engineer.
Today this #vlog is regarding mostly asked #sql #sqlinterviewquestions .
This #vlog is regarding how we can schedule cricket match between teams and generate points table.
This is very interesting SQL interview question having very simple approach.
In this video I have used self join to case statement to generate the required output.
Please find the below complete DDL for practice
CREATE TABLE CRICKET_TEAMS(
COUNTRY VARCHAR(50)
);
INSERT INTO CRICKET_TEAMS VALUES('India');
INSERT INTO CRICKET_TEAMS VALUES('Pakistan');
INSERT INTO CRICKET_TEAMS VALUES('England');
INSERT INTO CRICKET_TEAMS VALUES('Australia');
CREATE TABLE SUMMARY(
TEAM_1 VARCHAR(20),
TEAM_2 VARCHAR(20),
winner VARCHAR(20)
);
INSERT INTO SUMMARY VALUES('India','Pakistan','India');
INSERT INTO SUMMARY VALUES('India','England','India');
INSERT INTO SUMMARY VALUES('India','Australia',null);
INSERT INTO SUMMARY VALUES('Pakistan','England','England');
INSERT INTO SUMMARY VALUES('Pakistan','Australia','Pakistan');
INSERT INTO SUMMARY VALUES('England','Australia','Australia');
#sqlinterviewquestions #sqlinterviewquestionsandanswers
#sql #innerjoin #leftjoin #rightjoin #fullouterjoin
#trendinginterview #interview #oracle #interviewtips #mysql #interviewready #interviewpreparation #sqljoins #null #notnull
#sqlserver #sqlservermanagementstudio #etltesting #databaseexercises #databasetesting #testing #data #dataengineering #dataengineer #twitter #elonmusk #sqlserverdba #microsoft #postgresql #postgresql #value #null #ipl #worldcup #t20worldcup #cricket #australia #india #pakistan #england #cricketmatch #amazon #netflix #meta #facebook #google #apple #tcs #infosys #software #selfjoin #bigdata

Пікірлер: 10
@nikhilhimanshu9758
@nikhilhimanshu9758 5 ай бұрын
row_number is better but nice try sir
@saurabhshukla2605
@saurabhshukla2605 Жыл бұрын
Hi this was a great video. But one suggestion for part one, instead of using case for country_id you can directly use ROW_NUMBER which does the same thing. Gives unique ID for each row.
@dailylifeofadataengineer7742
@dailylifeofadataengineer7742 Жыл бұрын
Thank you Saurbh, that's awesome
@AtulSingh-be1jk
@AtulSingh-be1jk Жыл бұрын
Please make a video to create a procedure for it.
@dailylifeofadataengineer7742
@dailylifeofadataengineer7742 Жыл бұрын
Sure Atul
@AtulSingh-be1jk
@AtulSingh-be1jk Жыл бұрын
Hi.. Suppose,i have a table 'A' with five child table namely 'B','C','D','E','F'. Now,i like to delete the records of 'A' directly without deleting the child table one by one. Here,the problem is that out of those five child tables one or more can have also child tables.So,it is very difficult to go one by one and delete the all child tables followed by parent table. Also,there is possibilities of adding one or more child table to any of those tables described above in later point of time.In that case my query which is developed at this moment will not work and i would get error of ''INTEGRITY CONSTRAINT VIOLATION''. Also,there is no provision of ''on delete cascade'' as per our available data model and also it can't be modified right now. So,please kindly help me to resolve the issue of deleting parent record without deleting the immediate child tables one by one and also the associated child tables of the immediate child tables if any one by one.
@dailylifeofadataengineer7742
@dailylifeofadataengineer7742 Жыл бұрын
Sure, I will create video in this very soon
@AtulSingh-be1jk
@AtulSingh-be1jk Жыл бұрын
Thanks for the reply sir
@chenmaykulkarni6886
@chenmaykulkarni6886 Жыл бұрын
How can contact with you
@dailylifeofadataengineer7742
@dailylifeofadataengineer7742 Жыл бұрын
Hi Chenmay Please connect with me on LinkedIn www.linkedin.com/in/ankit-shrivastava-5262561a/
#SQL Interview Question - How to delete duplicate record from table
11:08
Daily life of a Data Engineer
Рет қаралды 1,7 М.
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 66 МЛН
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 8 МЛН
The 25 SQL Questions You MUST Know for Data Analyst Interviews
32:47
KSR Datavizon
Рет қаралды 205 М.