 # SQL 용어 --- 이전에 우린 스팀의 데이터를 뽑는데 SQL문이라는 것을 썼다 [스팀 데이터를 뽑아보자](https://steemit.com/kr/@twinbraid/77e9gt) 당시 주요 내용은 그런게 아니기도 하고 글이 길어지는 와중이어서 갑자기 SQL문을 먹이로 주면 개복치들이 다량으로 폐사할 위험이 있었다 그래서 걍 수리수리 마수리 라는 주문으로 떼웠는데 이젠 뭐 한번 접하기도 했으니 항체정돈 생겼을 것이다 게다가 사실 이건 프로그래밍 언어중에서 난이도 상중하똥으로 분류하면 똥에 속한다 그정도로 쉽다 좀더 심화로 들어가면 머리아프긴하지만 입문은 개나소나 개복치나 다할 수 있다 일단 뜻부터 보자 >**SQL (Structured Query Language)** >구조화된 질문어들 이거보고 도망갈 생각은 하지말자 그냥 허세로 적어놓은거다 원래 프로그래밍 용어들이 걍 있어보일려는 것들이 많다  # SQL 유래 --- 질문을 할때 > 선생님은.. 꺄르르!! 아 부끄! 이거 물어도 되나? > 첫키스 푸훕 언제 하셨어요~~? 이런 식으로 하면 컴퓨터가  이런 시선으로 본후 '다시 씨부려 주십시요' 라고 할 것이다 한데 컴퓨터가 알아듣는 언어인 `0101010` 이런 기계어로 우리가 질문할 수도 없는 노릇이다 그래서 엔지니어들은 열심히 번역기(컴파일러)를 만들었다 그렇지만 역시 인간의 언어를 그대로 쓰긴 힘들고 쓰잘데기 없는건 모조리 뺀후 핵심단어와 문법을 정리해서 대화형 프로그래밍어를 만들었다 그중 하나가 바로 SQL 이다 SQL은 각종 정보가 모인 창고.. 데이터베이스에 질문을 하고 정보를 얻어오는 목적의 언어다 위의 예제에 적용한다면 다음과 같이 된다 >대답하라 선생 첫키스 날짜시간장소 알아듣기 좋지 않은가? 저기서 구조적으로 정해진 것은 '대답하라' 라는 질의어와 이후 구조적 배치다 사실 이런건 우리 실생활에서도 비슷한게 있다 >고갱님 죄송하지만 환불은 불가능하십니다 뭐 이런거 보통 하나의 업체에선 교육할때 통일된 대응언어가 있다 세상엔 진상이 가득해서 '왜 저사람은 고객이고 난 손님이지?' 라는 사람도 있다 '손님.. 고객이랑 손님은 같은말이십니다' 이랬다가는 '지금 니가 날 가르쳐?' 라면서 진상전쟁이 발발한다 컴터는 진상전쟁은 일으키지 않지만 대신 조용히 에러를 뿜는다 'ERROR - 손님이란 단어가 뭔지 모르겠습니다' 쉽게 말하면 규칙이 빡빡한 언어.. 군대의 다나까 같은거라고 생각하면 된다 # 예제 --- 여기서 어렵게 가면 다 도망갈테니 매우매우 기본 세가지만 하겠다 사실 그거면 왠만한것들 다 뽑아낼수 있다 >SELECT, FROM, WHERE 이거 세개다 SELECT는 `~~대해 묻는다` 라고 보면되고 FROM은 `~~에게` 라고 WHERE은 `구체적으로` 라는 뜻이다 처음에 했던 예제로 SQL문을 만들어보면 >SELECT 키스날짜 FROM 선생 WHERE 키스종류=첫키스 이렇게 된다 선생이라는 정보창고주체로부터 키스날짜를 빼내온다 근데 이대로 빼내오면 키스날짜가 감당할 수 없을정도로 나온다.. 그러므로 WHERE 로 정보범위를 좁힌다 키스한 날짜는 첫키스 날짜 한정으로.. 자 그럼.. 마지막으로 이전에 블록체인에서 뽑았던 정보를 SQL문으로 다시 봐보자 이제 눈꼽만큼은 달라보일 것이다 단지 몇가지 기교가 들어갔으니 그것을 제거하고 보여주겠다. 그래도 결과는 나온다 ``` SELECT author FROM TxVotes(NOLOCK) WHERE voter = 'twinbraid' ``` 글쓴이가 누군지 빼내온다 `TxVotes(NOLOCK)` 라는 정보통한테.. 이대로하면 모든 글쓴이를 다 뽑아오니까 `voter(투표자)` 를 한정한다 twinbraid 라는 멋진 녀석이 투표한 것들만 그래서 결국 twinbraid가 투표한 사람들이 누군지 주루룩 나오는 것이다 그럼 여기서 몇가지만 응용하면 당연히 다른 정보다 줄줄 뽑아낼 수 있다 다른건 다 같게 하고 ``` WHERE weight = 10000 ``` 이러면 투표파워를 100.00%로 투표해줬던 사람만 나온다. (소숫점이 귀찮은지 스팀잇에선 투표파워가 70.38% 이러면 7038로 표현한다) 지금까지 보았듯이 SQL은 여러분을 해치지 않는다 겁먹지 말고 해보자 <a href="https://steemit.com/@twinbraid" target="_blank"><img alt="" border="0" src="https://i.imgur.com/YgRCgTR.gif" /></a>
