<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>iam_hyerin.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Thu, 15 Feb 2024 07:27:07 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>iam_hyerin.log</title>
            <url>https://velog.velcdn.com/images/iam_hyerin/profile/0f2a583d-6d10-4623-992d-2a617c702141/image.jpeg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. iam_hyerin.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/iam_hyerin" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[TIL] SQL/Subquery]]></title>
            <link>https://velog.io/@iam_hyerin/subquery</link>
            <guid>https://velog.io/@iam_hyerin/subquery</guid>
            <pubDate>Thu, 15 Feb 2024 07:27:07 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-subquery">📌 Subquery</h4>
<blockquote>
<p>하나의 SQL 문 안에 포함되어 있는 또 다른 SQL 문
(메인쿼리가 서브쿼리를 포함하는 종속적인 관계)</p>
</blockquote>
<pre><code>• 서브쿼리는 메인쿼리의 칼럼 사용 가능
• 메인쿼리는 서브쿼리의 칼럼 사용 불가</code></pre><p>🚫 주의사항</p>
<pre><code>• 서브쿼리는 괄호로 묶어서 사용
• 단일 행 혹은 복수 행 비교 연산자와 함께 사용 가능
• 서브쿼리 에서는 order by 사용불가</code></pre><h4 id="📌-subquery-종류">📌 subquery 종류</h4>
<blockquote>
<p>스칼라 서브쿼리 (Scalar Subquery) - <strong>SELECT 절에 사용</strong>
인라인 뷰 (Inline View) - <strong>FROM 절에 사용</strong>
중첩 서브쿼리 (Nested Subquery) - <strong>WHERE 절에 사용</strong></p>
<blockquote>
<p>📌 <strong>Nested Subquery</strong> <br>
Single Row - 하나의 열을 검색하는 서브쿼리
Multiple Row - 하나 이상의 열을 검색하는 서브쿼리
Multiple Column - 하나 이상의 행을 검색하는 서브쿼리</p>
</blockquote>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>SCALAR SUBQUERY 문법</code></p>
<pre><code class="language-sql">select column1, (select column2 from table2 where condition)
from table1
where condition</code></pre>
<p>🚫 결과는 하나의 Column 이어야 함</p>
<p><code>INLINE VIEW 문법</code></p>
<pre><code class="language-sql">select a.column, b.column
from table1 a, (select column1, column2 from table2) b
where condition</code></pre>
<p>🚫 메인쿼리에서는 인라인 뷰에서 조회한 Column 만 사용가능</p>
<p><code>NESTED SUBQUERY 문법</code></p>
<pre><code class="language-sql">- single row
//서브쿼리가 비교연사자와 사용되는 경우

select column_name from tablename
where column_name = (select column_name from tablename where condition)
order by column_name</code></pre>
<p>🚫 서브쿼리의 검색 결과는 한 개의 결과값을 가져야함 (두개 이상인 경우 에러)
🚫 괄호 없으면 에러 발생</p>
<pre><code class="language-sql">-Multiple Row - IN
//서브쿼리 결과 중에 포함되는 경우

