Posts

Showing posts from October, 2024

how to find salary in linq

https://youtube.com/shorts/cfdwiuK8SO4?si=9CobFUcaZ3YYC89-

Finding 2nd and 3rd Highest and Lowest Salaries Using LINQ

Finding 2nd and 3rd Highest and Lowest Salaries Using LINQ 1. 2nd Highest Salary: var secondHighestSalary = employees     .OrderByDescending(e => e.Salary)     .Select(e => e.Salary)     .Distinct()     .Skip(1)     .FirstOrDefault(); 2. 3rd Highest Salary: var thirdHighestSalary = employees     .OrderByDescending(e => e.Salary)     .Select(e => e.Salary)     .Distinct()     .Skip(2)     .FirstOrDefault(); 3. 2nd Lowest Salary: var secondLowestSalary = employees     .OrderBy(e => e.Salary)     .Select(e => e.Salary)     .Distinct()     .Skip(1)     .FirstOrDefault(); 4. 3rd Lowest Salary: var thirdLowestSalary = employees     .OrderBy(e => e.Salary)     .Select(e => e.Salary)     .Distinct()     .Skip(2)     .FirstOrDefault();

Finding 2nd and 3rd Highest and Lowest Salaries Using SQL

Finding 2nd and 3rd Highest and Lowest Salaries Using SQL 1. 2nd Highest Salary: SELECT MAX(Salary)  FROM Employee  WHERE Salary < (SELECT MAX(Salary) FROM Employee); 2. 3rd Highest Salary: SELECT MAX(Salary)  FROM Employee  WHERE Salary < (SELECT MAX(Salary)  FROM Employee WHERE Salary < (SELECT MAX(Salary) FROM Employee)); 3. 2nd Lowest Salary: SELECT MIN(Salary)  FROM Employee  WHERE Salary > (SELECT MIN(Salary) FROM Employee); 4. 3rd Lowest Salary: SELECT MIN(Salary)  FROM Employee  WHERE Salary > (SELECT MIN(Salary)  FROM Employee WHERE Salary > (SELECT MIN(Salary) FROM Employee)); @sqlserver @sql #dotnettechpro

Sonar qube for code scan

🚀 Ensure Code Quality with SonarQube! 🚀 As developers, maintaining high-quality code is crucial to delivering robust and maintainable software. 💻✨ One powerful tool I use to ensure code quality and eliminate code smells is SonarQube. SonarQube is an open-source platform that performs static code analysis to detect: 🔸 Code Smells 🔸 Bugs 🔸 Security Vulnerabilities 🔸 Technical Debt Here's how you can integrate SonarQube into your .NET projects: 1. Install SonarQube locally or use it on the cloud. 2. Analyze your codebase by integrating SonarQube with your CI/CD pipeline (Azure DevOps, GitHub Actions, Jenkins, etc.). 3. Get insights into code smells, security issues, and improvements with detailed reports. Using SonarQube has helped me catch early bugs and write cleaner code, which ultimately results in more efficient and maintainable applications. 🛠️ Takeaway: Embrace tools like SonarQube for better code quality and seamless delivery! #DotNetTechPro #SonarQube #CodeQuality #Cl...