<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>sorah_k.log</title>
        <link>https://velog.io/</link>
        <description>공부,복습 </description>
        <lastBuildDate>Mon, 05 Jul 2021 04:28:57 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>sorah_k.log</title>
            <url>https://images.velog.io/images/sorah_k/profile/c0abf6ae-4a92-401a-92a6-3d9e44894491/social.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. sorah_k.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/sorah_k" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[mysql 3-1 board예제]]></title>
            <link>https://velog.io/@sorah_k/mysql-3-1-board%EC%98%88%EC%A0%9C</link>
            <guid>https://velog.io/@sorah_k/mysql-3-1-board%EC%98%88%EC%A0%9C</guid>
            <pubDate>Mon, 05 Jul 2021 04:28:57 GMT</pubDate>
            <description><![CDATA[<p>1&gt; 테이블작성
Create table board(
Unq int unsigned not null auto_increment,
Title varchar(200) not null,
Pass varchar(100) not null.
Name varchar(20),
Contnt text,
Hits int unsigned default ‘0’, 
rdate datetime,
Primary key(unq));</p>
<p>2&gt;
Primary key 설정 —&gt; 
(1) 중복데이터 방지
(2) 빠른검색 </p>
<p>3&gt; 데이터입력</p>
<p>8.0이상버전부터는 password() 함수 대신 md5()함수 이용. </p>
<p>insert into board(title, pass, name, contnt, rdate) 
values(&#39;학습과목&#39;,md5(&#39;123456&#39;),&#39;행정&#39;,&#39;java,jsp,html&#39;,now());</p>
<p>alter table board change contnt content text;
—졸면서 쳐서…오타났음 ㅎㅎ</p>
<p>delete from board where unq =&#39;1&#39; and pass = md5(&#39;212&#39;);
—삭제안됨. 비밀번호 틀렸으므로, 
delete from board where unq =&#39;2&#39; and pass = md5(&#39;123456&#39;);
select * from board;</p>
<blockquote>
<blockquote>
<p>삭제된거 확인. </p>
</blockquote>
</blockquote>
<p>4&gt; 풀어보기</p>
<p>1-1. Unq 3번의 제목, 이름, 내용을 출력한다. 
select title, name, content, left(rdate,10) as rdate  from board where unq=&#39;3&#39;;
—날짜가 시분초제외하고 나오게!</p>
<p>1-2. 제목의 길이를 목록 출력 ex. 학습과목(12)
select concat(title, &#39;(&#39;,length(title),&#39;)&#39;) title from board;</p>
<ol start="2">
<li>임의의 숫자로 조회수를 변경한다. (첫째글은 43, 셋째글은 50, 넷째는 15)
update board set hits = 43 where unq =1;
update board set hits = 50 where unq =3;
update board set hits = 15 where unq = 4; </li>
</ol>
<p>3-1. 제목 필드에서 축구라는 단어가 들어 있는 데이터를 검색한다. 
 select * from board where title like &#39;%축구%&#39;;</p>
<p>3-2. 내용 필드에서 java라는 단어가 들어있는 데이터를 검색한다. 
select * from board where content like ‘%java%’;</p>
<p>3-3. 땅콩이라는 단어를 제목과 내용에서 모두 검색한다.
select * from board where title like &#39;%땅콩%&#39;
    or content like &#39;%땅콩%&#39;;</p>
<p>4-1. 가장 조회수가 많은 데이터 순으로 출력
select * from board order by hits desc;
 4-2. 최신 글 순으로 데이터를 출력
select * from board order by unq desc;
(rdate도 가능하나, unq로 뽑는게 시스템적으로도 편함.)</p>
<p>5-1. 가장 최신 글 하나를 출력
select * from board order by unq desc limit 1;</p>
<p>select * from board where unq = max(unq); //    error. 
select * from board where unq = (select max(unq) from board);  //가능. max(unq)에대한 조건을 다 붙여줘야지만 사용가능.</p>
<p>5-2. 가장 조회수 많은 데이터 하나를 출력. 
select * from board order by hits desc limit 1;</p>
<ol start="6">
<li><p>세번째 데이터를 수정
(수정내용 - 제목: 땅콩회황사건, 이름: 김기자, hits 1000)
update board set 
 title = &#39;땅콩회황사건&#39;, name = &#39;김기자&#39;, hits = 1000
where unq=3;</p>
</li>
<li><p>축구사랑이 쓴 데이터의 조회수를 증가(+1) 시킨다. 
update board set
 hits = hits +1 
 where name =&#39;축구사랑&#39;;
상세보기 -&gt; 조회수 누적증가. </p>
</li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[mysql 재설치]]></title>
            <link>https://velog.io/@sorah_k/mysql-%EC%9E%AC-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C</link>
            <guid>https://velog.io/@sorah_k/mysql-%EC%9E%AC-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C</guid>
            <pubDate>Sun, 04 Jul 2021 08:54:18 GMT</pubDate>
            <description><![CDATA[<p>mysql을 다 삭제하고 다시깔기로 했다.
이번에는 brew를 이용해서 mysql을 설치해보기로 했다. </p>
<p>brew는 아래 명령어로 설치가능. </p>
<p>/bin/bash -c &quot;$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;">https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;</a></p>
<p>전체적인 과정은 이 블로그를 참고해서 깔기 시작.<br><a href="https://devyurim.github.io/data%20base/mysql/2018/08/13/mysql-1.html">https://devyurim.github.io/data%20base/mysql/2018/08/13/mysql-1.html</a></p>
<p>workbench를 깔아야되는데
cask에 없어서인지
brew cask install mysqlworkbench
명령어가 작동이 안되서, 찾아본 결과 
big sur은 </p>
<p>brew install --cask mysqlworkbench-8.0.25.rb
참고 
(<a href="https://gist.github.com/jonjack/37ce2d0a28fc53d85d7c18de8065d555">https://gist.github.com/jonjack/37ce2d0a28fc53d85d7c18de8065d555</a>)
근데 ! 
Error: Cask &#39;mysqlworkbench-8.0.25&#39; is unavailable: No Cask with this name exists. 가 떠서, </p>
<p>그냥 홈페이지 가서 다운받기로 결정</p>
<p>** 8.0.22으로 재다운받음. 
8.0.25에서 에러코드 많이뜸. </p>
<p>mysql 실행후 나가고싶으면
exit 입력. </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[mysql #2,3 실습예제]]></title>
            <link>https://velog.io/@sorah_k/mysql-2-3-%EC%8B%A4%EC%8A%B5%EC%98%88%EC%A0%9C</link>
            <guid>https://velog.io/@sorah_k/mysql-2-3-%EC%8B%A4%EC%8A%B5%EC%98%88%EC%A0%9C</guid>
            <pubDate>Fri, 02 Jul 2021 05:22:27 GMT</pubDate>
            <description><![CDATA[<p>unsigned : 음수의 공간을 양수로 옮기겠다. ex.tinyint 공간 -127<del>129 =unsigned=&gt; 0</del>254. 
-- : mysql에서의 주석. </p>
<p>1&gt; 테이블 생성
create table studentscore(
unq int unsigned not null,
loc varchar(10) not null, 
userid varchar(10) not null,
kor tinyint unsigned default &#39;0&#39;,
eng tinyint unsigned default &#39;0&#39;
);</p>
<p>desc studentscore;</p>
<p>2&gt; 데이터 입력(외부파일 import)</p>
<p>import -파일선택 
csv using load data 
필드 구분자 --&gt; , </p>
<p>select count(*) from studentscore;
select * from studentscore limit 40; -- 데이터 40개까지 보여줌.
delete from studentscore where uniq =0; --첫번째 줄에 잘못된 데이터가 들어와서 부분 삭제 적용함. </p>
<p>delete from studentscore; -- 테이블은 유지, 데이터 삭제. 
truncate studentscore; -- 테이블은 유지, 데이터 삭제. </p>
<p>3&gt; 내용수정. loc컬럼값 변경
--1 서울, 2 대구, 3 원주, 4 전주
update studentscore set loc = &#39;서울&#39; where loc = &#39;1&#39;;
update studentscore set loc = &#39;대구&#39; where loc = &#39;2&#39;;
update studentscore set loc = &#39;원주&#39; where loc = &#39;3&#39;;
update studentscore set loc = &#39;전주&#39; where loc = &#39;4&#39;;</p>
<p>4&gt; 실습예제</p>
<ol>
<li><p>영어점수를 1등부터 출력
select eng from studentscore order by eng desc;</p>
</li>
<li><p>영어점수 중 최고점을 출력한다. 
select max(eng) as eng from studentscore ;</p>
</li>
</ol>
<p>--최저점
select min(eng) as eng from studentscore;</p>
<ol start="3">
<li>아이디 st101의 평균을 출력
select round((eng+kor)/2,2) as &#39;avg&#39; from studentscore where userid = &#39;st101&#39;;</li>
</ol>
<p>-- select avg ( column의 평균...)</p>
<ol start="4">
<li><p>국어점수가 60점 미만인 학생의 아이디를 출력 
select userid from studentscore where kor &lt;60;</p>
</li>
<li><p>두과목 모두 60점 이상인 학생들 출력
select * from studentscore where kor &gt;= 60 and eng &gt;=60;</p>
</li>
<li><p>두과목중 한과목이라도 60미만인 학생들을 출력
select * from studentscore where kor &lt; 60 or eng &lt;60;  </p>
</li>
<li><p>영어점수 기준으로 1등부터 5등까지의 학생들을 출력
select * from studentscore order by eng desc limit 0,5;</p>
</li>
</ol>
<p>--limit 시작번호,출력개수</p>
<ol start="8">
<li><p>영어점수 기준으로 6~10등 학생들 출력
select *from studentscore order by eng desc limit 5,5;</p>
</li>
<li><p>전체 총합 1등의 아이디,총합점수를 출력
select userid, (eng+kor) as &#39;total&#39; from studentscore order by (eng+kor) desc limit 0,1;</p>
</li>
</ol>
<p>--limit 0,x 일 경우, 0은 생략가능</p>
<ol start="10">
<li><p>아이디가 101인 데이터의 영어점수에 +5를 적용한다. 
update studentscore set eng =eng+5 where userid = &#39;st101&#39;;</p>
</li>
<li><p>대구지역 학생 목록을 출력한다. 
select * from studentscore where loc = &#39;대구&#39;;</p>
</li>
<li><p>대구지역 학생 수를 출력한다.
select count(*) from studentscore where loc = &#39;대구&#39;;</p>
</li>
<li><p>대구지역에서 영어점수가 가장 높은 학생의 아이디와 영어점수를 출력한다. 
select userid, eng, loc from studentscore where loc = &#39;대구&#39; order by eng desc limit 1;</p>
</li>
</ol>
<p>--where은 테이블 뒤에 바로, 앞선조건</p>
<ol start="14">
<li>대구지역에서 두 과목 합계1등의 아이디와 총점을 출력한다. 
select userid, (eng+kor) total, loc from studentscore where loc = &#39;대구&#39; order by (eng+kor) limist 1;</li>
</ol>
<p>-- as total : as 생략가능
// alias 이름은 order by 절에 사용가능. mysql에서는! 오라클은 나중에 비교해보기~</p>
<p>5&gt; 주소값변경
update studentscore set loc = &#39;서울특별시 강남구 12&#39; where loc =&#39;서울&#39;;
update studentscore set loc = &#39;대구광역시 수성구 101&#39; where loc =&#39;대구&#39;;
update studentscore set loc = &#39;강원도 원주시&#39; where loc =&#39;원주&#39;;
update studentscore set loc = &#39;전라북도 전주시&#39; where loc =&#39;전주&#39;;</p>
<p>6&gt; like 연산자 : %문자열, _문자한개</p>
<ol>
<li>수성구에 사는 학생들을 출력
select *from studentscore 
where loc like &#39;%수성구%&#39;;</li>
<li>서울에 사는 학생들을 출력
select *from studentscore where loc like &#39;서울%&#39;;</li>
</ol>
<p>7&gt; 풀어보기</p>
<ol>
<li>대구에 사는 학생들은 총 몇명인가?
select count(*) from studentscore where loc like &#39;대구%&#39;;</li>
<li>강원도 학생들의 영어평균?
select avg(eng) from studentscore where loc like &#39;강원%&#39;;</li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[mysql #2 -1 테이블작성, 실습예제]]></title>
            <link>https://velog.io/@sorah_k/mysql-1-%ED%85%8C%EC%9D%B4%EB%B8%94%EC%9E%91%EC%84%B1-%EC%8B%A4%EC%8A%B5%EC%98%88%EC%A0%9C</link>
            <guid>https://velog.io/@sorah_k/mysql-1-%ED%85%8C%EC%9D%B4%EB%B8%94%EC%9E%91%EC%84%B1-%EC%8B%A4%EC%8A%B5%EC%98%88%EC%A0%9C</guid>
            <pubDate>Fri, 02 Jul 2021 04:13:41 GMT</pubDate>
            <description><![CDATA[<p>![]
(<a href="https://images.velog.io/images/sorah_k/post/5b0671d2-f76d-413f-af04-e9d4cc2c8b95/image.png">https://images.velog.io/images/sorah_k/post/5b0671d2-f76d-413f-af04-e9d4cc2c8b95/image.png</a>)</p>
<p>1&gt;테이블 작성</p>
<p>insert into student(userid, username, age, gender, grade) values(&#39;st101&#39;,&#39;Tom&#39;,&#39;15&#39;,&#39;M&#39;,&#39;2&#39;);
insert into student(userid, username, age, gender, grade) values(&#39;st102&#39;,&#39;Jane&#39;,&#39;16&#39;,&#39;F&#39;,&#39;3&#39;);
insert into student(userid, username, age, gender, grade) values(&#39;st103&#39;,&#39;Yakima&#39;,&#39;14&#39;,&#39;M&#39;,&#39;1&#39;);
insert into student(userid, username, age, grade) values(&#39;st104&#39;,&#39;Yong&#39;,&#39;14&#39;,&#39;1&#39;);
insert into student(userid, username, gender) values(&#39;st105&#39;,&#39;Minyo&#39;,&#39;F&#39;);
insert into student(userid, username, age, grade) values(&#39;st106&#39;,&#39;Kang&#39;,&#39;15&#39;,&#39;2&#39;);
insert into student(userid, username, gender) values(&#39;st107&#39;,&#39;Kim&#39;,&#39;M&#39;);<br>//숫자는 0이 DEFUALT. 
insert into student values(&#39;st108&#39;,&#39;Miranda&#39;,&#39;15&#39;,&#39;F&#39;,&#39;2&#39;);</p>
<p>//(userid, username, age, gender, grade) 가급적으로 column은 써주는게 좋음. </p>
<p>//데이터베이스삭제, 테이블 삭제, 테이블내 데이터만 삭제 
drop database apple;
drop table student; (테이블 자체가 삭제)
delete from student;   </p>
<p>2&gt;기본검색 연습. 
select username, age from student;
select *from student where gender = &#39;M&#39;;
select username from student where gender is null;
select username from student where gender is not null;
st107의 성별출력
select gender from student where userid =  &#39;st107&#39;;
나이가 15세 이상의 남학생만
select * from student where age &gt;=15 and gender = &#39;M&#39;;
나이와 학년이 없는 학생들의 이름출력
select username from student where age = 0 and grade is null;
이름이 Yong인 학생의 학년을 출력
select grade from student where username = &#39;Yong&#39;;</p>
<p>3&gt;통계함수
1.count() - 열의 갯수. 
select count(<em>) from student;<br>-----&gt; *을 쓰게되면 모든 column의 행 중 최대치를 보여줌. 
select count(grade) from student;  //6 --&gt; null이 2개가 있고, 이거는 count안함. 
select count(age) from student; //8 --&gt; 수치는 0이 있어도 데이터 개수로 count해줌. 
select count(age,userid) from student; =====&gt; 이런식은 불가!!!!!!!!!!!! 
select count(</em>), userid from student;  //8, st101 --&gt;문법상오류는 안나오지만 원하는 값은 아님. </p>
<ol start="2">
<li><p>sum() 
select sum(age) from student;</p>
</li>
<li><p>avg()
select avg(age) from student;</p>
</li>
<li><p>min()
select min(age) from student;</p>
</li>
<li><p>max()
select max(age) from student;</p>
</li>
</ol>
<p>4&gt; 출력 타이틀 변경 Alias ; select (old) as (new)(,old as new) from (table) 
===&gt; 프로그램이랑 연동시 필요. 
select username as &#39;이름&#39;, userid as &#39;아이디&#39; from student;</p>
<p>5&gt; 순차/역순 정렬 **많이쓰는 표현. Order by</p>
<ol>
<li>역순정렬
select * from student(table) order by (기준)age desc(descending);</li>
<li>순차정렬
select * from student(table) order by (기준)age( asc(ascending)); // asc는 default라 생략가능. </li>
</ol>
<p>6&gt; 중복데이터 제거. Distinct. 
select distinct(age) from student;
select distinct(age),userid from student; // ==&gt; 오류는 아니지만, 원하는 distinct값이 나오진 않음. </p>
<p><em>예제</em>
Q1&gt;</p>
<ol>
<li>1학년들의 이름 
select username from student where grade = &#39;1&#39;;</li>
<li>15세 이상 이름과 나이 출력 
select username, age from student where age &gt;=15;</li>
<li>성별이 기록되어있지 않은 데이터의 아이디 값 (null 및 공백)
select * from student where gender is null and gender != &#39;&#39;;</li>
</ol>
<p>Q2&gt;</p>
<ol>
<li>아이디 st101, st102의 이름, 연령, 학년
select username, age, grade from student where user id =&#39;st101&#39; or user id = &#39;st102&#39;;</li>
<li>15세 이상의 여학생들만 전체출력
select * from student where age &gt;= 15 and gender = &#39;F&#39;;</li>
<li>2학년 남학생들의 아이디와 이름만 
select userid, username from student where grade = &#39;2&#39; and gender = &#39;M&#39;;</li>
<li>남학생들의 평균연령(0은 계산제외)
select avg(age) from student where gender = &#39;M&#39; and age &gt; 0;</li>
<li>남학생들을 연령순으로 순차적 정렬
select *from student where gender = &#39;M&#39; order by asc; </li>
</ol>
<p>Q3&gt;
1.st105의 연령을 14세로 대입
update student set age = 14 where userid = &#39;st105&#39;;
2. st107의 연령을 15세로 대입
update student set age = 15 where userid = &#39;st107&#39;;
3. 학년이비워있는 곳에 아래와 같은 기준으로 데이터를 채운다. 
(연령 14 -1/ 15세 -2 / 16세 -3)
update student set grade = &#39;1&#39; where grade is null and age = 14;
update student set grade = &#39;2&#39; where grade is null and age = 15;
update student set grade = &#39;3&#39; where grade is null and age = 16;
4. 성별이 비워져있는 모든데이터값 남성으로 출력
update student set gender = &#39;M&#39; where gender is null;</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[mysql#2 -2 if,case함수 사용 및 예제.]]></title>
            <link>https://velog.io/@sorah_k/mysql2-ifcase%ED%95%A8%EC%88%98-%EC%82%AC%EC%9A%A9-%EB%B0%8F-%EC%98%88%EC%A0%9C</link>
            <guid>https://velog.io/@sorah_k/mysql2-ifcase%ED%95%A8%EC%88%98-%EC%82%AC%EC%9A%A9-%EB%B0%8F-%EC%98%88%EC%A0%9C</guid>
            <pubDate>Fri, 02 Jul 2021 04:11:32 GMT</pubDate>
            <description><![CDATA[<p>1&gt; if함수!! ****많이사용
            기준 ,  참   ,   거짓<br>select if(gender=&#39;M&#39;,&#39;남학생&#39;,&#39;여학생&#39;) from student; //column명 gender=&#39;M&#39;,&#39;남학생&#39;,&#39;여학생&#39;
select if(gender=&#39;M&#39;,&#39;남학생&#39;,&#39;여학생&#39;) as &#39;gender&#39; from student; </p>
<p>//***alias써줘야 출력할때 gender라고 column이름 설정됨
    --&gt; select max(age) as age from student; //as 사용!</p>
<p>select if(age = 16,&#39;3학년&#39;, if(age = 15,&#39;2학년&#39;,&#39;3학년&#39;)) as &#39;학년&#39; from student;</p>
<p>2&gt; case 함수 
select userid as &#39;아이디&#39;,
    case
      when gender =&#39;M&#39; then &#39;남학생&#39;
      when gender = &#39;F&#39; then &#39;여학생&#39;
      else &#39;모름&#39;
    end  as &#39;성별&#39;
from student;</p>
<p>3&gt; 예제</p>
<p><img src="https://images.velog.io/images/sorah_k/post/e8ad39e8-8c44-4b34-9f39-3203f0f14b33/image.png" alt=""></p>
<ol>
<li>concat 함수 사용해서 출력 (연결을 담당)
select userid, username, concat(grade,&#39;학년&#39;) as grade from student;
<img src="https://images.velog.io/images/sorah_k/post/902d0aa6-4f39-4ded-bd73-88c549e3eebd/image.png" alt=""></li>
<li>length 함수 이용, 이름의 길이 출력 
select username, length(username) as len from student;</li>
</ol>
<p><img src="https://images.velog.io/images/sorah_k/post/1d4700be-9f7f-49ed-9920-adc7afef5da5/image.png" alt="">
3. 함수이용, 이름의 문자열길이 출력.
select concat(username, &#39;(&#39;,length(username),&#39;)&#39;) as &#39;이름&#39; from student;
<img src="https://images.velog.io/images/sorah_k/post/b61f1b30-4be9-4650-b532-350c9ad6837f/image.png" alt="">
4.이름데이터를 두자리만 출력. 
select userid as &#39;아이디&#39; , left(username,2) as &#39;이름&#39; from student;
left();좌측기준 자르는 함수. (대상, 자를 개수) 
select userid as &#39;아이디&#39;, substring(username,1, 2) as &#39;이름&#39; from student;
substring(대상,시작번호(1부터시작),출력 개수)</p>
<p><img src="https://images.velog.io/images/sorah_k/post/bb00856a-0c37-483d-bfb7-60f2fc7d1789/image.png" alt="">
5. 이름뒤에 <strong>붙이기
select userid as &#39;아이디&#39;, concat(left(username,2),&#39;</strong>&#39;) as 이름 from student;
select userid as &#39;아이디&#39;, rpad(left(username,2),4,&#39;*&#39;) as 이름 from student;
rpad() 모자란 자리 오른쪽에서부터 채우는 함수. (값,총값,채울내용)</p>
<p><img src="https://images.velog.io/images/sorah_k/post/50464926-e9db-4b46-806d-0a0a2a713e7f/image.png" alt="">
6. 이름글자수가 5개 이상인 데이터 출력
select * from student where length(username) &gt;=5;</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[MySQL #1. 설치~ 기본함수 (MacBook)
맥북도, mysql도 처음이라..]]></title>
            <link>https://velog.io/@sorah_k/MySQL-1.-%EC%84%A4%EC%B9%98-%EA%B8%B0%EB%B3%B8%ED%95%A8%EC%88%98-MacBook%EB%A7%A5%EB%B6%81%EB%8F%84-mysql%EB%8F%84-%EC%B2%98%EC%9D%8C%EC%9D%B4%EB%9D%BC</link>
            <guid>https://velog.io/@sorah_k/MySQL-1.-%EC%84%A4%EC%B9%98-%EA%B8%B0%EB%B3%B8%ED%95%A8%EC%88%98-MacBook%EB%A7%A5%EB%B6%81%EB%8F%84-mysql%EB%8F%84-%EC%B2%98%EC%9D%8C%EC%9D%B4%EB%9D%BC</guid>
            <pubDate>Thu, 01 Jul 2021 05:39:39 GMT</pubDate>
            <description><![CDATA[<p><a href="https://dev.mysql.com/downloads/mysql/">https://dev.mysql.com/downloads/mysql/</a>
mysql은 위에 링크에서(community server)</p>
<p><a href="https://dev.mysql.com/downloads/workbench/">https://dev.mysql.com/downloads/workbench/</a>
mysqlworkbench 다운링크. </p>
<p>mysql 다운받으려는데 뭐가 많아서 고르는데 조금 힘들었다. 
이리저리 검색해본결과 commutity server로 다운을 받는다는데....이유는 모르겠다..나중되면 알겠지...? ㅠㅠ</p>
<p>그리고 환경설정을하려는데 이리저리해도 안되서 일단 포기하고
mysqlworkbench를 다운받아서 실습시작. 
(대부분이 윈도우사용자고(강사님 포함) 몇 안되는 맥북유저들+ 천사같으신 윈도우 사용자님이 같이 정보를 공유해줘서 어렵게 ㅋㅋㅋㅋ시작)
<a href="https://www.youtube.com/watch?v=UU4Gz0lFK5U">https://www.youtube.com/watch?v=UU4Gz0lFK5U</a>
여기 유투브를 활용해서 시작했당. </p>
<p>간단한 실습예제들을 워크벤치에서 시작했다.
java에서의 수학관련메소드처럼...
select abs(-100); //100 절대값
select least(70,20,30); //20 가장작은값
select round(1.58); //2 반올림</p>
<p>등등 자바랑 비슷하지만 조금 다른 함수들을 실습하고 실행해봤다.
아, 상단에 번개모양키를 눌러도 되지만 command+enter하면 실행된다. 
매번 입력하고 실행해줘야되는게 불편....
한번만 실행해야지 한개나옴...두번세번하면 중복되서 계속 데이터 생성된다 ㄷㄷ</p>
<p><img src="https://images.velog.io/images/sorah_k/post/55f06b31-2aaf-4c1a-8ef0-332c5defc70d/%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202021-07-01%2013.49.46.png" alt=""><img src="https://images.velog.io/images/sorah_k/post/c5e39508-3142-420c-9dd3-c5b80d6f1193/%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202021-07-01%2013.50.13.png" alt=""></p>
<p>오늘했던 실습 요약. </p>
<p>bookinfo라는 테이블만들어서 
values값들 입력. 
만약 앞에 column안쓰고 values만 입력하고 싶으면
column이 3개면 values도 세개다 써야됨. (12번단락)</p>
<p>&#39;&#39; 이랑 null은 다름. 
찾을때 &#39;&#39;은
select *from bookinfo where country=&#39;&#39;; 하면 나오지만
select *from bookinfo where country = null이나 &#39;null&#39;; 은 안됨.
select *from bookinfo where country is null;하거나 is not null;해줘야지 원하는 데이터를 볼 수 있다. </p>
<p>update (tabel) set (column) = 원하는 value where (column) = value; (위치조건)</p>
<p>그리고 테이블도 변경이 가능한데</p>
<ol>
<li>이름변경</li>
</ol>
<ul>
<li>alter table (old name) rename to (new name);</li>
<li>rename table (old name) to (new name);</li>
</ul>
<ol start="2">
<li>테이블 삭제</li>
</ol>
<ul>
<li>drop table (table name);</li>
</ul>
<ol start="3">
<li>테이블 구조 변경 (잘사용하지않지만 시험에는 자주나온다함)</li>
</ol>
<ul>
<li>1)추가: alter table bookinfo add memo varchar(100);</li>
<li>2)변경: alter tabel bookinfo modify memo varchar(20);</li>
<li>3)삭제: alter table bookinfo drop memo;</li>
<li>4)교체: alter table bookinfo change memo comment varchar(30);</li>
</ul>
<p>첫 mysql 뭔가 헷갈리고 처음 설치때문에 정신없었지만 재밌네 ~ </p>
]]></description>
        </item>
    </channel>
</rss>