공부
-
[HackerRank/Basic Join] The Report공부/PS ( SQL) 2022. 5. 19. 01:02
https://www.hackerrank.com/challenges/the-report/problem The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com 문제 풀이 SELECT IF(G.Grade >= 8, S.Name, "NULL"), G.Grade, S.Marks FROM Students AS S INNER JOIN Grades AS G ON S.Marks >= G.Min_Mark AND S.Marks = 8, S.Name, "NULL"), G.Grade, S.Marks FROM Students AS S INNER JOIN Gra..
-
[HackerRank/Basic Join] Average Population of Each Continent공부/PS ( SQL) 2022. 5. 18. 23:11
https://www.hackerrank.com/challenges/average-population-of-each-continent/problem Average Population of Each Continent | HackerRank Query the names of all continents and their respective city populations, rounded down to the nearest integer. www.hackerrank.com 문제 풀이 SELECT COUNTRY.CONTINENT, TRUNCATE(AVG(CITY.POPULATION),0) FROM COUNTRY JOIN CITY ON CITY.COUNTRYCODE = COUNTRY.CODE GROUP BY COUN..
-
[HackerRank/Basic Join] African Cities공부/PS ( SQL) 2022. 5. 18. 21:27
https://www.hackerrank.com/challenges/african-cities/problem African Cities | HackerRank Query the names of all cities on the continent 'Africa'. www.hackerrank.com 문제 풀이 SELECT CITY.NAME FROM CITY INNER JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE WHERE COUNTRY.CONTINENT = 'Africa'
-
[MYSQL] JOIN 참고공부/PS ( SQL) 2022. 5. 18. 21:22
https://yoo-hyeok.tistory.com/98 [MySQL] Join 깔끔한 이해와 사용법 상단의 그림 정말 정리가 잘 되어 있습니다. 처음 접할 때 보고도 저게뭔가 싶었는데 초심자의 입장에서 이해하기 쉽도록 설명해보려합니다. 1. LEFT JOIN A, B 테이블 중에 A값의 전체와, A의 KEY 값 yoo-hyeok.tistory.com https://www.w3schools.com/mysql/default.asp MySQL Tutorial W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML,..
-
[HackerRank/Basic Join] Population Census공부/PS ( SQL) 2022. 5. 18. 21:20
https://www.hackerrank.com/challenges/asian-population/problem Population Census | HackerRank Query the sum of the populations of all cities on the continent 'Asia'. www.hackerrank.com 문제 풀이 SELECT SUM(CITY.POPULATION) FROM CITY INNER JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE WHERE COUNTRY.CONTINENT = 'Asia' INNER JOIN SELECT FROM TABLE A A INNER JOIN TABLE B B ON A.Key = B.Key WHERE
-
[HackerRank/Aggregation] Revising Aggregations - Average Population공부/PS ( SQL) 2022. 5. 18. 02:16
https://www.hackerrank.com/challenges/average-population/problem Average Population | HackerRank Query the average population of all cities, rounded down to the nearest integer. www.hackerrank.com 문제 풀이 SELECT ROUND(AVG(POPULATION)) FROM CITY 반올림 (ROUND) 사용법: ROUND(숫자, 반올림할 자릿수) 제거 (TRUNCATE) 사용법: TRUNCATE(숫자, 남길 자릿수(소수n째 자리)) 무조건 버림할 자릿수를 입력해야함 올림 (CEIL) 사용법: CEIL(숫자) 버림 (FLOOR) 사용법: FLOOR(숫자)
-
[HackerRank/Aggregation] Revising Aggregations - Averages공부/PS ( SQL) 2022. 5. 18. 02:10
https://www.hackerrank.com/challenges/revising-aggregations-the-average-function/problem Revising Aggregations - Averages | HackerRank Query the average population of all cities in the District of California. www.hackerrank.com 문제 풀이 SELECT AVG(POPULATION) FROM CITY WHERE DISTRICT LIKE 'California'
-
[BOJ] 1966 프린터 큐 / C++공부/PS (백준) 2022. 5. 18. 02:06
https://www.acmicpc.net/problem/1966 1966번: 프린터 큐 여러분도 알다시피 여러분의 프린터 기기는 여러분이 인쇄하고자 하는 문서를 인쇄 명령을 받은 ‘순서대로’, 즉 먼저 요청된 것을 먼저 인쇄한다. 여러 개의 문서가 쌓인다면 Queue 자료구조에 www.acmicpc.net #include #include using namespace std; int T, N, M; queue q; priority_queue pq; int sequence[110]; int cnt, answer; void init() { for (int i = 0; i = top_priority) { // 현재 문서가 나머지 문서들보다 우선순위가 높음 pq.pop(); sequence[cur_index] ..