본문 바로가기

SQL

(152)
[SQL] Confirmation Rate(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Confirmation Rate 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/confirmation-rate/description/ 2. 문제 Column name Type user_id int time_stamp datetime Column name Type user_id int time_stamp datetime action ENUM [문제] Write a solution to find the confirmation rate of each user. 각 사용자의 confirmation rate를 구하는 문제입니다. 3. 제출 쿼리 및..
[SQL] Count Salary Categories(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Count Salary Categories 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/count-salary-categories/description/ 2. 문제 Column name Type account_id int income int [문제] Write a solution to calculate the number of bank accounts for each salary category. The salary categories are: "Low Salary": All the salaries strictly less than $2..
[SQL] The Latest Login in 2020(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 The Latest Login in 2020 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/the-latest-login-in-2020/description/ 2. 문제 Column name Type user_id int time_stamp datetime [문제] Write a solution to report the latest login for all users in the year 2020. Do not include the users who did not login in 2020. 2020년 모든 사용자에 대한 최신 로그인 시간을..
[SQL] Calculate Special Bonus(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Calculate Special Bonus 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/calculate-special-bonus/description/ 2. 문제 Column name Type employee_id int name varchar salary int [문제] Write a solution to calculate the bonus of each employee. The bonus of an employee is 100% of their salary if the ID of the employee is an odd number..
[SQL] Rearrange Products Table(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Rearrange Products Table 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/rearrange-products-table/description/ 2. 문제 Column name Type product_id int store1 int store2 int store3 int [문제] Write a solution to rearrange the Products table so that each row has (product_id, store, price). If a product is not available in a store,..
[SQL] Primary Department for Each Employee(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Primary Department for Each Employee 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/primary-department-for-each-employee/description/ 2. 문제 Column name Type employee_id int department_id int primary_flag varchar [문제] Employees can belong to multiple departments. When the employee joins other departments, they need to decide..
[SQL] Find Total Time Spent by Each Employee(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 Find Total Time Spent by Each Employee 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/find-total-time-spent-by-each-employee/description/ 2. 문제 Column name Type emp_id int event_day date in_time int out_time int [문제] Write a solution to calculate the total time in minutes spent by each employee on each day at the office. No..
[SQL] The Number of Employees Which Report to Each Employee(LeetCode/Oracle) 안녕하세요! 이번 포스팅은 LeetCode에 있는 The Number of Employees Which Report to Each Employee 문제를 OracleDB로 풀어보려고 합니다! (모든 문제는 Oracle로 풀이하겠습니다.) 1. 문제 링크 : https://leetcode.com/problems/the-number-of-employees-which-report-to-each-employee/description/ 2. 문제 Column name Type employee_id int name varchar reports_to int age int [문제] For this problem, we will consider a manager an employee who has at least 1 o..