Рет қаралды 8,141
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