Forum

Posted by Esin Seçil, Feb. 5, 2024, 7:18 a.m.

Unpopular movies

Hello,

Firstly, Thank you so much for the nice environment for learning SQL better. 

I forced the question that I tpye the title above.

My question is there any other solving method instead of CTEs. For example; I tried to solve it by using JOINs. But, I confused. 

Could you please explain id there is any other method?

 

PS: Do you recommend me to develop by subquery by using IN operator.

 

Best regards

Esin

Answers

Hi Esin,

Thank you for using SQLPad. We're delighted to hear that you've found it beneficial, and we greatly appreciate your kind words.

Indeed, there are alternative approaches to addressing this issue. We recommended using Common Table Expressions (CTEs) primarily because they enhance the readability and comprehensibility of your code. This aspect is crucial, especially during interviews, where presenting code that is clear and easy to understand can significantly impact your success.

Regarding the use of subqueries with the IN operator, I would generally advise against it. The main drawback is that you often cannot leverage indexing with subqueries, making them less efficient.

Should you have any further inquiries, please do not hesitate to reach out. My team and I monitor this forum daily and are committed to providing thorough answers to all your questions.

-Leon

SQLPad user avatar

Leon (949)

Feb. 5, 2024, 9:21 a.m.