Tag: SQL Coding Exercise
Let’s suppose we have a table containing two columns ID and sex, and our task is to swap the values of sex i.e. from ‘f’ to ‘m’ and from …
Submit your solution: https://leetcode.com/problems/department-highest-salary/ As seen, two tables, you are asked to list the highest salary for each department and the employee name. However, if there are two or …
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +----+------------------+ | Id | Email …
Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates. +---------+------------+------------------+ | Id(INT) | Date(DATE) | Temperature(INT) …
Submit your SQL to Leetcode online judge: https://oj.leetcode.com/problems/rank-scores/ Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. …