CASE WHEN END STATEMENTS with Aggregates Group by IN SQL | Advanced SQL | Ashutosh Kumar
Ashutosh Kumar Ashutosh Kumar
20.1K subscribers
2,570 views
93

 Published On Sep 10, 2023

Sql one of the most important language asked in most of the analytics interviews,in this series i have discussed some advanced level sql concepts that are frequently asked in data analyst,business analyst interviews. In this video i have covered CASE WHEN END STATEMENTS concepts in sql

👉Query -

1)

drop table if exists table1;
CREATE TABLE table1( sid integer,score integer);

INSERT INTO table1( sid,score)
VALUES
('1','72'),
('2','16'),
('3','69'),
('4','43'),
('5','23');

2)

drop table if exists table2;
CREATE TABLE table2(orderid integer,stateid varchar(200),status varchar(200),amount integer);

INSERT INTO table2(orderid,stateid,status,amount)
VALUES
('1','s1','shipped','67050'),
('2','s2','delivered','68608'),
('3','s3','packed','62545'),
('4','s2','shipped','54033'),
('5','s1','delivered','39284'),
('6','s2','shipped','80372'),
('7','s2','delivered','66399'),
('8','s3','packed','48914'),
('9','s1','packed','95459'),
('10','s1','delivered','70493'),
('11','s2','delivered','58017'),
('12','s3','packed','80360'),
('13','s1','delivered','90328'),
('14','s3','shipped','32283'),
('15','s2','packed','62551'),
('16','s3','packed','18273'),
('17','s2','shipped','46131'),
('18','s1','packed','18713');
------------------------------------------------------------------

👉 Complete playlist on Sql Interview questions and answers
   • HackerRank SQL problems and solution  

---------------------------------------------------------------------------------------------------------------------
Check out some more relevant content here

👉 How to Learn SQL
   • How to learn sql for beginners | Step...  

👉 How to become a business analyst complete roadmap-
   • Business Analyst Complete Roadmap in ...  

👉 How to become a data analyst complete roadmap-
   • Data Analyst Complete Roadmap in 2022...  

👉 Top 3 you tube channels to learn sql for free for beginners
   • Video  

👉 Rank ,Dense Rank, Row Number in sql -
   • RANK - DENSE RANK - ROW NUMBER IN SQL  

👉 Cross join in sql
   • CROSS JOIN SQL  

👉 union join in sql
   • UNION IN SQL  

👉 left join in sql
   • LEFT JOIN IN SQL  

👉 Right join in sql
   • RIGHT JOIN IN SQL  

👉 Inner join in sql
   • INNER JOIN IN SQL  

👉 Introduction to tables and databases in sql -
   • INTRO TO TABLES AND DATABASES IN SQL ...  

👉 Aggregate Function in sql
   • AGGREGATE FUNCTION IN SQL  

👉 Functions in sql-
   • IMPORTANT FUNCTIONS IN SQL  

👉 String Function in sql
   • STRING FUNCTIONS IN SQL  

👉 CRUD operations in sql
   • CREATE- READ- UPDATE-DELETE CRUD IN SQL  

👉 Autoincrement in sql
   • Auto Increment in SQL - SQL  

👉 Primary Key in sql-
   • PRIMARY KEYS IN SQL - SQL  

👉 Null and Default values in sql-
   • NULL AND DEFAULT VALUES IN SQL - SQL  

👉 Data types in sql-
   • Data types in Sql - SQL  

____________________________________________________________________

Fill the form below to subscribe yourself to the analytics jobs mailing list to receive regular job opening updates - https://docs.google.com/forms/d/e/1FA...

Why you should definitely fill the analytics job updates google form -    • Job Openings into business analyst da...  

_______________________________________________________________________
Connect with me


📸Instagram -   / ashutosh.analytics  
💻Linkedin-   / ashutoszh  

_____________________________________________________________________

Comment down if you have any doubts
Please leave a LIKE 👍 and SUBSCRIBE ❤️ to my channel to receive more amazing content in data analytics and data science.

_____________________________________________________________________

🏷️ Tags

sql,
sql for data science,
sql for data analytics,
sql practise questions,
sql practise questions and solutions,
sql tutorials for beginners,
sql problems for data engineers,
ashutosh,
ashutosh kumar,
ashutosh kumar analytics,
sql problems easy,
sql problem medium,
sql problems hard,
sql window functions,
sql advanced questions,
rank functions in sql,
lag lead in sql,
sql interview questions and answers,
sql interview questions,
sql questions asked in interviews,
hackerrank sql solutions,
hackerearth sql solutions,
leetcode sql solution

🏷️HashTags

#sql #interviews #questions #solutions

show more

Share/Embed