262. Trips and Users
Table: Trips
Trips
+-------------+----------+| Column Name | Type |+-------------+----------+| Id | int || Client_Id | int || Driver_Id | int || City_Id | int || Status | enum ||…
601. Human Traffic of Stadium
Table: Stadium
Stadium
+---------------+---------+| Column Name | Type |+---------------+---------+| id | int || visit_date | date || people | int |+---------------+---------+visit_date is…
49. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
strs
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the…
586. Customer Placing the Largest Number of Orders
Query the customer_number from the orders table for the customer who has placed the largest number of orders.
It is guaranteed that exactly one customer will have placed more orders than any other…
585. Investments in 2016
Write a query to print the sum of all total investment values in 2016 (TIV_2016), to a scale of 2 decimal places, for all policy holders who meet the following criteria:
584. Find Customer Referee
Given a table customer holding customers information and the referee.
customer
+------+------+-----------+| id | name | referee_id|+------+------+-----------+| 1 | Will | NULL || 2 | Jane | NULL || 3 | Alex |…
580. Count Student Number in Departments
A university uses 2 data tables, student and department, to store data about its students and the departments associated with each major.
579. Find Cumulative Salary of an Employee
The Employee table holds the salary information in a year.
Write a SQL to get the cumulative sum of an employee’s salary over a period of 3 months but exclude the most recent month.
571. Find Median Given Frequency of Numbers
The Numbers table keeps the value of number and its frequency.
Numbers
+----------+-------------+| Number | Frequency |+----------+-------------|| 0 | 7 || 1 | 1 || 2 |…
570. Managers with at Least 5 Direct Reports
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.
Employee
+------+----------+-----------+----------+|Id |Name |Department…