전체 글
-
[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] ..
-
[programmers] 프린터 / C++공부/PS (programmers) 2022. 5. 18. 00:35
https://programmers.co.kr/learn/courses/30/lessons/42587 코딩테스트 연습 - 프린터 일반적인 프린터는 인쇄 요청이 들어온 순서대로 인쇄합니다. 그렇기 때문에 중요한 문서가 나중에 인쇄될 수 있습니다. 이런 문제를 보완하기 위해 중요도가 높은 문서를 먼저 인쇄하는 프린 programmers.co.kr #include #include #include #include using namespace std; int solution(vector priorities, int location) { int answer = 0, cnt = 1; int sequence[110] = {0, }; // 각 문서가 프린트된 순서를 저장 queue q; priority_queue pq;..
-
[HackerRank/Aggregation] Revising Aggregations - The Count Function공부/PS ( SQL) 2022. 5. 17. 01:19
https://www.hackerrank.com/challenges/revising-aggregations-the-count-function/problem Revising Aggregations - The Count Function | HackerRank Query the number of cities having populations larger than 100000. www.hackerrank.com 문제 풀이 SELECT COUNT(NAME) FROM CITY WHERE POPULATION > 100000
-
[HackerRank/Advanced Select] The PADS공부/PS ( SQL) 2022. 5. 16. 01:29
https://www.hackerrank.com/challenges/the-pads/problem The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com 문제 풀이 SELECT CONCAT(Name, "(", LEFT(Occupation,1), ")") FROM OCCUPATIONS ORDER BY Name; SELECT CONCAT("There are a total of ", COUNT(occupation), " ", LOWER(Occupation), "s.") FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(..