Master LeetCode #185 (Department Top Three Salaries) with a step-by-step SQL solution using DENSE_RANK(). Learn the approach, query explanation, and interview tips for SQL, .NET, and Data Engineering interviews.
Practical tips, tutorials & insights from the .NET Ecosystem 🚀 { C# • ASP.NET Core • Azure • Angular • AI-Assisted Dev } Building smarter with Cursor AI & GitHub Copilot ⚡
Master LeetCode #185 (Department Top Three Salaries) with a step-by-step SQL solution using DENSE_RANK(). Learn the approach, query explanation, and interview tips for SQL, .NET, and Data Engineering interviews.
Here, I am taking an example of a Product. We have different types of products, so I want to generate a new ProductId using a prefix of value like the below:
Question:
Query all columns (attributes) for every row in the CITY table.
Question:
Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA.
QUESTION:
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
SQL 126 | yyyy-mm-ddThh:mi:ss.mmm | ISO8601 DateTime Format
Declare @ADate Date,
@ATime Time
Select @ADate='2021-07-12', @ATime='9:05 AM'
Select @ADate AS ADate, @ATime AS ATime
SELECT CONVERT(VARCHAR, CAST(CONVERT(Varchar(15), @ADate, 112) + ' ' + CONVERT(Varchar(8), @ATime) AS DATETIME), 126) AS [SQL ISO8601 DateTime Format]