8 Tips & Pointers to solve SQL Complex Queries ! (BONUS Tip Included !)
HTML-код
- Опубликовано: 25 июл 2024
- In this video, we discuss some SQL tips to solve SQL Complex Queries.
Chapters #
0:00 Introduction
0:57 RANKING DATA
2:00 RUNNING / ROLLING SUM
2:50 PREV / NEXT VALUES
5:21 HIERARCHY - ALL LEVELS
6:18 IDENTIFY PAIRS
7:20 SEQUENCES OF DATA
8:58 CONDITIONAL COUNT
10:47 GENERATE DATA
Please find below the links to the related video tutorials -
Nth highest salary -
• SQL Interview Question...
Recursive CTE
• SQL | Recursive CTE | ...
Hierarchies
• SQL Interview - Employ...
• SQL Interview Question...
Self Join
• SQL Query | How to gen...
Conditional Count
• SQL | How to implement...
Running Totals
• SQL Query | How to cal...
• SQL Query | How to cal...
Prev/Next Records
• SQL Query | Compare wi...
• SQL Query | Compare mo...
Must Do Data Analytics Certifications -
Google Data Analytics Professional Certificate
imp.i384100.net/OR37oQ
Google Advanced Data Analytics Professional Certificate
imp.i384100.net/eK1WmQ
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Instagram - / learn.knowstar
Facebook - / knowstartrainings
Linkedin - www.linkedin.com/company/know...
Email - learn@knowstar.org
For practicing more SQL Complex Queries, you can check out the below video -
ruclips.net/video/E_6haE_10eE/видео.html
You provided very good tips. Waiting for the video on advanced tips!
Glad it was helpful.
Thanks for your videos thus far. If you don't have already, can you do a video explaining the difference/similarity between cte and sub-query(if any) and which one is better?
That’s a great suggestion. Thank you. We will plan a video soon.
Thank you for this video, specially for bonus tip... ✌️❤
Glad it was helpful.
Wowowowow very helpful tutorial
Glad it was helpful.
Helpful, can u please provide script to create tables and data along with all videos?? this will be more helpful to go along with your solutions. Thanks
Sure. We try to post the scripts with most of the videos.
thanks for the video. can you make the one for beginners, for instance how to get all fridays /sundays/mondays etc. of a year in sql? Thanks in advance🌹. 08.06.2023, 19:58
Hi,
I have questions, can you please give the solution for this.
We have office data related punch in and punch out data.
As a employee we used to go out from office multiple times for tea, snacks etc.
We need to find out time duration of a employee in a working day , how much time he was out of office.
Table Office:
Columns:
EmployeeId, starttimeofoffice,endtimeofoffice,punchIn, Punchout
Going forward plz make video on nested charindex and what does +1 and -1 in charindex means
We will definitely plan soon.
Table A (Student ID, Student Name, Student Age)
table B (Student ID, Student Class, Student Section)
Select Student Name, Student Class, Student Section where Student Age between 16 to 18 and Student Section is 'D' How to find out Mam ?
Hindi me banao jayada veiw hoga
We might plan Hindi videos in the future. Thank you.
@@LearnatKnowstar thanks madam but ek request h ki every step like crystal clear karwayega and why and where we use which type of approach so kindly please make Hindi regarding complex SQL
Thanks for response madam
Hello Mam, I have some questions that were asked in an interview, if possible please make a video on these questions
Question: 1
SELECT c.CustomerName, COUNT(o.OrderID) AS NumOrders
FROM Customers c
LEFT JOIN Orders o ON c.CustomerID = o.CustomerID
GROUP BY c.CustomerName
HAVING COUNT(o.OrderID) > 10
ORDER BY NumOrders DESC;
This query returns the names of all customers who have placed more than 10 orders, along with the number of orders they have placed. However, there is an issue with this query that needs to be resolved.
Can you identify the issue with this query and provide a solution to fix it?
Question: 2
Here's an example of a SQL query with some issues that need to be resolved:
SELECT *
FROM Orders
WHERE OrderDate >= '2022-01-01' AND OrderDate 1000
ORDER BY o.OrderDate DESC;
Can you identify the issue with this query and provide a solution to fix it?
Question 4:
Consider the following scenario:
You are working on a database application that stores sales data for a retail company. The database has two tables: "Sales" and "Products". The "Sales" table contains over 1 million rows and has the following columns: SaleID, ProductID, SaleDate, SaleAmount. The "Products" table contains over 10,000 rows and has the following columns: ProductID, ProductName, ProductCategory, UnitPrice.
Write a SQL query that retrieves the total sales amount for each product category for the current year. The query should return the following columns: ProductCategory, TotalSalesAmount.
Query should be optimizefor performance also.
.
Thank you for sharing the questions. We will plan to answer them soon.