author | twinbraid |
---|---|
permlink | sql |
category | kr |
json_metadata | {"tags":["kr","kr-dev","chobo","kr-guide"],"image":["https://i.imgur.com/KtNGt6A.png","https://i.imgur.com/sR4Kimy.png","https://i.imgur.com/w5umDK5.png","https://i.imgur.com/YgRCgTR.gif"],"links":["https://steemit.com/kr/@twinbraid/77e9gt","https://steemit.com/@twinbraid"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-07-03 10:36:03 |
last_update | 2017-07-03 10:40:15 |
depth | 0 |
children | 14 |
last_payout | 2017-07-10 10:36:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 18.562 HBD |
curator_payout_value | 5.045 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,351 |
author_reputation | 158,830,716,503,548 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,126,083 |
net_rshares | 3,299,584,436,668 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
vip | 0 | 364,835,341,737 | 50% | ||
woo7739 | 0 | 1,346,599,018,149 | 100% | ||
leesunmoo | 0 | 559,176,480,437 | 20% | ||
sonzweil | 0 | 96,572,617,747 | 15% | ||
warofcraft | 0 | 15,874,995,602 | 10% | ||
cryptos | 0 | 20,458,182,054 | 15% | ||
stylo | 0 | 4,000,418,914 | 20% | ||
slorunner | 0 | 127,958,570 | 100% | ||
infobot | 0 | 80,199,304 | 100% | ||
penguinpablo | 0 | 61,336,353,455 | 5% | ||
superremnant | 0 | 188,819,121,857 | 10% | ||
july01 | 0 | 5,617,417,830 | 100% | ||
zefa | 0 | 97,265,690,706 | 20% | ||
agile | 0 | 3,461,814,728 | 100% | ||
magical-salt | 0 | 4,547,956,349 | 100% | ||
coinkorea | 0 | 77,488,911,664 | 35% | ||
jaiken | 0 | 40,039,471,787 | 100% | ||
coinmaker | 0 | 0 | 0% | ||
thefoolxyz | 0 | 38,581,885,774 | 50% | ||
cherryblossoms | 0 | 36,268,588,667 | 100% | ||
daystar | 0 | 3,975,866,189 | 30% | ||
flaneur100009 | 0 | 2,602,364,591 | 100% | ||
musicholic | 0 | 15,702,438,037 | 100% | ||
teora | 0 | 6,329,860,127 | 100% | ||
sjc333 | 0 | 10,431,475,104 | 100% | ||
belltiger | 0 | 3,018,919,509 | 100% | ||
nhj12311 | 0 | 4,588,246,946 | 100% | ||
soyo | 0 | 1,788,687,714 | 100% | ||
successtrainer | 0 | 63,814,485,134 | 10% | ||
hangeul | 0 | 148,726,265 | 100% | ||
sd3913 | 0 | 13,734,292,404 | 100% | ||
geusgod | 0 | 741,572,641 | 20% | ||
mauver | 0 | 19,862,754,055 | 50% | ||
snow-airline | 0 | 14,091,657,509 | 20% | ||
bree1042 | 0 | 12,961,273,827 | 100% | ||
flame91 | 0 | 1,302,229,970 | 100% | ||
beoped | 0 | 5,975,094,114 | 100% | ||
hwantag | 0 | 1,842,469,757 | 100% | ||
jinsukim | 0 | 1,096,863,516 | 100% | ||
shonleo | 0 | 1,196,206,672 | 100% | ||
stepano | 0 | 149,775,880,726 | 100% | ||
kimsungmin | 0 | 617,811,408 | 100% | ||
thatdamiguy | 0 | 93,070,769 | 100% | ||
sungsil | 0 | 1,619,464,734 | 100% | ||
keepsmiling | 0 | 58,038,788 | 5% | ||
pje0807 | 0 | 1,062,260,831 | 100% |
상중하똥 중에 똥이라길래.. 똥밭에서 구를 각오를 하고 뒷 글을 읽었습니다. 걱정했던 것만큼 똥밭은 아니군요. ㅎㅎ
author | bree1042 |
---|---|
permlink | re-twinbraid-sql-20170703t184755320z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 18:47:54 |
last_update | 2017-07-03 18:47:54 |
depth | 1 |
children | 0 |
last_payout | 2017-07-10 18:47:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 64 |
author_reputation | 71,669,959,162,242 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,179,671 |
net_rshares | 0 |
DML 만 보면 참 쉬운데 ...ㅠ
author | cherryblossoms |
---|---|
permlink | re-twinbraid-sql-20170703t110104355z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 11:01:06 |
last_update | 2017-07-03 11:01:06 |
depth | 1 |
children | 1 |
last_payout | 2017-07-10 11:01:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.124 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 19 |
author_reputation | 815,006,534,837 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,128,264 |
net_rshares | 17,735,738,414 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
cherryblossoms | 0 | 17,735,738,414 | 50% |
어차피 스팀 데이터만 뽑을거라 이이상 알려주면  다들 자러가버릴겁니다
author | twinbraid |
---|---|
permlink | re-cherryblossoms-re-twinbraid-sql-20170703t120442656z |
category | kr |
json_metadata | {"tags":["kr"],"image":["https://i.imgur.com/1jB40Ww.png"],"app":"steemit/0.1"} |
created | 2017-07-03 12:04:42 |
last_update | 2017-07-03 12:04:42 |
depth | 2 |
children | 0 |
last_payout | 2017-07-10 12:04:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 74 |
author_reputation | 158,830,716,503,548 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,133,630 |
net_rshares | 0 |
언제나 쉽고 재밌는 설명이네요. 다음편도 기대하겠습니다.
author | hwantag |
---|---|
permlink | re-twinbraid-sql-20170703t110047919z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 11:00:51 |
last_update | 2017-07-03 11:00:51 |
depth | 1 |
children | 3 |
last_payout | 2017-07-10 11:00:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 31 |
author_reputation | 2,710,748,929,058 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,128,242 |
net_rshares | 0 |
다음편 없는데..-ㅅ-;; 저게 SQL에 대해서 아는거 다입니다 ㅠㅠ
author | twinbraid |
---|---|
permlink | re-hwantag-re-twinbraid-sql-20170703t120623018z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:06:24 |
last_update | 2017-07-03 12:06:24 |
depth | 2 |
children | 2 |
last_payout | 2017-07-10 12:06:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 38 |
author_reputation | 158,830,716,503,548 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,133,780 |
net_rshares | 1,842,469,757 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
hwantag | 0 | 1,842,469,757 | 100% |
초보코인 시리즈를 말씀드린거였어요^^;;
author | hwantag |
---|---|
permlink | re-twinbraid-re-hwantag-re-twinbraid-sql-20170703t123107413z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:31:12 |
last_update | 2017-07-03 12:31:12 |
depth | 3 |
children | 1 |
last_payout | 2017-07-10 12:31:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 22 |
author_reputation | 2,710,748,929,058 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,136,086 |
net_rshares | 0 |
오~ 흥미롭게 읽었어요. 잘보고 갑니다 :)
author | illusioner |
---|---|
permlink | re-twinbraid-sql-20170703t120208296z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:02:09 |
last_update | 2017-07-03 12:02:09 |
depth | 1 |
children | 0 |
last_payout | 2017-07-10 12:02:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 24 |
author_reputation | 244,554,490,238 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,133,407 |
net_rshares | 0 |
와우.. 신기하네요. 링크된 스팀데이타 들어가서 첨부터 다시 확인했는데 참 엑셀도 제가좀 안다고 생각했는데 기능이 어마어마 하네요. 좋은 정보 감사합니다~~
author | kimsungmin |
---|---|
permlink | re-twinbraid-sql-20170703t104513266z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 10:44:24 |
last_update | 2017-07-03 10:44:24 |
depth | 1 |
children | 2 |
last_payout | 2017-07-10 10:44:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 87 |
author_reputation | 61,982,286,851,041 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,126,846 |
net_rshares | 0 |
저도 엑셀에 대해서 놀랐습니다 메모장 확장판이라고 생각했는데..-_-a
author | twinbraid |
---|---|
permlink | re-kimsungmin-re-twinbraid-sql-20170703t120730683z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:07:30 |
last_update | 2017-07-03 12:07:30 |
depth | 2 |
children | 1 |
last_payout | 2017-07-10 12:07:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 39 |
author_reputation | 158,830,716,503,548 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,133,881 |
net_rshares | 0 |
전 계산기 확장판이요 ㅋㅋ
author | kimsungmin |
---|---|
permlink | re-twinbraid-re-kimsungmin-re-twinbraid-sql-20170703t122500629z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:24:09 |
last_update | 2017-07-03 12:24:09 |
depth | 3 |
children | 0 |
last_payout | 2017-07-10 12:24:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 15 |
author_reputation | 61,982,286,851,041 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,135,391 |
net_rshares | 0 |
@twinbraid님 여기에 이런 질문 남겨서 죄송한데 "메타마스크에서 EOS 거래소 지갑으로 토큰보내기" 글 쓰실 생각 없으신가요? 저도 궁금하기도 하구요 보팅하고 갑니다.^^
author | musicholic |
---|---|
permlink | re-twinbraid-sql-20170703t111203513z |
category | kr |
json_metadata | {"tags":["kr"],"users":["twinbraid"],"app":"steemit/0.1"} |
created | 2017-07-03 11:12:09 |
last_update | 2017-07-03 11:12:09 |
depth | 1 |
children | 1 |
last_payout | 2017-07-10 11:12:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 99 |
author_reputation | 27,234,586,960,280 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,129,218 |
net_rshares | 0 |
감사합니다. 마침 저도 생각해보고 있었습니다 비트파인애플인지 뭔지 한번 파보도록 하겠습니다
author | twinbraid |
---|---|
permlink | re-musicholic-re-twinbraid-sql-20170703t120547369z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2017-07-03 12:05:48 |
last_update | 2017-07-03 12:05:48 |
depth | 2 |
children | 0 |
last_payout | 2017-07-10 12:05:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 50 |
author_reputation | 158,830,716,503,548 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,133,734 |
net_rshares | 0 |
<p>This post has been ranked within the top 80 most undervalued posts in the second half of Jul 03. We estimate that this post is undervalued by $24.78 as compared to a scenario in which every voter had an equal say.</p> <p>See the full rankings and details in <a href="https://steemit.com/curation/@screenname/the-daily-tribune-most-undervalued-posts-of-jul-03---part-ii">The Daily Tribune: Jul 03 - Part II</a>. You can also read about some of our methodology, data analysis and technical details in <a href="https://steemit.com/curation/@screenname/introducing-the-daily-tribune-most-undervalued-posts-of-nov-04---part-i">our initial post</a>.</p> <p>If you are the author and would prefer not to receive these comments, simply reply "Stop" to this comment.</p>
author | screenname |
---|---|
permlink | re-sql-20170704t020150 |
category | kr |
json_metadata | "{"replyto": "@twinbraid/sql"}" |
created | 2017-07-04 02:01:51 |
last_update | 2017-07-04 02:01:51 |
depth | 1 |
children | 0 |
last_payout | 2017-07-11 02:01:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 766 |
author_reputation | 46,276,338,038,330 |
root_title | "SQL 문이 뭔지 알아보자" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,218,426 |
net_rshares | 0 |