코딩공부 27

[프로그래머스] Level.1 / SELECT - 부모의 형질을 모두 가지는 대장균 찾기

문제 부모의 형질을 모두 보유한 대장균의 ID(ID), 대장균의 형질(GENOTYPE), 부모 대장균의 형질(PARENT_GENOTYPE)을 출력하는 SQL 문을 작성해주세요. 이때 결과는 ID에 대해 오름차순 정렬해주세요.https://school.programmers.co.kr/learn/courses/30/lessons/301647 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 풀이  맨 처음에는  JOIN 사용하지 않고 WHERE절에 SELECT GENOTYPE을 해서 이 컬럼을 쓸라고 했다.그런데 서브쿼리의 컬럼은 메인쿼리에서 사용이 안된다는 것을 알았다.그래서 JOIN은 안 쓰고 풀어보고 싶..

코딩공부 2024.12.22

[프로그래머스] Level.1 / SELECT - 특정 형질을 가지는 대장균 찾기

문제 2번 형질이 보유하지 않으면서 1번이나 3번 형질을 보유하고 있는 대장균 개체의 수(COUNT)를 출력하는 SQL 문을 작성해주세요. 1번과 3번 형질을 모두 보유하고 있는 경우도 1번이나 3번 형질을 보유하고 있는 경우에 포함합니다.https://school.programmers.co.kr/learn/courses/30/lessons/301646 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr각 대장균 별 형질을 2진수로 나타내면 다음과 같습니다.ID 1 : 1000₍₂₎ID 2 : 1111₍₂₎ID 3 : 1₍₂₎ID 4 : 1101₍₂₎각 대장균 별 보유한 형질을 다음과 같습니다.ID 1 : ..

코딩공부 2024.12.22

[프로그래머스] Level.3 / SELECT - 대장균들의 자식의 수 구하기

문제대장균 개체의 ID(ID)와 자식의 수(CHILD_COUNT)를 출력하는 SQL 문을 작성해주세요. 자식이 없다면 자식의 수는 0으로 출력해주세요. 이때 결과는 개체의 ID 에 대해 오름차순 정렬해주세요.https://school.programmers.co.kr/learn/courses/30/lessons/299305 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr   문제해결

코딩공부 2024.12.22

[HackerRank] SQL / Basic Join / Easy / Average Population of Each Continent

문제:https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true Average Population of Each Continent | HackerRankQuery the names of all continents and their respective city populations, rounded down to the nearest integer.www.hackerrank.comGiven the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective aver..

코딩공부 2024.12.22

[HackerRank] SQL / Basic Join / Easy / African Cities

문제:https://www.hackerrank.com/challenges/african-cities/problem?isFullScreen=true African Cities | HackerRankQuery the names of all cities on the continent 'Africa'.www.hackerrank.com Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is 'Africa'.Note: CITY.CountryCode and COUNTRY.Code are matching key columns.Input FormatThe CITY and COUNTRY tables are describe..

코딩공부 2024.12.18