๐ Programming
[MYSQL] ์ฐ์ ์ ์๊ฑฐํธ๊ฐ ๋ด๊ธด ์ฅ๋ฐ๊ตฌ๋
Programmers -> Summer/Winter Coding(2019) SELECT A.CART_ID FROM (SELECT CART_ID FROM CART_PRODUCTS WHERE NAME = 'Milk') AS A JOIN (SELECT CART_ID FROM CART_PRODUCTS WHERE NAME = 'Yogurt') AS B ON A.CART_ID = B.CART_ID; โ JOIN ํ ๋ ON์ผ๋ก ๋ฌถ์ด์ค ์นผ๋ผ ์ ํ๋๊ฑฐ ์์ง๋ง๊ธฐ โ
[JavaScript] JQuery์ Ajax
๊ธฐ๋ณธ์์ฒญ ์์ GET ๋ฐฉ์ ์์ฒญ GET POST ๋ฐฉ์ ์์ฒญ POST data์ ์ก / data์์ฒญ GET ๋ฐฉ์ ์์ฒญ GET POST ๋ฐฉ์ ์์ฒญ POST get๊ณผ post๋ฉ์๋๊ฐ ๋ฐ๋ก ์์ GET ๋ฐฉ์ ์์ฒญ GET POST ๋ฐฉ์ ์์ฒญ POST data์ ์ก / data์์ฒญ GET ๋ฐฉ์ ์์ฒญ GET POST ๋ฐฉ์ ์์ฒญ POST etc... .done(function() { //์์ฒญ ์ฑ๊ณต์ ์คํํ๋ ๋ฉ์๋ }) .fail(function() { //์์ฒญ ์คํจ์ ์คํํ๋ ๋ฉ์๋ //errorThrown(์ธ๋ฒ์งธ ํ๋ผ๋ฏธํฐ) ์ด์ฉํด ์ค๋ฅ ๋์ถ ๊ฐ๋ฅ }) .always(function() { //์ฑ๊ณต๊ณผ์คํจ ์ฌ๋ถ์ ์๊ด์์ด ์คํํ๋ ๋ฉ์๋ });
[MYSQL] SELECT is null FROM Programmers
SELECT ANIMAL_ID FROM ANIMAL_INS WHERE NAME IS NULL ORDER BY ANIMAL_ID; SELECT ANIMAL_ID FROM ANIMAL_INS WHERE NAME IS NOT NULL ORDER BY ANIMAL_ID; SELECT ANIMAL_TYPE, IFNULL(NAME, "No name") AS NAME, SEX_UPON_INTAKE FROM ANIMAL_INS ORDER BY ANIMAL_ID; IFNULL(a,b) -a๊ฐ null์ด๋ฉด b๋ก ๋์ฒด
[HTML] ๊ธฐ์ด์ ๋ฆฌ
div ๋ธ๋ก ํ๊ทธ : ๋ฌด์กฐ๊ฑด ๊ฐํ ํ ๊ทธ๋ฃนํ span ์ธ๋ผ์ธ : ๊ฐํ ์์ด ๊ทธ๋ฃนํ ๊ฐ๋ฅ class ์ฌ๋ฌ ํ๊ทธ์ ์ค๋ณต ๊ฐ๋ฅ ํ ํ๊ทธ์ ์ฌ๋ฌ class ์ฌ์ฉ ๊ฐ๋ฅ (๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ) js์์ document.getElementByClassName() id document์ ํ ๊ฐ๋ง ์กด์ฌํด์ผํจ(์ค๋ณต X) js์์ doucment.getElementById() iframe ํ์ฌ ๋ฌธ์์ ๋ค๋ฅธ ๋ฌธ์ ํฌํจ ์ -> src ํ๊ทธ์์ ํ๊ทธ์ name์ผ๋ก target์ง์ ๊ฐ๋ฅ
[HTML] table & list
HTML์ Table ์์ฑ ๊ธฐ๋ณธ ์ฝ๋ Table Title cloumn1 column2 content1 content2 content1_2 content2_2 ๋๋ณด๊ธฐ html caption ->ํ ์ ๋ชฉ tr ->ํ ํ th ->์นผ๋ผ ์ ์ td ->๋ฐ์ดํฐ ์ฐจ๋ก๋๋ก css border-collapse:collapse -> ํ์ ํ ๋๋ฆฌ๋ฅผ ํ ์ค๋ก List ๊ธฐ๋ณธ ์ฝ๋ List Title one Two three ๋๋ณด๊ธฐ ํ๊ทธ ์์ ๋ก ๋ฆฌ์คํธ ์์ฑ ul ๋์ ์ ์ฌ์ฉํ๋ฉด ์์ ์๋ ๋ฆฌ์คํธ
[MYSQL] SELECT groupby FROM Programmers
SELECT ANIMAL_TYPE, COUNT(ANIMAL_ID) AS count FROM ANIMAL_INS GROUP BY ANIMAL_TYPE; SELECT NAME, COUNT(ANIMAL_ID) AS COUNT FROM ANIMAL_INS WHERE NAME IS NOT NULL GROUP BY NAME HAVING COUNT>=2 ORDER BY NAME; HAVING - GROUP์ ์กฐ๊ฑด SELECT HOUR(DATETIME) AS HOUR, COUNT(ANIMAL_ID) AS COUNT FROM ANIMAL_OUTS GROUP BY HOUR HAVING HOUR >=9 AND HOUR hour์ด๋ผ๋ ๋ณ์๋ฅผ -1๋ก ์ด๊ธฐํ
[MYSQL] SELECT sum,max,min FROM Programmers
SELECT MAX(DATETIME) FROM ANIMAL_INS; SELECT MIN(DATETIME) FROM ANIMAL_INS; SELECT COUNT(*) AS 'COUNT' FROM ANIMAL_INS; COUNT -๊ฐฏ ์ returnํ๋ ์ฟผ๋ฆฌ AS -๋ณด์ฌ์ค ์นผ๋ผ์ด๋ฆ ์ง์ SELECT COUNT(DISTINCT NAME) AS 'COUNT' FROM ANIMAL_INS WHERE NAME IS NOT NULL; DISTINCT - ์ค๋ณต์ ์ ๊ฑฐํ๋ ์ฟผ๋ฆฌ
[MYSQL] SELECT select FROM Programmers
SELECT * FROM ANIMAL_INS ORDER BY ANIMAL_ID; SELECT NAME, DATETIME FROM ANIMAL_INS ORDER BY ANIMAL_ID DESC; SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION = 'Sick'; SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE NOT INTAKE_CONDITION = 'Aged'; SELECT ANIMAL_ID, NAME FROM ANIMAL_INS ORDER BY ANIMAL_ID; SELECT ANIMAL_ID, NAME, DATETIME FROM ANIMAL_INS ORDER BY NAME, DATETIME DESC; SELE..
[Python] web scraping
BeautifulSoup ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ฉด ๊ฐ๋จํ๊ฒ web scraping์ ํ ์ ์๋ค. BeautifulSoup ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ HTML, XML์ ๋ถ์ํด์ค๋ค. ์น ์ฌ์ดํธ์ html์ scrapingํ๊ธฐ ์ํด์๋ urllib ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ํจ๊ป ์ฌ์ฉํด์ผํ๋ค. ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํจ๊ป ์ฌ์ฉํ์ฌ ์น ์ฌ์ดํธ์ html์ scrapingํ ์ ์๋ค. urllib option import urllib.request as request url = "https://990427.tistory.com" data = request.urlopen(url) urlopen() ํจ์๋ url์ ํด๋นํ๋ ์น ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์จ๋ค. BeautifulSoup option from bs4 import BeautifulSoup html = '..