select column_name from tablename
where column_name in (select column_name from tablename where condition)
order by column_name
`
-Multiple Row - EXISTS
//서브쿼리 결과에 값이 있으면 반환

select column_name from tablename
where exists (select column_name from tablename where condition)
order by column_name

-Multiple Row - ANY
//서브쿼리 결과 중에 최소한 하나라도 만족하는 경우 (비교연산자 사용)

select column_name from tablename
where column_name = any (select column_name from tablename where condition)
order by column_name

-Multiple Row - ALL
//서브쿼리 결과를 모두 만족하는 경우(비교 연산자 사용)

select column_name from tablename
where column_name = all (select column_name from tablename where condition)
order by column_name</code></pre>
<pre><code class="language-sql">-Multi Column Subquery - 연관 서브쿼리
//서브쿼리 내에 메인쿼리 컬럼이 같이 사용되는 경우

select column_name from tablename a
where (a.column1, a.column2, ...) (select b.column1, b.column2, ... from tablename b where a.column = b.column)
order by column_name</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<blockquote>
<ul>
<li>공공데이터 csv 파일로 연습하기
<code>5대범죄 발생 검거 현황</code>
<img src="https://velog.velcdn.com/images/iam_hyerin/post/c0586e28-3e96-4900-b4d8-64529af1e327/image.png" alt=""><code>5대범죄 발생 장소별 현황</code>
<img src="https://velog.velcdn.com/images/iam_hyerin/post/512d5822-c465-400c-997b-d102d6949c4f/image.png" alt=""></li>
</ul>
</blockquote>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/2685b5e8-0c8f-40af-8f01-0290c3243f25/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/ef5ee28a-b401-43c4-96b3-7a84815095fb/image.png" alt=""></th>
</tr>
</thead>
<tbody><tr>
<td><br></td>
<td></td>
</tr>
</tbody></table>
<ul>
<li><p>서울시 살인이 가장 많이 발생한 장소와 살인 발생 건수 조회</p>
<pre><code class="language-sql">select ANY_VALUE(장소) 장소, max(발생건수) 발생건수,
(select sum(건수) from 지역별_5대범죄 where 죄종=&#39;살인&#39; and 발생검거=&#39;발생&#39;) 총발생건수
from 장소별_5대범죄 
where 범죄명=&#39;살인&#39;</code></pre>
<blockquote>
<p>❗️sql_mode=only_full_group_by 에러
group by 절에 포함되지 않는 column 을 select 할 경우 발생하는 에러
<br><strong>해결방안</strong>
ANY_VALUE(column)함수 사용</p>
</blockquote>
</li>
<li><p>지역별로 가장 많이 발생한 범죄 건수와 범죄 유형을 inline view 를 조회<br>(발생건수가 큰 순으로 정렬하여 5개 조회)</p>
<pre><code class="language-sql">select 지역, 죄종 유형, 건수 발생건수 
from 지역별_5대범죄 a,
(select 지역 지역구분, max(건수) 발생건수 from 지역별_5대범죄 where 발생검거=&#39;발생&#39; group by 지역구분) b 
where a.지역 = b.지역구분 and a.건수=b.발생건수
order by 건수 desc
limit 5;</code></pre>
</li>
<li><p>발생 건수가 가장 큰 범죄 유형과 지역을 nested subquery 를 사용하여 조회</p>
<pre><code class="language-sql">select 지역, 죄종 범죄유형 
from 지역별_5대범죄 
where 건수 in (select max(건수) from 지역별_5대범죄 where 발생검거=&#39;발생&#39;);</code></pre>
</li>
<li><p>발생 건수가 2000 이상인 지역과 범죄유형을 중복없이 nested subquery 를 사용하여 조회</p>
<pre><code class="language-sql">select distinct(지역),죄종 범죄유형
from 지역별_5대범죄 a
where exists 
(select 지역, 죄종 from 지역별_5대범죄 b where a.지역 = b.지역 and 발생검거=&#39;발생&#39; and a.죄종=b.죄종 and 건수 &gt;=2000);</code></pre>
<p><code>실습확인</code></p>
</li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/c46e7ec3-938d-45ef-b0d9-37ead98cc105/image.png" alt=""><img src="https://velog.velcdn.com/images/iam_hyerin/post/c820de60-78cd-40e6-8dad-fefed0a7d862/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/6c05028d-5810-4d9c-b9b4-1e8567ffc8f9/image.png" alt=""></th>
</tr>
</thead>
</table>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/2804e3a1-0f70-423c-bd7d-01447e25ea9b/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Other Functions]]></title>
            <link>https://velog.io/@iam_hyerin/otherfunctions</link>
            <guid>https://velog.io/@iam_hyerin/otherfunctions</guid>
            <pubDate>Wed, 14 Feb 2024 05:48:11 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-concat">📌 Concat</h4>
<blockquote>
<p>여러 문자열을 하나로 합치거나 연결</p>
</blockquote>
<h4 id="📌-alias">📌 Alias</h4>
<blockquote>
<p>칼럼이나 테이블 이름에 별칭 생성</p>
</blockquote>
<h4 id="📌-distinct">📌 Distinct</h4>
<blockquote>
<p>검색한 결과의 중복 제거</p>
</blockquote>
<h4 id="📌-limit">📌 Limit</h4>
<blockquote>
<p>검색결과를 정렬된 순으로 주어진 숫자만큼만 조회</p>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>CONCAT 문법</code></p>
<pre><code class="language-sql">select concat(&#39;string1&#39;,&#39;string2&#39;, ...)</code></pre>
<p><code>ALIAS 문법</code></p>
<pre><code class="language-sql">select column as alias
from tablename</code></pre>
<p><code>DISTINCT 문법</code></p>
<pre><code class="language-sql">select distinct column1, column2, ...
from tablename</code></pre>
<p><code>LIMIT 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where condition
limit number;</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>놀면뭐하니 table 에서 이름이 세글자인 연예인 정보를 3개만 검색<br>column_name = information (이름 : name , 직업 : job_title)<pre><code class="language-sql">select concat(&#39;이름 :&#39;,name,&#39; 직업 :&#39;,job_title) as information
from 놀면뭐하니
where name like &#39;___&#39;
limit 3;</code></pre>
</li>
<li>놀면뭐하니 에 출연한 연예인 중 핑계고 에 출연한 연예인 정보를 검색<br> column_name = 신상정보/출연정보/소속사 정보<br>(나이 :age(성별)) (시즌-에피소드/방송날짜)<pre><code class="language-sql">select concat(&#39;이름:&#39;,a.name,&#39; 나이:&#39;,a.age,&#39;(&#39;,a.sex,&#39;)&#39;) as 신상정보, 
concat(b.season,&#39;-&#39;,b.episode,&#39; / &#39;,b.broadcast_date) as 출연자정보, 
a.agency 소속사정보
from 놀면뭐하니 a, 핑계고 b
where a.name=b.guest;</code></pre>
</li>
<li>핑계고 table 에서 시즌 종류를 검색하여 시즌순으로 정렬<pre><code class="language-sql">select distinct season from 핑계고
order by season;</code></pre>
</li>
<li>놀면뭐하니 table 에서 남자 연예인 중 나이가 가장 많은 3명 조회<pre><code class="language-sql">select name, age, sex from 놀면뭐하니
where sex = &#39;M&#39;
order by age desc
limit 5;</code></pre>
</li>
<li>핑계고에 출연한 연예인의 정보를 최신 방송날짜 순으로 2개만 검색<br> column_name = 핑계고_방송정보<br>(핑계고 시즌season 에피소드episode 게스트 guest)<pre><code class="language-sql">select concat(&#39;핑계고 &#39;,&#39;시즌&#39;,season,&#39; 에피소드&#39;,episode,&#39; 게스트 &#39;,guest) 핑계고_방송정보
from 핑계고
order by broadcast_date desc
limit 2;</code></pre>
<code>실습확인</code></li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/e74601bd-05d2-49e6-9467-d23da00d49b6/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/10e9639c-e2fe-495b-9332-29585a9f05c8/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/4aa121aa-0efe-44fa-a9f0-437655098460/image.png" alt=""></th>
</tr>
</thead>
<tbody><tr>
<td><br></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/686c602d-fa4e-4307-a261-713e8973cfcf/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/d892e30b-f864-4187-8080-fda0aa91744a/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Scalar Functions]]></title>
            <link>https://velog.io/@iam_hyerin/scalarfunctions</link>
            <guid>https://velog.io/@iam_hyerin/scalarfunctions</guid>
            <pubDate>Tue, 13 Feb 2024 06:32:03 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-nbsp-scalar-functions">📌 &amp;nbsp Scalar Functions</h4>
<table>
<thead>
<tr>
<th>Function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>UCASE</td>
<td>영문을 대문자로 변환하는 함수</td>
</tr>
<tr>
<td>LCASE</td>
<td>영문을 소문자로 변환하는 함수</td>
</tr>
<tr>
<td>MIN</td>
<td>문자열 부분을 반환하는 함수</td>
</tr>
<tr>
<td>LENGTH</td>
<td>문자열의 길이를 반환하는 함수</td>
</tr>
<tr>
<td>ROUND</td>
<td>지정한 자리에서 숫자를 반올림하는 함수<br>(0이 소수점 첫째자리)</td>
</tr>
<tr>
<td>NOW</td>
<td>현재 날짜 및 시간을 반환하는 함수</td>
</tr>
<tr>
<td>FORMAT</td>
<td>숫자를 천단위 콤마가 있는 형식으로 반환하는 함수</td>
</tr>
</tbody></table>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>UCASE 문법</code></p>
<pre><code class="language-sql">select ucase(&#39;string&#39;)</code></pre>
<p><code>LCASE 문법</code></p>
<pre><code class="language-sql">select lcase(&#39;string&#39;)</code></pre>
<p><code>MID 문법</code></p>
<pre><code class="language-sql">select mid(&#39;string&#39;, start_position, lenth)

string : 원본 문자열
start_position : 문자열 반환 시작 위치(첫글자 1, 마지막글자 -1)
lenth : 반환할 문자열 길이</code></pre>
<p><code>LENGTH 문법</code></p>
<pre><code class="language-sql">select length(&#39;string&#39;) //공백도 포함

-null 은 null</code></pre>
<p><code>ROUND 문법</code></p>
<pre><code class="language-sql">select round(number, decimal_place)

number : 반올림할 대상
decimal_place : 반올림할 소수점 위치(option)
// 반올림할 위치를 지정하지 않을 경우, (0)에서 반올림</code></pre>
<p><code>NOW 문법</code></p>
<pre><code class="language-sql">select now()</code></pre>
<p><code>FORMAT 문법</code></p>
<pre><code class="language-sql">select format(number, decimal_place)

number : 포맷을 적용 할 문자 혹은 숫자
decimal_place : 표시할 소수점 위치
// 소수점을 표시하지 않을 경우 0</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<blockquote>
<ul>
<li>cafe table</li>
</ul>
</blockquote>
<pre><code class="language-sql">create table cafe
(
    type varchar(8),
    menu varchar(32),
    price int,
    ranking int
);</code></pre>
<ul>
<li>cafe table 에서 종류는 대문자, 메뉴는 소문자로 조회<pre><code class="language-sql">select ucase(type) type,lcase(menu) menu
from cafe;</code></pre>
</li>
<li>cafe table 에서 6위 메뉴의 마지막 단어 조회<pre><code class="language-sql">select menu, mid(menu,-4,4) from cafe
where ranking = 6;</code></pre>
</li>
<li>cafe table 에서 메뉴 이름의 평균 길이 조회<pre><code class="language-sql">select truncate(avg(length(menu)),1) avg from cafe;</code></pre>
</li>
<li>cafe table 에서 가격을 천단위에 콤마를 넣어 조회<pre><code class="language-sql">select menu, format(price,0) price from cafe;</code></pre>
<code>실습확인</code></li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/63a89ae9-86ee-458e-b1ff-67a9b518bdbe/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/91e47d6f-0144-4de4-aaf1-529e4a4db879/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/8633a2fb-4243-4b38-9999-deb7284f19e3/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/a4c7e5f2-a9a7-4e8f-90b9-f8da3db4d194/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Aggregate functions]]></title>
            <link>https://velog.io/@iam_hyerin/aggregatefunctions</link>
            <guid>https://velog.io/@iam_hyerin/aggregatefunctions</guid>
            <pubDate>Mon, 12 Feb 2024 06:44:31 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-nbsp-aggregate-functions-집계함수">📌 &amp;nbsp Aggregate Functions (집계함수)</h4>
<table>
<thead>
<tr>
<th align="center">Function</th>
<th align="center">Description</th>
</tr>
</thead>
<tbody><tr>
<td align="center">COUNT</td>
<td align="center">총 갯수를 계산해주는 함수</td>
</tr>
<tr>
<td align="center">SUM</td>
<td align="center">합계를 계산해주는 함수</td>
</tr>
<tr>
<td align="center">AVG</td>
<td align="center">평균을 계산해주는 함수</td>
</tr>
<tr>
<td align="center">MIN</td>
<td align="center">가장 작은 값을 찾아주는 함수</td>
</tr>
<tr>
<td align="center">MAX</td>
<td align="center">가장 큰 값을 찾아주는 함수</td>
</tr>
<tr>
<td align="center">FIRST</td>
<td align="center">첫번째 값을 리턴해주는 함수</td>
</tr>
<tr>
<td align="center">LAST</td>
<td align="center">마지막 값을 리턴해주는 함수</td>
</tr>
</tbody></table>
<h4 id="📌-group-by">📌 Group By</h4>
<blockquote>
<p>그룹화하여 데이터를 조회</p>
</blockquote>
<h4 id="📌-having">📌 Having</h4>
<blockquote>
<p>조건에 <strong>집계함수</strong> 가 포함되는 경우 WHERE 대신 <strong>HAVING 사용</strong></p>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>COUNT 문법</code></p>
<pre><code class="language-sql">select count(column) from tablename
where condition</code></pre>
<p><code>SUM 문법</code></p>
<pre><code class="language-sql">select sum(column) from tablename
where condition</code></pre>
<p><code>AVG 문법</code></p>
<pre><code class="language-sql">select avg(column) from tablename
where condition</code></pre>
<p><code>MIN 문법</code></p>
<pre><code class="language-sql">select min(column) from tablename
where condition</code></pre>
<p><code>MAX 문법</code></p>
<pre><code class="language-sql">select max(column) from tablename
where condition</code></pre>
<p><code>GROUP BY 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from table
where condition
group by column1, column2, ...</code></pre>
<p><code>HAVING 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where condition
group by column1, column2, ...
having condition //집계함수 포함
group by column1, column2, ...</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<blockquote>
<ul>
<li>공공데이터 csv 파일로 연습하기
<code>서울시 공공자전거 대여소별 이용정보(월별)</code><img src="https://velog.velcdn.com/images/iam_hyerin/post/696a96e0-75b0-441b-852a-1a75c8655104/image.png" alt=""><br></li>
</ul>
</blockquote>
<ul>
<li>판다스로 데이터 살펴보기
<img src="https://velog.velcdn.com/images/iam_hyerin/post/bb990db5-b44a-4bfc-a01a-c9c1b4653861/image.png" alt="">+ <strong>데이터 insert 80분 소요(참고하세요!)</strong></li>
</ul>
<p>❗️csv 파일 인코딩 알아보는 방법</p>
<pre><code class="language-python">import chardet
filename = &quot;서울특별시 공공자전거 대여소별 이용정보(월별).csv&quot; # 파일명
with open(filename,&#39;rb&#39;)as f:
    result = chardet.detect(f.readline())
    print(result[&#39;encoding&#39;])</code></pre>
<ul>
<li>자치구 별로 공공자전거 대여건수가 가장 많은 대여소 순으로 5개 검색하고 큰 순서대로 정렬하여 확인<pre><code class="language-sql">select 자치구, max(대여건수) max from 공공자전거
group by 자치구
order by max(대여건수) desc
limit 5;</code></pre>
</li>
<li>자치구 별로 공공자전거 대여건수가 가장 적은 대여소 순으로 5개 검색하고 작은 순서대로 정렬하여 확인<pre><code class="language-sql">select 자치구, min(대여건수) min from 공공자전거
group by 자치구
order by min(대여건수)
limit 5;</code></pre>
</li>
<li>자치구 별로 공공자전거 평균 대여건수를 5개 검색하고, 큰 순서대로 정렬 (소수점x)<pre><code class="language-sql">select 자치구, truncate(avg(대여건수),-1) avg from 공공자전거
group by 자치구
order by avg(대여건수) desc
limit 5;</code></pre>
</li>
<li>&#39;4글자&#39;인 자치구 별 대여건수의 평균이 1500건 이상인 경우를 검색<pre><code class="language-sql">select 자치구, truncate(avg(대여건수),-1) avg from 공공자전거
where 자치구 like &#39;____&#39;
group by 자치구
having avg(대여건수) &gt;=1500;</code></pre>
<code>실험확인</code></li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/c993871d-a5b6-4428-a2af-74eb3b09faa4/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/b2d42dfd-9b7e-49c0-9866-163d0db0a3ad/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/35fc21a4-fd33-4c17-b264-837060ab34c8/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/d3db7574-af13-4347-9814-573a859aefdc/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Key]]></title>
            <link>https://velog.io/@iam_hyerin/key</link>
            <guid>https://velog.io/@iam_hyerin/key</guid>
            <pubDate>Sat, 10 Feb 2024 10:15:38 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-nbsp-primary-key-기본키">📌 &amp;nbsp Primary Key (기본키)</h4>
<blockquote>
<ul>
<li>테이블의 각 레코드를 식별</li>
</ul>
</blockquote>
<ul>
<li>중복되지 않은 고유값을 포함</li>
<li>NULL 값을 포함할 수 없음</li>
<li>테이블 당 하나의 기본키를 가짐</li>
</ul>
<h4 id="📌-nbsp-foreign-key-외래키">📌 &amp;nbsp Foreign Key (외래키)</h4>
<blockquote>
<ul>
<li>한 테이블을 다른 테이블과 연결해주는 역할</li>
</ul>
</blockquote>
<ul>
<li>참조되는 테이블의 항목은 그 테이블의 기본키 (혹은 단일값)</li>
</ul>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>Primary Key 문법</code></p>
<pre><code class="language-sql">//create table 에서 Primary key를 설정
create table tablename
(
    column1 datatype not null,
    column2 datatype not null,
    ...
    constraint constraint_name
    primary key (column1, column2, ...)
)

// 테이블 생성 후 Primary Key 추가
alter table tablename
add primary key (column1, column2, ...) </code></pre>
<p><code>Primary Key 삭제 문법</code></p>
<pre><code class="language-sql">alter table tablename
drop primary key(column) </code></pre>
<p><code>Foreign Key 문법</code></p>
<pre><code class="language-sql">//create table 에서 foreign key를 설정
create table tablename
(
    column1 datatype not null,
    column2 datatype not null,
    column3 datatype,
    column4 datatype,
    ...
    constraint constraint_name //생략가능
      primary key (column1, column2, ...),
    constraint constraint_name //생략가능
      foreign key (column3, column4, ...) references ref_tablename(ref_column)
)

// table 생성 후 foreign key 추가
alter table tablename
add foreign key(column) references ref_tablename(ref_column)</code></pre>
<p><code>자동 생성된 CONSTRAINT 를 확인</code></p>
<pre><code class="language-sql">show create table tablename</code></pre>
<p><code>Foreign Key 삭제 문법</code></p>
<pre><code class="language-sql">alter table tablename
drop foreign key constraint_name</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<blockquote>
<ul>
<li>orders table</li>
</ul>
</blockquote>
<pre><code class="language-sql">create table orders
(
  order_id int not null primary key,
  user_id int,
  product varchar(32)
);</code></pre>
<ul>
<li><p>users table</p>
<pre><code class="language-sql">create table users
(
id int not null primary key,
pw varchar(16) not null,
name varchar(16) not null,
email varchar(32)
);</code></pre>
</li>
<li><p>orders 테이블의 primary key 삭제</p>
<pre><code class="language-sql">alter table orders
drop primary key;</code></pre>
<p>orders 테이블의 foreign key 삭제</p>
<pre><code class="language-sql">alter table orders
drop foreign key orders_ibfk_1; // 자동으로 생성된 constraint_name</code></pre>
</li>
<li><p>orders 테이블의 user_id 를 users 테이블의 id 와 연결된 foreign key 등록</p>
<pre><code class="language-sql">alter table orders
add foreign key (user_id) references users (id);</code></pre>
</li>
<li><p>orders 테이블의 order_id 를 primary key 로 등록</p>
<pre><code class="language-sql">alter table orders
add primary key(order_id);</code></pre>
<p><code>실습확인</code></p>
</li>
</ul>
<table>
<thead>
<tr>
<th>orders<img src="https://velog.velcdn.com/images/iam_hyerin/post/2b3e5d93-4e23-483c-97f6-05f049cb01cd/image.png" alt=""></th>
<th>users<img src="https://velog.velcdn.com/images/iam_hyerin/post/bcf71aa3-c2bf-4461-81c6-a52ac7471166/image.png" alt=""></th>
</tr>
</thead>
</table>
<table>
<thead>
<tr>
<th>constraint_name 확인<img src="https://velog.velcdn.com/images/iam_hyerin/post/f8e88e4d-a467-48ab-bc97-21e13664512a/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] Python with MYSQL]]></title>
            <link>https://velog.io/@iam_hyerin/pythonwithmysql</link>
            <guid>https://velog.io/@iam_hyerin/pythonwithmysql</guid>
            <pubDate>Fri, 09 Feb 2024 16:58:27 GMT</pubDate>
            <description><![CDATA[<h3 id="💻-실습">💻 실습</h3>
<p><code>install mysql driver</code></p>
<pre><code class="language-python"># mysql driver 설치
pip install mysql-connector-python

# 설치확인

import.mysql.connector</code></pre>
<p><strong><code>Python with MYSQL</code></strong></p>
<p><code>create connection</code></p>
<pre><code class="language-python">MYSQL에 접속하기 위한 코드

&lt;connection name&gt; = mysql.connector.connect(
        host = &quot;&lt;hostname&gt;&quot;,
        user = &quot;&lt;username&gt;&quot;,
        password = &quot;&lt;password&gt;&quot;,
        database = &quot;&lt;databasename&gt;&quot; #특정 데이터베이스 설정
)</code></pre>
<p><code>close connection</code></p>
<pre><code class="language-python">&lt;connection name&gt;.close()</code></pre>
<p><code>execute SQL</code></p>
<pre><code class="language-python">Query 를 실행하기 위한 코드

&lt;cursorname&gt; = &lt;connection name&gt;.cursor()
&lt;cursorname&gt;.execute(&lt;query&gt;)</code></pre>
<p><code>execute SQL File</code></p>
<pre><code class="language-python">SQL File 을 실행하기 위한 코드

&lt;cursorname&gt; = &lt;connection name&gt;.cursor()

sql = open(&quot;&lt;filename&gt;.sql&quot;).read()
&lt;cursorname&gt;.execute(sql) # SQL File 내에 Query 가 여러개 존재하는 경우 multi=True 추가</code></pre>
<p><code>fetchall()</code></p>
<pre><code class="language-python">&lt;cursorname&gt; = &lt;connection name&gt;.cursor() # 읽어올 데이터 양이 많은 경우 buffered=True
mycursor.execute(&lt;query&gt;)

result = &lt;cursorname&gt;.fetchall()
for data in result:
    print(data)</code></pre>
<p>➕ 검색결과 pandas 로 읽기</p>
<pre><code class="language-python">import pandas as pd

df = pd.DataFrame(result)
df.head()</code></pre>
<p><strong>CSV 에 있는 데이터를 Python 으로 INSERT 하는법</strong></p>
<ul>
<li>mysql 에 접속한 상태</li>
</ul>
<p>1️⃣ <code>read csv</code></p>
<pre><code class="language-python">import pandas as pd

df = pd.read_csv(&quot;&lt;csvfilename&gt;&quot;) # csv 한글이 깨지는 경우, encoding 값을 &#39;euc-kr&#39; 로 설정
df.head()</code></pre>
<p>2️⃣ <code>cursor 만들기</code></p>
<pre><code class="language-python">&lt;cursorname&gt; = &lt;connection name&gt;.cursor(buffered=True)</code></pre>
<p>3️⃣ <code>inser문 만들기</code></p>
<pre><code class="language-python">sql = &quot;insert into &lt;tablename&gt; values (%s, %s,...)&quot;</code></pre>
<p>4️⃣ <code>데이터 입력</code></p>
<pre><code class="language-python">for i, row in df.iterrows():
    &lt;cursorname&gt;.execute(sql, tuple(row))
    print(tuple(row))
    &lt;connection name&gt;.commit() # commit() 은 database 에 적용하기 위한 명령</code></pre>
<p>5️⃣ <code>결과확인</code></p>
<pre><code class="language-python">&lt;cursorname&gt;.execute(&quot;select * from &lt;tablename&gt;&quot;)

result = &lt;cursorname&gt;.fetchall()
for row in result:
    print(row)</code></pre>
<p>➕ pandas 로 결과 읽기</p>
<pre><code class="language-python">df = pd.DataFrame(result)
df.head()</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>공공데이터 csv 파일로 연습하기
기상청 기상자료개방포털 <a href="https://buly.kr/A42pJWU">https://buly.kr/A42pJWU</a>
<img src="https://velog.velcdn.com/images/iam_hyerin/post/36a6b4c7-8f63-4083-ad3d-48bab0fb64eb/image.png" alt=""></li>
</ul>
<p>❌ encoding=&#39;utf-8&#39; 로 하면 한글이 깨지고,
encoding=&#39;cp949&#39; &amp; &#39;euc-kr&#39;은 인식을 못하는 문제가 발생함 😭</p>
<p>[-해결방안 정리해서 작성하기-]</p>
<p>-- 이번파일은 데이터가 크지 않아서 csv 파일을 수정해서 사용함.</p>
<ul>
<li>AWS RDS(database-1) review 에 접속<pre><code class="language-python">conn = mysql.connector.connect(
  host = &quot;database-1.ct6emoc66tc9.ap-southeast-2.rds.amazonaws.com&quot;,
   port = &quot;3306&quot;,
  user = &quot;admin&quot;,
  password = &quot;***********&quot;,
  database = &quot;review&quot;
)</code></pre>
</li>
<li>Temperature Table 생성하기<pre><code class="language-python">sql = &quot;create table temperature (날짜 date, 지역 varchar(8), 평균기온 float, 최저기온 float, 최고기온 float)&quot;
cursor = conn.cursor(buffered=True)
</code></pre>
</li>
</ul>
<p>cursor.execute(sql)</p>
<pre><code>- 데이터를 pandas로 읽어오기
```python
df = pd.read_csv(&quot;temperature.csv&quot;, encoding=&#39;utf-8&#39;)
df.head(2)</code></pre><ul>
<li>데이터를 temperature 테이블에 insert 하기<pre><code class="language-python">sql = &quot;insert into temperature values(%s,%s,%s,%s,%s)&quot;
cursor = conn.cursor(buffered=True)
</code></pre>
</li>
</ul>
<p>for i, row in df.iterrows():
    cursor.execute(sql, tuple(row))
    print(tuple(row))
    conn.commit()</p>
<pre><code>- temperature 테이블의 데이터 조회하기
```python
cursor.execute(&quot;select*from temperature&quot;)

result = cursor.fetchall()
for row in result:
    print(row)</code></pre><ul>
<li>조회된 데이터를 Pandas 로 변환하여 출력하기<pre><code class="language-python">df = pd.DataFrame(result)
df.head()</code></pre>
<code>실습확인</code></li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/72db7f46-b9bf-4e89-85f2-2e2e6e9b7f64/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/89811809-f5e8-47cb-ba44-dc38e174624f/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/File]]></title>
            <link>https://velog.io/@iam_hyerin/file</link>
            <guid>https://velog.io/@iam_hyerin/file</guid>
            <pubDate>Thu, 08 Feb 2024 09:56:11 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-sql-file">📌 SQL File</h4>
<blockquote>
<p>SQL 쿼리를 모아놓은 파일</p>
</blockquote>
<h4 id="📌-database-restore">📌 Database Restore</h4>
<blockquote>
<p>데이터베이스를 백업한 SQL File 을 실행하여 그 시점으로 복구하거나 이전 할 수 있다</p>
</blockquote>
<h4 id="📌-table-restore">📌 Table Restore</h4>
<blockquote>
<p>Table 을 백업한 SQL File 을 실행하여 해당 테이블을 복구하거나 이전 할 수 있다</p>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>SQL File 실행</code> - 로그인 이후</p>
<pre><code class="language-sql">mysql&gt; source &lt;/path/filename.sql&gt;
mysql&gt; \. &lt;/path/filename.sql&gt; // source 대신 \. 가능
mysql&gt; \. &lt;filename.sql&gt; // 현재 폴더에 파일이 있는 경우</code></pre>
<p><code>SQL File 실행</code> - 외부에서 바로 실행</p>
<pre><code class="language-sql">% mysql -u root -p &lt;database&gt; &lt; &lt;/path/filename.sql&gt;</code></pre>
<p><code>Database Backup</code></p>
<pre><code class="language-sql">% mysqldump -u username -p dbname &gt; backup.sql // 특정 database backup
% mysqldump -u username -p --all-databases &gt; backup.sql // 모든 database backup</code></pre>
<p><code>Database Restore</code></p>
<pre><code>// SQL File 실행하는 방법과 동일</code></pre><p><code>Table Backup</code> </p>
<pre><code class="language-sql">//table 단위로도 백업 가능
% mysqldump -u username -p dbname tablename &gt; backup.sql</code></pre>
<p><code>Table Restore</code></p>
<pre><code>// SQL File 실행하는 방법과 동일</code></pre><p><code>Table Schema Backup</code></p>
<pre><code class="language-sql">데이터를 제외하고 테이블 생성 쿼리만 백업 할 수 있다

% mysqldump -d -u username -p dbname tablename &gt; backup.sql // 특정 Table Schema Backup
% mysqldump -d -u username -p dbname &gt; backup.sql // 모든 Table Schema Backup</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>AWS RDS(database-1) review 데이터베이스 백업하기<pre><code class="language-sql">% mysqldump --set-gtid-purged=OFF-h &quot;database-1.ct6emoc66tc9.ap-southeast-2.rds.amazonaws.com&quot; -P &quot;3306&quot; -u admin -p review &gt; bk_review.sql</code></pre>
</li>
<li>AWS RDS (database-1)에 admin 계정으로 로그인하기<pre><code class="language-sql">% mysql -h &quot;database-1.ct6emoc66tc9.ap-southeast-2.rds.amazonaws.com&quot; -P &quot;3306&quot; -u admin -p</code></pre>
</li>
<li>Database(testdb) 생성하기 (DEFAULT CHRACTER SET utf8mb4)<pre><code class="language-sql">create database testdb;</code></pre>
</li>
<li>사용자 (hyerin@%) 에게 testdb 의 모든 권한을 부여하기<pre><code class="language-sql">grant all on testdb.* to &#39;hyerin&#39;@&#39;%&#39;;</code></pre>
</li>
<li>앞서 백업한 review 의 백업 파일을 testdb 에서 실행하기<pre><code class="language-sql">use testdb;
\. bk_review.sql</code></pre>
</li>
<li>놀면뭐하니 테이블에 데이터를 INSERT 하기 위한 SQL 파일 생성하기
```sql</li>
<li>-놀면뭐하니insert.sql</li>
</ul>
<p>insert into 놀면뭐하니 values (1,&#39;유재석&#39;,&#39;1972-08-14&#39;,53,&#39;M&#39;,&#39;MC,개그맨&#39;,&#39;안테나&#39;);
insert into 놀면뭐하니 values (2,&#39;하하&#39;,&#39;1979-08-20&#39;,46,&#39;M&#39;,&#39;래퍼,방송인&#39;,&#39;QUAN엔터테이먼트&#39;);
insert into 놀면뭐하니 values (3,&#39;이이경&#39;,&#39;1989-01-08&#39;,36,&#39;M&#39;,&#39;배우&#39;,&#39;상영이엔티&#39;);
insert into 놀면뭐하니 values (4,&#39;주우재&#39;,&#39;1986-11-28&#39;,39,&#39;M&#39;,&#39;모델,방송인&#39;,&#39;YG엔터테이먼트&#39;);
insert into 놀면뭐하니 values (5,&#39;이미주&#39;,&#39;1994-09-23&#39;,31,&#39;F&#39;,&#39;가수&#39;,&#39;안테나&#39;);
insert into 놀면뭐하니 values (6,&#39;박진주&#39;,&#39;1988-12-24&#39;,37,&#39;F&#39;,&#39;배우,가수&#39;,&#39;프레인TPC&#39;);</p>
<pre><code>- SQL 파일을 실행하여 AWS RDS (database-1) review 의 놀면뭐하니 테이블에 데이터를 INSERT 하고 확인하기
```sql
use review;

\. 놀면뭐하니insert.sql //SQL 파일 실행

select * from 놀면뭐하니; //테이블 확인</code></pre><ul>
<li>AWS RDS (database-1) review 의 놀면뭐하니 테이블을 SQL 파일로 백업하기<pre><code class="language-sql">% mysqldump --set-gtid-purged=OFF -h &quot;database-1.ct6emoc66tc9.ap-southeast-2.rds.amazonaws.com&quot; -P &quot;3306&quot; -u admin -p review 놀면뭐하니 &gt; 놀면뭐하니backup.sql</code></pre>
</li>
<li>SQL 파일을 실행하여 AWS RDS (database-1) testdb 의 놀면뭐하니 테이블을 review 와 동일하게 만들고 확인하기</li>
</ul>
<pre><code class="language-sql">use testdb;

\. 놀면뭐하니bavkup.sql //SQL 파일 실행

select * from 놀면뭐하니;</code></pre>
<p><code>실습확인</code></p>
<ul>
<li>데이터베이스 review 와 testdb 동일하게 만들기</li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/41d1a1a0-698e-4fd9-9a9e-0d55bee24159/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/c70d98f0-b1e3-43bd-9b28-87dc0c9c7b14/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/JOIN]]></title>
            <link>https://velog.io/@iam_hyerin/join</link>
            <guid>https://velog.io/@iam_hyerin/join</guid>
            <pubDate>Wed, 07 Feb 2024 14:03:01 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-join">📌 JOIN</h4>
<blockquote>
<p>두 개 이상의 테이블을 결합하는 것</p>
</blockquote>
<h4 id="📌--join-종류">📌  JOIN 종류</h4>
<blockquote>
<blockquote>
<p><code>INNER JOIN</code>
두 개의 테이블에서 공통된 요소들을 통해 결합하는 조인방식<br>
<code>LEFT JOIN</code>
두 개의 테이블에서 공통영역을 포함해 왼쪽 테이블의 다른 데이터를 포함하는 조인방식<br>
<code>RIGHT JOIN</code>
두 개의 테이블에서 공통영역을 포함해 오른쪽 테이블의 다른 데이터를 포함하는 조인방식<br>
<code>FULL JOIN</code>
두 개의 테이블에서 공통영역을 포함하여 양쪽 테이블의 다른영역을 모두 포함하는 조인방식<br>
<code>SELF JOIN</code>
자기 자신의 테이블에 대해서 1개 행씩 결합하는 조인방식<br>
<code>CROSS JOIN</code>
조인 조건 없이 테이블끼리 결합하는 조인방식<br></p>
</blockquote>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>INNER JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA
inner join tableB
on tableA.column = tableB.column
where condition</code></pre>
<p><code>LEFT JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA
left join tableB
on tableA.column = tableB.column
where condition</code></pre>
<p><code>RIGHT JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA
right join tableB
on tableA.column = tableB.column
where condition</code></pre>
<p><code>FULL JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA
full outer join tableB
on tableA.column = tableB.column
where condition</code></pre>
<p><code>SELF JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA, tableB, ...
where condition</code></pre>
<p><code>CROSS JOIN 문법</code></p>
<pre><code class="language-sql">select column1, column2, ...
from tableA
cross join tableB</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<blockquote>
<ul>
<li>핑계고 table</li>
</ul>
</blockquote>
<pre><code class="language-sql">create table 핑계고
(
  id int not null auto_increment primary key,
  guest varchar(32) not null,
  broadcast_date date,
  episode int not null,
  season int not null
);</code></pre>
<ul>
<li><p>핑계고 table 에 데이터 insert</p>
<pre><code class="language-sql">insert into 핑계고 values (1,&#39;이광수&#39;,&#39;2022-12-16&#39;,4,1);
insert into 핑계고 values (2,&#39;이동욱&#39;,&#39;2023-01-21&#39;,6,2);
insert into 핑계고 values (3,&#39;하하&#39;,&#39;2023-03-21&#39;,10,2);
insert into 핑계고 values (4,&#39;이미주&#39;,&#39;2023-05-24&#39;,13,2);
insert into 핑계고 values (5,&#39;조인성&#39;,&#39;2023-07-22&#39;,19,2);
insert into 핑계고 values (6,&#39;김종민&#39;,&#39;2023-09-07&#39;,23,2);
insert into 핑계고 values (7,&#39;공유&#39;,&#39;2023-09-29&#39;,26,2);
insert into 핑계고 values (8,&#39;차승원&#39;,&#39;2023-11-18&#39;,30,2);
insert into 핑계고 values (9,&#39;이서진&#39;,&#39;2024-01-01&#39;,35,3);
insert into 핑계고 values (10,&#39;아이유&#39;,&#39;2024-02-17&#39;,38,3);</code></pre>
</li>
<li><p>핑계고에 출연한 놀면뭐하니 테이블의 출연자 중<br>배우나 가수가 아닌 출연자의 아이디, 이름, 직업, 시즌, 에피소드 정보 검색</p>
<pre><code class="language-sql">select a.id 아이디, a.name 이름, a.job_title 직업, b.season 시즌, b.episode 에피소드
from 놀면뭐하니 a, 핑계고 b
where a.name = b.guest and not 
(a.job_title like &#39;%배우%&#39; or a.job_title like &#39;%가수%&#39;)</code></pre>
</li>
<li><p>핑계고에 출연한 놀면뭐하니 출연자 중 작년 9월 5일 이전에 출연했거나<br>소속사 이름이 &#39;엔터테이먼트&#39;로 끝나면서 배우나 개그맨이 아닌 출연자의 아이디, 이름, 직업, 소속사 정보 검색</p>
<pre><code class="language-sql">select a.id 아이디, a.name 이름, a.job_title 직업, a.agency 소속사
from 놀면뭐하니 a, 핑계고 b
where a.name = b.guest 
and (b.broadcast_date &lt;&#39;2023-04-05&#39; or a.agency like &#39;%엔터테이먼트&#39;
and not(a.job_title like &#39;%배우%&#39; or a.job_title like &#39;%개그맨%&#39;));</code></pre>
<p><code>실습확인</code></p>
</li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/59382849-6292-4b11-9e13-91b84b7070d7/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/3b502e38-8f63-42f4-9b6d-4f8661c9bc3e/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/UNION]]></title>
            <link>https://velog.io/@iam_hyerin/union</link>
            <guid>https://velog.io/@iam_hyerin/union</guid>
            <pubDate>Tue, 06 Feb 2024 10:04:32 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-union">📌 UNION</h4>
<blockquote>
<p>여러개의 SQL문을 합쳐서 하나의 SQL의 문으로 만들어주는 방법</p>
</blockquote>
<p>🚫 칼럼의 개수가 같아야함</p>
<h4 id="📌-union-문법">📌 UNION 문법</h4>
<blockquote>
<p><strong>UNION</strong> : 중복된 값 제거 후 출력
<strong>UNION ALL</strong> : 중복된 값도 모두 출력</p>
</blockquote>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>UNION 문법</code></p>
<pre><code class="language-sql">select column1, column2, ... from tableA
UNION | UNION ALL
select column1, column2, ... from tableB</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li><p>놀면뭐하니 table</p>
</li>
<li><p>직업이 가수인 데이터를 검색하는 쿼리와 직업이 배우인 데이터를 검색하는 쿼리를 중복을 제거한 후 합쳐서 실행</p>
<pre><code class="language-sql">select * from 놀면뭐하니 where job_title like &#39;%가수%&#39;
union
select * from 놀면뭐하니 where job_title like &#39;%배우%&#39;;</code></pre>
</li>
<li><p>성이 이씨인 데이터를 검색하는 쿼리와 1980년대생을 검색하는 쿼리를 중복을 포함한 후 합쳐서 실행</p>
<pre><code class="language-sql">select * from 놀면뭐하니 where name like &#39;이%&#39;
union all
select * from 놀면뭐하니 where birthday between &#39;1980-01-01&#39; and &#39;1989-12-31&#39;;</code></pre>
<p><code>실습확인</code></p>
</li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/47a7827a-cdca-472c-8b67-38455eff2fda/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/d99731a4-a13d-4b89-be24-e28ce95cc327/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[
[TIL] SQL/Operators]]></title>
            <link>https://velog.io/@iam_hyerin/operator</link>
            <guid>https://velog.io/@iam_hyerin/operator</guid>
            <pubDate>Mon, 05 Feb 2024 11:27:36 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-comparison-operators비교연산자">📌 comparison operators(비교연산자)</h4>
<table>
<thead>
<tr>
<th align="left">연산자</th>
<th align="left">의미</th>
</tr>
</thead>
<tbody><tr>
<td align="left">A = B</td>
<td align="left">A 와 B 가 같은</td>
</tr>
<tr>
<td align="left">A &gt; B</td>
<td align="left">A 가 B 보다 큰 (초과)</td>
</tr>
<tr>
<td align="left">A &lt; B</td>
<td align="left">A 가 B 보다 작은 (미만)</td>
</tr>
<tr>
<td align="left">A &gt;= B</td>
<td align="left">A 가 B 보다 크거나 같은 (이상)</td>
</tr>
<tr>
<td align="left">A &lt;= B</td>
<td align="left">A 가 B 보다 작거나 같은 (이하)</td>
</tr>
<tr>
<td align="left">A &lt;&gt; B</td>
<td align="left">A 가 B 보다 크거나 작은 (같지않은)</td>
</tr>
<tr>
<td align="left">A != B</td>
<td align="left">A 와 B 가 같지않은</td>
</tr>
</tbody></table>
<h4 id="📌-logical-operators논리연산자">📌 logical operators(논리연산자)</h4>
<table>
<thead>
<tr>
<th align="left">연산자</th>
<th align="left">의미</th>
</tr>
</thead>
<tbody><tr>
<td align="left">AND</td>
<td align="left">조건을 모두 만족하는 경우 TRUE</td>
</tr>
<tr>
<td align="left">OR</td>
<td align="left">하나의 조건이라도 만족하는 경우 TRUE</td>
</tr>
<tr>
<td align="left">NOT</td>
<td align="left">조건을 만족하지 않는 경우 TRUE</td>
</tr>
<tr>
<td align="left">BETWEEN</td>
<td align="left">조건값이 범위 사이에 있으면 TRUE</td>
</tr>
<tr>
<td align="left">IN</td>
<td align="left">조건값이 목록에 있으면 TRUE</td>
</tr>
<tr>
<td align="left">LIKE</td>
<td align="left">조건값이 패턴에 맞으면 TRUE</td>
</tr>
</tbody></table>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>AND 문법</code> &amp;nbsp 조건을 <strong>모두</strong> 만족하는 경우 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where condition1 and condition2 and condition3</code></pre>
<p><code>OR 문법</code> &amp;nbsp <strong>하나의</strong> 조건이라도 만족하는 경우 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where condition1 or condition2 or condition3 ...</code></pre>
<p><code>NOT 문법</code> &amp;nbsp 조건을 만족하지 <strong>않는</strong> 경우 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where not condition</code></pre>
<p><code>BETWEEN 문법</code> &amp;nbsp 조건값이 <strong>범위</strong> 사이에 있으면 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where column1 between value1 and value2</code></pre>
<p><code>IN 문법</code> &amp;nbsp 조건값이 <strong>목록에</strong> 있으면 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where column in (value1, value2, ...)</code></pre>
<p><code>LIKE 문법</code> &amp;nbsp 조건값이 <strong>패턴에</strong> 맞으면 <strong>TRUE</strong></p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
where column like pettern</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>놀면뭐하니 테이블에서 직업 중 가수가 포함되어 있고, 성이 이씨인 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where job_title like &#39;%가수%&#39; and name like &#39;이%&#39;;</code></pre>
</li>
<li>놀면뭐하니 테이블에서 성별이 남자이거나 직업명이 방송인으로 끝나면서 최소 5글자 이상인 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where sex=&#39;M&#39; or job_title like &#39;%__방송인&#39;;</code></pre>
</li>
<li>놀면뭐하니 테이블에서 이름이 두글자인 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where name like &#39;__&#39;;</code></pre>
</li>
<li>놀면뭐하니 테이블에서 나이가 35세 이상 60세 이하이면서 개그맨이 아닌 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where age between 35 and 60 and not job_title like &#39;%개그맨%&#39;;</code></pre>
</li>
<li>놀면뭐하니 테이블에서 이이경 이미주 유재석 주우재 중에 소속사 이름이 &#39;상영&#39;으로 시작하는 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where name in (&#39;이이경&#39;,&#39;이미주&#39;,&#39;유재석&#39;,&#39;주우재&#39;) 
and agency like &#39;상영%&#39;;</code></pre>
</li>
<li>놀면뭐하니 테이블에서 이이경 이미주 박진주 하하 중에 가수만 직업으로 가졌거나 가수를 병행하지 않고 배우만 하는 데이터 조회<pre><code class="language-sql">select * from 놀면뭐하니
where name in (&#39;이이경&#39;,&#39;이미주&#39;,&#39;유재석&#39;,&#39;주우재&#39;) and 
(job_title like &#39;가수&#39; or job_title like &#39;배우&#39;);</code></pre>
🚫 연산자 우선순위 주의하기 ( and 가 or 보다 우선순위)
🚫 복잡할때는 단계별로 진행하기</li>
</ul>
<p><code>실습확인</code></p>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/ebb8de73-2e30-4566-9b32-2bb3369c5647/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/ec8c277b-ad94-4812-bf56-70da1c5d5d01/image.png" alt=""></th>
</tr>
</thead>
<tbody><tr>
<td><br></td>
<td></td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/0929f779-ea50-4be7-92be-1a79b487594e/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/6a4379b7-28bc-4015-9228-a331ff13e01d/image.png" alt=""></th>
</tr>
</thead>
<tbody><tr>
<td><br></td>
<td></td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/1e4b1a5a-034e-47fd-8ee3-72880256ba52/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/f9b4d9a2-95f4-410b-9f3f-97a7f8c8b1b9/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/CRUD]]></title>
            <link>https://velog.io/@iam_hyerin/crud</link>
            <guid>https://velog.io/@iam_hyerin/crud</guid>
            <pubDate>Sun, 04 Feb 2024 09:05:40 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-crud">📌 CRUD</h4>
<blockquote>
<p>대부분의 컴퓨터 소프트웨어가 가지는 기본적인 데이터처리 기능인
<strong><code>Create</code>(생성) <code>Read</code>(읽기) <code>Update</code>(갱신) <code>Delete</code>(삭제)</strong>를
묶어서 일컫는 말이다</p>
</blockquote>
<h4 id="📌-database-4가지-쿼리형식">📌 Database 4가지 쿼리형식</h4>
<table>
<thead>
<tr>
<th align="center">이름</th>
<th align="center">조작</th>
<th align="center">SQL</th>
</tr>
</thead>
<tbody><tr>
<td align="center">Create</td>
<td align="center">생성</td>
<td align="center">INSERT</td>
</tr>
<tr>
<td align="center">Read</td>
<td align="center">조회</td>
<td align="center">SELECT</td>
</tr>
<tr>
<td align="center">Update</td>
<td align="center">수정</td>
<td align="center">UPDATE</td>
</tr>
<tr>
<td align="center">Delete</td>
<td align="center">삭제</td>
<td align="center">DELETE</td>
</tr>
</tbody></table>
<h4 id="📌-order-by">📌 ORDER BY</h4>
<blockquote>
<p>SELECT 문에서 특정 칼럼을 기준으로 오름차순 혹은 내림차순 정렬하여 조회</p>
</blockquote>
<ul>
<li><strong>ASC(Ascending)</strong> : 오름차순으로 정렬 → default</li>
<li><strong>DESC(Descending)</strong> : 내림차순으로 정렬</li>
</ul>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>INSERT 문법</code></p>
<p>데이터 추가</p>
<pre><code class="language-sql">insert into tablename (column1, column2, ...)
values (value1, value2, ...)</code></pre>
<p>🚫 칼럼의 이름과 값의 순서가 일치해야한다</p>
<p><code>SELECT 문법</code></p>
<p>데이터 조회</p>
<pre><code class="language-sql">select column1, column2 ... //특정데이터조회
from tablename

select * from tablename //모든데이터조회</code></pre>
<p><code>WHERE 문법</code> </p>
<p>조건 추가 - 테이블 내에서 조건을 만족하는 데이터 조회</p>
<pre><code class="language-sql">select column1, column2 ...
from tablename
where condition</code></pre>
<p><code>UPDATE 문법</code></p>
<p>데이터 수정</p>
<pre><code class="language-sql">update tablename
set column1 = value1, column2 = value2, ...
where condition</code></pre>
<p><code>DELETE 문법</code></p>
<p>데이터 삭제</p>
<pre><code class="language-sql">delete from tablename
where condition</code></pre>
<p><code>ORDER BY 문법</code></p>
<p>데이터 정렬</p>
<pre><code class="language-sql">select column1, column2, ...
from tablename
order by column1, column2, ... asc|desc</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>table 생성 (놀면뭐하니)<pre><code class="language-sql">create table 놀면뭐하니
(
 id int not null auto_increment primary key,
 name varchar(32) not null default&#39;&#39;,
 birthday date,
 age int,
 sex char(1),
 job_title varchar(32),
 agency varchar(32)
);</code></pre>
</li>
<li>놀면뭐하니 table에 데이터 추가하기<pre><code class="language-sql">insert into 놀면뭐하니 values (1,&#39;유재석&#39;,&#39;1972-08-14&#39;,53,&#39;M&#39;,&#39;MC,개그맨&#39;,&#39;안테나&#39;);
insert into 놀면뭐하니 values (2,&#39;하하&#39;,&#39;1979-08-20&#39;,46,&#39;M&#39;,&#39;래퍼,방송인&#39;,&#39;QUAN엔터테이먼트&#39;);
insert into 놀면뭐하니 values (3,&#39;이이경&#39;,&#39;1989-01-08&#39;,36,&#39;M&#39;,&#39;배우&#39;,&#39;상영이엔티&#39;);
insert into 놀면뭐하니 values (4,&#39;주우재&#39;,&#39;1986-11-28&#39;,39,&#39;M&#39;,&#39;모델,방송인&#39;,&#39;YG엔터테이먼트&#39;);
insert into 놀면뭐하니 values (5,&#39;이미주&#39;,&#39;1994-09-23&#39;,31,&#39;F&#39;,&#39;가수&#39;,&#39;안테나&#39;);
insert into 놀면뭐하니 values (6,&#39;박진주&#39;,&#39;1988-12-24&#39;,37,&#39;F&#39;,&#39;배우,가수&#39;,&#39;프레인TPC&#39;);</code></pre>
</li>
<li>이름, 생년월일, 성별, 소속사 데이터를 소속사 순으로 정렬하기<pre><code class="language-sql">select name, birthday, sex, agency from 놀면뭐하니
order by agency;</code></pre>
</li>
<li>전체칼럼을 소속사, 이름 순으로 정렬하기<pre><code class="language-sql">select * from 놀면뭐하니
order by agency, name;</code></pre>
</li>
<li>이름, 나이, 직업, 소속사 데이터를 소속사 순, 나이 역순으로 정렬하기<pre><code class="language-sql">select name, age, job_title from 놀면뭐하니
order by agency, age desc;</code></pre>
<code>실습확인</code></li>
</ul>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/2e2d53a5-71fb-4c9f-b103-8fdeb77ca3f7/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/8c5ed2e7-fb0c-4b8c-b6d5-c1d7b58c977e/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Table]]></title>
            <link>https://velog.io/@iam_hyerin/table</link>
            <guid>https://velog.io/@iam_hyerin/table</guid>
            <pubDate>Sat, 03 Feb 2024 09:21:06 GMT</pubDate>
            <description><![CDATA[<h3 id="💻-실습">💻 실습</h3>
<p><code>table 문법</code></p>
<p>table 생성</p>
<pre><code class="language-sql">create table tablename (
    columnname datatype,
    columnname datatype,
    ...
);</code></pre>
<p>table 목록확인</p>
<pre><code class="language-sql">show tables;</code></pre>
<p>table 정보확인</p>
<pre><code class="language-sql">desc tablename;</code></pre>
<p>table name 변경</p>
<pre><code class="language-sql">alter table tablename
rename new_tablename;</code></pre>
<p>table column 추가</p>
<pre><code class="language-sql">alter table tablename
add column columnname datatype;</code></pre>
<p>table column 변경</p>
<pre><code class="language-sql">alter table tablename
modify column columnname datatype; //datatype</code></pre>
<pre><code class="language-sql">alter table tablename
change column old_columnname new_columnname new_datatype; //name</code></pre>
<p>table column 삭제</p>
<pre><code class="language-sql">alter table tablename
drop column columnname;</code></pre>
<p>table 삭제</p>
<pre><code class="language-sql">drop table tablename;</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<h4 id="example-table">example table</h4>
<pre><code class="language-sql">create table example
(
   id int,
   name varchar(16)
);</code></pre>
<ul>
<li>age(int) column 추가<pre><code class="language-sql">alter table example
add column age int;</code></pre>
</li>
<li>old(int) column 추가<pre><code class="language-sql">alter table example
add column old int;</code></pre>
</li>
<li>age(int) column 삭제<pre><code class="language-sql">alter table example
drop column age;</code></pre>
</li>
<li>old(int) → sex(char) column 변경<pre><code class="language-sql">alter table example
change column old sex char;</code></pre>
</li>
<li>animal table 삭제<pre><code class="language-sql">drop table animal;</code></pre>
🚫 table 생성 전에 데이터베이스 설정하기</li>
</ul>
<p><code>실습확인</code></p>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/d6aedc55-d618-4347-8b4c-580d78a3a021/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/a66c9474-89fa-4579-b121-ce876cdb0a5d/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[[TIL] SQL/Database]]></title>
            <link>https://velog.io/@iam_hyerin/database</link>
            <guid>https://velog.io/@iam_hyerin/database</guid>
            <pubDate>Fri, 02 Feb 2024 10:54:54 GMT</pubDate>
            <description><![CDATA[<h3 id="📖-이론">📖 이론</h3>
<h4 id="📌-database">📌 Database</h4>
<blockquote>
<p>여러 사람이 공유하여 사용할 목적으로 체계화해 통합, 관리하는 데이터의 집합체</p>
</blockquote>
<h4 id="📌-dbms">📌 DBMS</h4>
<blockquote>
<p>사용자와 데이터베이스 사이에서 사용자의 요구에 따라 정보를 생성해주고 
데이터베이스를 관리해주는 소프트웨어</p>
</blockquote>
<h4 id="📌-관계형-데이터베이스brrdbrelational-database">📌 관계형 데이터베이스<br>(RDB:Relational Database)</h4>
<blockquote>
<p>서로간에 관계가 있는 데이터 테이블들을 모아둔 데이터 저장공간</p>
</blockquote>
<h4 id="📌-sql">📌 SQL</h4>
<blockquote>
<p>데이터베이스에서 데이터를 정의 / 조작 / 제어 하기 위해 사용하는 언어</p>
</blockquote>
<h4 id="📌-sql-구성">📌 SQL 구성</h4>
<blockquote>
<blockquote>
<h4 id="데이터-정의-언어-ddl--data-definition-language">데이터 정의 언어 (DDL : Data Definition Language)</h4>
<p>CREATE , ALTER , DROP 등의  명령어</p>
</blockquote>
</blockquote>
<hr>
<h4 id="데이터-조작-언어-dml--data-manipulation-language">데이터 조작 언어 (DML : Data Manipulation Language)</h4>
<p>INSERT , UPDATE , DELETE , SELECT 등의 명령어</p>
<hr>
<h4 id="데이터-제어-언어-dcl--data-control-language">데이터 제어 언어 (DCL : Data Control Language)</h4>
<p>GRANT , REVOKE , COMMIT , ROLLBACK 등의 명령어</p>
<hr>
<h3 id="💻-실습">💻 실습</h3>
<p><code>Database 관리</code></p>
<p>root 계정으로 mysql 접속</p>
<pre><code class="language-sql">% mysql -u root -p
Enter password:</code></pre>
<p>Database 목록 확인</p>
<pre><code class="language-sql">show databases;</code></pre>
<p>Database 생성</p>
<pre><code class="language-sql">create database &lt;database&gt;;</code></pre>
<p>Database 사용</p>
<pre><code class="language-sql">use &lt;database&gt;;</code></pre>
<p>Database 삭제</p>
<pre><code class="language-sql">drop database &lt;database&gt;;</code></pre>
<hr>
<p><code>user 조회</code></p>
<p>mysql 데이터베이스로 이동 후 조회</p>
<pre><code class="language-sql">use mysql;
select host, user from user;</code></pre>
<p>현재 PC에서만 접속 가능한 사용자 생성 (HYERIN,1234)</p>
<pre><code class="language-sql">create user &#39;username&#39;@&#39;localhost&#39; 
identified by &#39;password&#39;</code></pre>
<p>외부에서 접속 가능한 사용자 생성 (HYERIN,1234)</p>
<pre><code class="language-sql">create user &#39;username&#39;@&#39;%&#39;
identified by &#39;password&#39;</code></pre>
<p><strong>🚫 접근 범위에 따라 같은 이름의 사용자여도 별도로 삭제</strong></p>
<pre><code class="language-sql">drop user &#39;username&#39;@&#39;localhost&#39; //현재PC

drop user &#39;username&#39;@&#39;%&#39; //외부</code></pre>
<hr>
<p><code>user 권한관리</code></p>
<p>사용자에게 부여된 모든 권한 목록 확인</p>
<pre><code class="language-sql">show grants for &#39;username&#39;@&#39;localhost&#39;</code></pre>
<p>사용자에게 특정 데이터베이스의 모든 권한 부여</p>
<pre><code class="language-sql">grant all on &lt;database&gt;.* to &#39;username&#39;@&#39;localhost&#39;</code></pre>
<p>사용자에게 특정 데이터베이스의 모든 권한 삭제</p>
<pre><code class="language-sql">revoke all on &lt;database&gt;.* from &#39;username&#39;@&#39;localhost&#39;</code></pre>
<p>▶️ 수정내용이 적용되지 않는 경우 새로고침</p>
<pre><code class="language-sql">flush privileges</code></pre>
<hr>
<h3 id="🧸-review">🧸 review</h3>
<ul>
<li>review 라는 데이터베이스 만들고 확인하기<pre><code class="language-sql">create database review;</code></pre>
</li>
<li>외부에서도 접속가능한 사용자 생성하기(ID:hyerin, PW:1234)<pre><code class="language-sql">create user &#39;hyerin&#39;@&#39;%&#39; identified by &#39;1234&#39;;</code></pre>
</li>
<li>review의 모든권한을 hyerin에게 부여하고 확인하기<pre><code class="language-sql">grant all on review.* to &#39;hyerin&#39;@&#39;%&#39;;</code></pre>
</li>
<li>hyerin에게 부여한 review에 대한 권한을 삭제하고 확인하기<pre><code class="language-sql">revoke all on review.* from &#39;hyerin&#39;@&#39;%&#39;;</code></pre>
</li>
<li>외부에서도 접속가능한 hyerin 삭제하고 확인하기<pre><code class="language-sql">drop user &#39;hyerin&#39;@&#39;%&#39;;</code></pre>
</li>
<li>review 라는 데이터베이스 삭제하고 확인하기<pre><code class="language-sql">drop database review;</code></pre>
🚫 항상 눈으로 확인하는 습관 들이기</li>
</ul>
<p><code>실습확인</code></p>
<table>
<thead>
<tr>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/a49f16d6-7738-4aa8-8e59-700ee28b20e1/image.png" alt=""></th>
<th><img src="https://velog.velcdn.com/images/iam_hyerin/post/408d748d-5da0-4ac9-9cb6-bf9f9cc0ccaa/image.png" alt=""></th>
</tr>
</thead>
</table>
<hr>
]]></description>
        </item>
    </channel>
</rss>