전체 글
-
leetcode - 2394. Employees With DeductionsSQL 문제풀이 2022. 9. 21. 15:59
난이도 : Medium Table: Employees +--------------+------+ | Column Name | Type | +--------------+------+ | employee_id | int | | needed_hours | int | +--------------+------+ employee_id is the primary key for this table. Each row contains the id of an employee and the minimum number of hours needed for them to work to get their salary. Table: Logs +-------------+----------+ | Column Name | Type | +-..
-
leetcode - 2388. Change Null Values in a Table to the Previous ValueSQL 문제풀이 2022. 9. 21. 15:42
난이도 : Medium Table: CoffeeShop +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | drink | varchar | +-------------+---------+ id is the primary key for this table. Each row in this table shows the order id and the name of the drink ordered. Some drink rows are nulls. Write an SQL query to replace the null values of drink with the name of the drink of the pr..
-
leetcode - 2372. Calculate the Influence of Each SalespersonSQL 문제풀이 2022. 9. 21. 15:12
난이도 : Medium Table: Salesperson +----------------+---------+ | Column Name | Type | +----------------+---------+ | salesperson_id | int | | name | varchar | +----------------+---------+ salesperson_id is the primary key for this table. Each row in this table shows the ID of a salesperson. Table: Customer +----------------+------+ | Column Name | Type | +----------------+------+ | customer_id | i..
-
leetcode - 2346. Compute the Rank as a PercentageSQL 문제풀이 2022. 9. 21. 15:08
난이도 : Medium Table: Students +---------------+------+ | Column Name | Type | +---------------+------+ | student_id | int | | department_id | int | | mark | int | +---------------+------+ student_id is the primary key of this table. Each row of this table indicates a student's ID, the ID of the department in which the student enrolled, and their mark in the exam. Write an SQL query that reports t..
-
leetcode -2324. Product Sales Analysis IVSQL 문제풀이 2022. 9. 20. 21:49
난이도 : Medium Table: Sales +-------------+-------+ | Column Name | Type | +-------------+-------+ | sale_id | int | | product_id | int | | user_id | int | | quantity | int | +-------------+-------+ sale_id is the primary key of this table. product_id is a foreign key to Product table. Each row of this table shows the ID of the product and the quantity purchased by a user. Table: Product +--------..
-
leetcode - 2314. The First Day of the Maximum Recorded Degree in Each CitySQL 문제풀이 2022. 9. 20. 21:37
난이도 : Medium Table: Weather +-------------+------+ | Column Name | Type | +-------------+------+ | city_id | int | | day | date | | degree | int | +-------------+------+ (city_id, day) is the primary key for this table. Each row in this table contains the degree of the weather of a city on a certain day. All the degrees are recorded in the year 2022. Write an SQL query to report the day that has..
-
leetcode -2308. Arrange Table by GenderSQL 문제풀이 2022. 9. 20. 21:29
난이도 : Medium Table: Genders +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | gender | varchar | +-------------+---------+ user_id is the primary key for this table. gender is ENUM of type 'female', 'male', or 'other'. Each row in this table contains the ID of a user and their gender. The table has an equal number of 'female', 'male', and 'other'. Wri..
-
leetcode - 1767. Find the Subtasks That Did Not ExecuteSQL 문제풀이 2022. 9. 20. 14:07
난이도 : Hard Table: Tasks +----------------+---------+ | Column Name | Type | +----------------+---------+ | task_id | int | | subtasks_count | int | +----------------+---------+ task_id is the primary key for this table. Each row in this table indicates that task_id was divided into subtasks_count subtasks labeled from 1 to subtasks_count. It is guaranteed that 2