728x90

SQL 74

[프로그래머스] 중성화 여부 파악하기

[프로그래머스] 중성화 여부 파악하기 https://school.programmers.co.kr/learn/courses/30/lessons/59409 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 단어 뜻을 몰라서 Neutered면 O고, Spayed면 X 배정해야하는줄.. 둘 중 하나면 O, 아니면 X 출력이었다.. select절에 case when 써줘서 출력! SELECT animal_id, name, case when SEX_UPON_INTAKE like '%Neutered%' or SEX_UPON_INTAKE like '%Spayed%' the..

SQL 2023.07.27

[프로그래머스] 이름에 el이 들어가는 동물 찾기

[프로그래머스] 이름에 el이 들어가는 동물 찾기 https://school.programmers.co.kr/learn/courses/30/lessons/59047 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1. type이 dog여야 함 2. name에 'el'이 들어가있어야 함 3. 이름순서대로 SELECT ANIMAL_ID, NAME from ANIMAL_INS where ANIMAL_TYPE = 'Dog' and NAME like '%el%' order by name asc

SQL 2023.07.27

[프로그래머스] 루시와 엘라 찾기

[프로그래머스] 루시와 엘라 찾기 https://school.programmers.co.kr/learn/courses/30/lessons/59046 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr in을 써서 매칭시키거나 or을 쓰고 싶을 땐 where name = '' or name='' 반복 SELECT ANIMAL_ID, NAME, SEX_UPON_INTAKE from animal_ins where name in ('Lucy', 'Ella', 'Pickle', 'Rogan', 'Sabrina', 'Mitty')

SQL 2023.07.27

[프로그래머스] 특정 옵션이 포함된 자동차 리스트 구하기

[프로그래머스] 특정 옵션이 포함된 자동차 리스트 구하기 https://school.programmers.co.kr/learn/courses/30/lessons/157343# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr where like 써서 특정 구문이 담긴 테이블 추출하는 문제 SELECT CAR_ID, CAR_TYPE, DAILY_FEE, OPTIONS FROM CAR_RENTAL_COMPANY_CAR WHERE OPTIONS like '%네비게이션%' order by CAR_ID desc

SQL 2023.07.26

[프로그래머스] 조건에 부합하는 중고거래 댓글 조회하기

[프로그래머스] 조건에 부합하는 중고거래 댓글 조회하기 https://school.programmers.co.kr/learn/courses/30/lessons/164673 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 잘 정리된 블로그 https://kkw-da.tistory.com/entry/SQL-조건에-부합하는-중고거래-댓글-조회하기프로그래머스MySQLLevel-1 [SQL] 조건에 부합하는 중고거래 댓글 조회하기(프로그래머스/MySQL/Level 1) 안녕하세요! 데코입니다! 오늘은 프로그래머스 코딩테스트 연습에 있는 "조건에 부합하는 중고거래 댓..

SQL 2023.07.26

[해커랭크] Contest Leaderboard

[해커랭크] Contest Leaderboard https://www.hackerrank.com/challenges/contest-leaderboard/problem?isFullScreen=true Contest Leaderboard | HackerRank Generate the contest leaderboard. www.hackerrank.com 처음에 그냥 inner join문만 써서 했었는데, 찾아보니까 max값을 추출해야되더라.. 문제 제대로 이해 못했음.. 나중에 다시 풀어볼 문제!! select a.hacker_id, b.name, sum(a.max_sco) as fin_sco from (select hacker_id, challenge_id, max(score) as max_sco from..

SQL 2023.07.26

[해커랭크] Placements

[해커랭크] Placements https://www.hackerrank.com/challenges/placements/problem?isFullScreen=true Placements | HackerRank Write a query to output the names of those students whose best friends got offered a higher salary than them. www.hackerrank.com 이번엔 from절에 테이블명을 잘못쓰고 왜 틀리지 이러고 있었다.. ㅋㅋ p1, p2로 나눠서 접근하는 걸 처음 해봄! select s.name from students s inner join friends f on s.id = f.id inner join packages..

SQL 2023.07.24

[해커랭크] The Report

[해커랭크] The Report https://www.hackerrank.com/challenges/the-report/problem?isFullScreen=true The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com 하.. 자꾸 틀렸다고 하길래 왜지.. 하고 머리 싸맸는데 case절 끝에 end를 안썼다.. 꼼꼼하게 생각하자 항상!! select case when g.grade < 8 then NULL else s.name end, g.grade, s.marks from students s inner join grades g on ..

SQL 2023.07.24

[해커랭크] Binary Tree Nodes

[해커랭크] Binary Tree Nodes https://www.hackerrank.com/challenges/binary-search-tree-1/problem?isFullScreen=true Binary Tree Nodes | HackerRank Write a query to find the node type of BST ordered by the value of the node. www.hackerrank.com 처음에 아예 문제 이해를 못해서 헤맸다.. select절에 서브쿼리 넣기! select N,( Case when P is null then 'Root' when N in (select P from BST where P is not Null) then 'Inner' else 'Leaf' e..

SQL 2023.07.23

[해커랭크] Weather Observation Station 20

[해커랭크] Weather Observation Station 20 https://www.hackerrank.com/challenges/weather-observation-station-20/problem?isFullScreen=true&h_r=next-challenge&h_v=zen Weather Observation Station 20 | HackerRank Query the median of Northern Latitudes in STATION and round to 4 decimal places. www.hackerrank.com 못풀어서 다른 블로그 참고.. https://blog.naver.com/pbgg8002/222978260148 [SQL 오답노트] HackerRank 문제 풀이 19 (..

SQL 2023.07.21
728x90