전체 글

공부한 것, 배운 것들을 기록합니다
https://leetcode.com/problems/department-highest-salary/ Department Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 처음 짠 쿼리 SELECT Top.Name AS Department, E1.Name AS Employee, E1.Salary FROM Employee AS E1 INNER JOIN (SELECT D.Name, E.DepartmentId, MAX(Salary) AS S..
https://leetcode.com/problems/consecutive-numbers/ Consecutive Numbers - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Input : Table Logs Output : 처음 쿼리 : SELECT L1.Num AS ConsecutiveNums FROM Logs AS L1 INNER JOIN Logs AS L2 ON L1.Id+1 = L2.id INNER JOIN Logs AS L3 ON L1.Id + 2 ..
The Report - BETWEEN 범위 조건으로 JOIN 하기 report NOT : Names of those students who received a grade lower than 8. → if the grade is lower than 8, use "NULL" Ordering by grade in descending, than alphabetically More than one student with the same grade (1-7), ordering by marks in ascending order SELECT CASE WHEN G.grade >= 8 THEN S.Name ELSE NULL END AS Name, G.grade, S.Marks FROM Students S, Grades G..
파이썬 표준 라이브러리는 C로 구현된 시퀀스를 제공한다 1) 자료형에 따른 분류 컨테이너 시퀀스(Container Sequence): 객체에 대한 참조. 서로 다른 자료형의 항목을 담을 수 있음. list, tuple, collections.deque 규일 시퀀스(Flat Sequence): 자신의 메모리 공간에 각 항목의 값. 단 하나의 자료형만 담을 수 있음. str, bytes, bytearray, memoryview, array.array 2) 가변성에 따른 불류 가변 시퀀스 : list, bytearray, array.array, collections.deque, memoryview 불변 시퀀스 : tuple, str, bytes 지능형 리스트(list comprehension) colors =..
1. 문자열 표현 __repr__() 특별 메서드는 객체를 문자열로 표현하기 위해 repr() 내장 메서드에 의해 호출된다. __repr__() 메서드가 반환한 문자열은 명확해야 하며, 가능하면 표현된 객체를 재생성하는 데 필요한 소스 코드와 일치해야 한다. __repr__()와 __str__()을 비교하면, __str__() 메서드는 str() 생성자에 의해 호출되며 print()에 의해 암묵적으로 사용된다. __str__()은 사용자에게 보여주기 적당한 형태의 문자열을 반환해야 한다. 이 두 메서드 중 하나만 구현해야 하면 __repr__() 메서드를 구현하는 것을 추천한다. 파이썬 인터프리터는 __str__() 메서드가 구현되어 있지 않을 때의 대책으로 __repr__() 메서드를 호출하기 때문이다..
* 윈도우 기반으로 작성하였습니다. [Git bash]를 선택하여 실행 git config --global user.name "사용자이름" git config --global user.email 이메일 Git에서 필요한 vim 편집기 명령어( ※출처: 만들면서 배우는 Git+GitHub입문 ) 목적 입력모드 키 입력 모드 전환(현재 위치부터 쓰기) 일반 I 입력 모드 전환(다음 줄부터 쓰기) 일반 O 입력 모드 전환(한 칸 뒤부터 쓰기) 일반 A 일반 모드 전환(입력 또는 명령모드에서) 입력, 명령 Esc 명령 모드 전환 일반 : (clone) 저장 명령 W 종료 명령 Q 저장후 종료 명령 WQ 1. git 기본 명령어 git init : 실행한 위치를 git 저장소로 초기화 git add + 파일이름 ..
Hanna 한나
평범하듯, 흔하지 않게