본문 바로가기

공부/SQL4

MYSQL 코테 보기 전, 알아두어야 할 지식 - sql 실행 순서FROM>WHERE>GROUP BY>HAVING>SELECT>ORDER BY  - 날짜 관련1. 기간 설정[1] beween - and -START_DATE BETWEEN '2024-11-01' AND '2024-11-30'이상, 이하[2] like '날짜'START_DATE like '2022-10%' 2. 일부 추출SELECT YEAR('2024-11-01')(YEAR, MONTH, DAY, HOUR, MINUTE, SECOND) 3. 기간 계산 DATEDIFFDATEDIFF(END_DATE, START_DATE)DATEDIFF(END_DATE, START_DATE) + 1 : 일 계산 (예) DATEDIFF('2017-03-28 23:59:59', '2017-03-01 00:00.. 2024. 9. 23.
프로그래머스 SQL 고득점 Kit - GROUP BY; MySQL https://programmers.co.kr/learn/courses/30/parts/17044 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1. 고양이와 개는 몇 마리 있을까? SELECT ANIMAL_TYPE, count(*) as count from ANIMAL_INS group by ANIMAL_TYPE having ANIMAL_TYPE in ('Cat', "Dog") order by ANIMAL_TYPE; 2. 동명 동물 수 찾기 SELECT NAME, count(*) as count from ANIMAL_INS where NAME is no.. 2022. 3. 3.
SQL Zoo - More JOIN operations 문제 풀이 https://sqlzoo.net/wiki/More_JOIN_operations More JOIN operations - SQLZOO This tutorial introduces the notion of a join. The database consists of three tables movie , actor and casting . movie id title yr director budget gross casting movieid actorid ord More details about the database. 1962 movies List the films where the yr is sqlzoo.net 1. 1962 movies SELECT id, title FROM movie WHERE yr=196.. 2022. 3. 2.
프로그래머스 SQL 고득점 Kit - Join; MySQL https://programmers.co.kr/learn/courses/30/parts/17046 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 0. join 공부 https://www.w3schools.com/sql/sql_join.asp SQL Joins W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQ.. 2022. 3. 2.