SQL | LeetCode 1661. Self Join + GROUP BY
·
Computer Science/SQL
공장 내 여러 머신이 여러 개의 프로세스를 처리하며, 각 프로세스는 시작(start)과 종료(end) 시각을 갖고 있습니다. 각 머신별 평균 처리 시간(end - start)을 계산해야 합니다.Table: Activity+----------------+---------+| Column Name | Type |+----------------+---------+| machine_id | int || process_id | int || activity_type | enum || timestamp | float |+----------------+---------+The table shows the user activities for a factory w..
SQL | LeetCode 197. 셀프 조인(Self Join)과 DATE_ADD를 활용한 날짜 비교 문제
·
Computer Science/SQL
기온 데이터가 저장된 Weather 테이블이 주어졌을 때, 전날보다 더 따뜻했던 날짜의 id를 구하는 문제입니다.Table: Weather+---------------+---------+| Column Name | Type |+---------------+---------+| id | int || recordDate | date || temperature | int |+---------------+---------+id is the column with unique values for this table.There are no different rows with the same recordDate.This table contains informat..
SQL | LeetCode 1581. 방문은 했지만 거래는 없던 고객 찾기 (RIGHT JOIN & GROUP BY 예제)
·
Computer Science/SQL
이 포스팅에서는 RIGHT JOIN을 활용해 거래가 일어나지 않은 고객 방문을 찾아보겠습니다. 일반적으로 LEFT JOIN이 더 익숙하겠지만, RIGHT JOIN으로도 같은 문제를 해결할 수 있습니다.Table: Visits+-------------+---------+| Column Name | Type |+-------------+---------+| visit_id | int || customer_id | int |+-------------+---------+visit_id is the column with unique values for this table.This table contains information about the customers who visited th..
SQL | LeetCode 1683. 문자열 길이 함수
·
Computer Science/SQL
Table: Tweets+----------------+---------+| Column Name | Type |+----------------+---------+| tweet_id | int || content | varchar |+----------------+---------+tweet_id is the primary key (column with unique values) for this table.content consists of alphanumeric characters, '!', or ' ' and no other special characters.This table contains all the tweets in a social media app...
SQL | LeetCode 584. 조건문으로 필터링하기
·
Computer Science/SQL
Table: Customer+-------------+---------+| Column Name | Type |+-------------+---------+| id | int || name | varchar || referee_id | int |+-------------+---------+In SQL, id is the primary key column for this table.Each row of this table indicates the id of a customer, their name, and the id of the customer who referred them. Find the names of the customer that are not..
올리브한입
'leetcode' 태그의 글 목록 (6 Page)