Комментарии:
Hi @techTFQ! In problem 10, Why are we not considering a case where order status is submitted and created for same user (3rd statement in the union)??
ОтветитьExcellent questions Toufiq , covers quite a bit of SQL innards
ОтветитьHi Toufiq!!
All question are so interesting. I just found few things which effects the query.
Q1) The table has only 2 duplicate rows, assume if table has 3 duplicate rows then sol 1 and sol 2 won't work as it will select MAX() and MIN() model_id. Here most accurate sol is sol 3 using ROW_NUMBER().
Q7) In this to write negative amount as (amount$), || won't work in MYSQL instead CONCAT() can be used.
Please Explain query No. 6 in detail.
ОтветитьPls make query tuning videos..
ОтветитьHi, Can cross join be used to solve query no 6 (Part 1)?
SELECT T1.team_code, T2.team_code FROM teams T1 CROSS JOIN teams T2
ON T1.team_code=T2.team_code
Query 4 -
select t2.source,t1.destination,t1.distance from src_dest_distance t1 left join src_dest_distance t2 on t1.source = t2.destination where t2.source IS NOT NULL
Can you make videos on sql developer
Road map to be a sql developer please
Please make a video about data execution in sql server, how to identify bad or good ( efficient or inefficient queries) , how the cost of query in percent matters
ОтветитьHi tfq plz can u explain slowly i cannot catch you
ОтветитьThank you , bahut sikhne ko milta he , aur questions late raho 👌👍
ОтветитьQuery 2 can also be written as, a small change
Select *,
max(salary) over (partition by dept order by salary desc ) as highest_salary,
min(salary) over (partition by dept order by salary) as lowest_salary
from employee;
in your vlog employee table creation script is not working for 2019 version ,fyi
ОтветитьBest video, I have faced a few of these exact questions from this video in my interviews. Thank you @techTFQ
ОтветитьHi Taufiq When will you start Python Bootcamp let me know pls
ОтветитьHi, I've been working as a programmer for about two years in a financial company. However, I still struggle with understanding complex queries. While I get the few chance to write queries at work, there are instances where I need to read long queries, sometimes exceeding 500 sentences, due to unexpected circumstances.
I genuinely make an effort to read and comprehend them, but when multiple challenging grammar concepts like outer joins and subqueries are used together, I find it difficult to grasp. In this situation, what should I focus on learning to improve my ability to read complex and lengthy query sentences? I really want to enhance my skills in this area.
Hi Toufiq. Thanks a lot for providing so many useful examples on solving SQL. I have been learning quite a lot from your videos and your SQL / python courses. Really appreciate for these courses and videos that you have done for us. Also, thanks for introducing the learnSQL website to us. I have registered for the life time eLearning also. Also, you are the best teacher I've met on learning SQL. Hope you continue to make these quality and useful video for us. Keep going brother 👍
From Tony
1) with cte AS(select *, dense_rank() over(order by model_name, color, brand) from cars),
cte2 as
(select distinct model_name, color, brand from cte)
select distinct min(a.model_id) over(partition by a.model_name, a.color, a.brand), b.model_name, b.color, b.brand from cte a right join cte2 b
on a.model_name=b.model_name and a.color=b.color and a.brand=b.brand
order by model_id
2)with cte AS
(select *, dense_rank() over(partition by dept order by salary desc, name) as ranks, max(salary) over(partition by dept) as highest, min(salary) over(partition by dept)
as lowest from employee)
select id, name, dept, salary, highest, lowest from cte
3)with cte AS(select *, lag(cumulative_distance) over(partition by cars) as distance from car_travels),
cte2 as
(select *, (cumulative_distance-distance) as diff from cte)
select cars, days, cumulative_distance, case when diff is null then cumulative_distance else diff
end as distance_travelled
from cte2
4)with cte AS
(SELECT
min(SOURCE, DESTINATION) AS MinValue,
max(SOURCE, DESTINATION) AS MaxValue,
distance
FROM src_dest_distance)
select DISTINCT * from cte
5)WITH RECURSIVE FruitRecursion AS (
SELECT id, item_name, total_count
FROM travel_items
UNION ALL
SELECT id, item_name, total_count - 1
FROM FruitRecursion
WHERE total_count > 1
)
SELECT id, item_name
FROM FruitRecursion
order by item_name
6)a)select distinct a.team_name as A1, b.team_name as B1
from teams a CROSS JOIN teams b
where a.team_name<b.team_name
b)select distinct a.team_name as A1, b.team_name as B1
from teams a CROSS JOIN teams b
where a.team_name!=b.team_name
hi toufiq plz do more videos on data analytics and how to do more analytical work with excel.plz plz
ОтветитьThank you Amazing content
ОтветитьCan I know which IDE do you use for SQL?
ОтветитьFor question 4 we can do like this also
with cte as (
select *, row_number() over(order by (select null)) as rn from src_dest_distance)
select source,destination,distance from cte
where rn%2<>0
is that free coures or with paying
ОтветитьAnother quality content from Techtfq👌👌👏 Keep going brother🙌
ОтветитьHaven't seen any channel creating this gold level across platform
ОтветитьThank you Thoufiq, Really leaned a lot from you.
ОтветитьAwesome content as usual!
Ответитьthe perfect video i never know i needed
ОтветитьSolved 0/10 queries... Its bit hard for beginner like me to learn sql
Ответитьfor query 4 u forgot order by clause
with cte as (
SELECT *, ROW_NUMBER() OVER(order by source) AS RN
FROM src_dest_distance)
select t1.source,t1.destination,t1.distance, t1.RN
from cte t1
join cte t2
on t1.source = t2.destination
and t1.destination = t2.source
and t1.RN < t2.RN
Thank you very much for such detailed info
ОтветитьAlways a privilege for learners to get your video … You are doing a good service 👌God bless your efforts
ОтветитьIn the car duplicate question, you haven't mention color but if the color is different then it won't be a duplicate one right..then is it right to delete the record without considering color?
Please clarify
Hi Toufiq! I have gone through SQL course from the beginning to brush up my skills and all the concepts. In the recent interview, I cleared all the technical rounds and I got placed last week with a good hike. Your videos and your teaching helped me a lot.! I am really Happy! Please keep going. God bless you!
ОтветитьIs it for Oracle SQL?
ОтветитьHi taufiq! Can you make logical interview questions more?
ОтветитьReally Really Awesome !!
ОтветитьSir i want sql classes can you please provide me
ОтветитьDo you have any sql course
I want to learn sql to you.
Hey Toufeeq!
I have been trying buy your SQL recording from your website but it doesn't allow me to move forward from cart.
Can you fix this?
Always a pleasure to watch your videos Thofik. I m learning a lot from you .
ОтветитьSir I mailed you but didn't get any response from your side
ОтветитьNice thofiq
ОтветитьHi ☺️
Ответить