<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQLメモ帳</title>
	<atom:link href="http://www.paging.jp/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paging.jp/mysql</link>
	<description>MySQLについてのメモ</description>
	<lastBuildDate>Mon, 31 Jan 2011 17:03:31 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>collate utf8_unicode_ci</title>
		<link>http://www.paging.jp/mysql/2011/02/01/collate-utf8_unicode_ci/</link>
		<comments>http://www.paging.jp/mysql/2011/02/01/collate-utf8_unicode_ci/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 17:03:31 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[TABEL&COLUMN]]></category>
		<category><![CDATA[文字コード]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=66</guid>
		<description><![CDATA[文字コードはUTF-8環境。 utf8_general_ciでは、大文字-小文字を同一視する。 utf8_unicode_ciでは、大文字-小文字、ひらがな-カタカナ、半角-全角も同一視する。 alter table t [...]]]></description>
			<content:encoded><![CDATA[<p>
文字コードはUTF-8環境。<br />
utf8_general_ciでは、大文字-小文字を同一視する。<br />
utf8_unicode_ciでは、大文字-小文字、ひらがな-カタカナ、半角-全角も同一視する。<br />
<br />
alter table table_name collate utf8_unicode_ci;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2011/02/01/collate-utf8_unicode_ci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ランダムにデータを取り出す「order by RAND()」</title>
		<link>http://www.paging.jp/mysql/2011/01/27/%e3%83%a9%e3%83%b3%e3%83%80%e3%83%a0%e3%81%ab%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99%e3%80%8corder-by-rand%e3%80%8d/</link>
		<comments>http://www.paging.jp/mysql/2011/01/27/%e3%83%a9%e3%83%b3%e3%83%80%e3%83%a0%e3%81%ab%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99%e3%80%8corder-by-rand%e3%80%8d/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 23:29:32 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=64</guid>
		<description><![CDATA[ランダムにデータを取得したい場合は「order by RAND()」を使う。LIMIT句にて件数を設定できる。 select * from TABLE order by RAND() LIMIT 10;]]></description>
			<content:encoded><![CDATA[<p>
ランダムにデータを取得したい場合は「order by RAND()」を使う。LIMIT句にて件数を設定できる。<br />
<pre class="brush: sql;">
select * from TABLE order by RAND() LIMIT 10;
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2011/01/27/%e3%83%a9%e3%83%b3%e3%83%80%e3%83%a0%e3%81%ab%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99%e3%80%8corder-by-rand%e3%80%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LIMIT句がある場合に全行数を取得する「SQL_CALC_FOUND_ROWS」</title>
		<link>http://www.paging.jp/mysql/2011/01/20/limit%e5%8f%a5%e3%81%8c%e3%81%82%e3%82%8b%e5%a0%b4%e5%90%88%e3%81%ab%e5%85%a8%e8%a1%8c%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e3%80%8csql_calc_found_rows%e3%80%8d/</link>
		<comments>http://www.paging.jp/mysql/2011/01/20/limit%e5%8f%a5%e3%81%8c%e3%81%82%e3%82%8b%e5%a0%b4%e5%90%88%e3%81%ab%e5%85%a8%e8%a1%8c%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e3%80%8csql_calc_found_rows%e3%80%8d/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 23:02:10 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>
		<category><![CDATA[FOUND_ROWS]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=61</guid>
		<description><![CDATA[LIMIT句をつけない状態の全行数を取得したい場合は「SQL_CALC_FOUND_ROWS」を利用するのもあり。 select count(*) from DATA_TABLE; select * from DATA_ [...]]]></description>
			<content:encoded><![CDATA[<p>
LIMIT句をつけない状態の全行数を取得したい場合は「SQL_CALC_FOUND_ROWS」を利用するのもあり。<br />
<br />
<pre class="brush: sql;">
select count(*) from DATA_TABLE;
select * from  DATA_TABLE limit 20,10;
</pre>
<br />
<pre class="brush: sql;">
select SQL_CALC_FOUND_ROWS * from DATA_TABLE;
select FOUND_ROWS() as count;
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2011/01/20/limit%e5%8f%a5%e3%81%8c%e3%81%82%e3%82%8b%e5%a0%b4%e5%90%88%e3%81%ab%e5%85%a8%e8%a1%8c%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e3%80%8csql_calc_found_rows%e3%80%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>データを削除するーDELETE</title>
		<link>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8b%e3%83%bcdelete/</link>
		<comments>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8b%e3%83%bcdelete/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 01:05:12 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=59</guid>
		<description><![CDATA[DELETEでデータを削除する。 DELETE FROM テーブル名 WHERE ＜条件式＞;]]></description>
			<content:encoded><![CDATA[<p>
DELETEでデータを削除する。<br />
<br />
<pre class="brush: sql;">
   DELETE FROM テーブル名 WHERE ＜条件式＞;
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8b%e3%83%bcdelete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>データを更新するーUPDATE</title>
		<link>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%9b%b4%e6%96%b0%e3%81%99%e3%82%8b%e3%83%bcupdate/</link>
		<comments>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%9b%b4%e6%96%b0%e3%81%99%e3%82%8b%e3%83%bcupdate/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 00:59:25 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=57</guid>
		<description><![CDATA[UPDATEでデータを更新する（上書き）します。「WHERE ＜条件式＞」をつけてない場合は、既存データすべてを上書きしてしまうので注意。 UPDATE テーブル名 SET &#60;カラム名&#62;='値',&#60;カラ [...]]]></description>
			<content:encoded><![CDATA[<p>
UPDATEでデータを更新する（上書き）します。「WHERE ＜条件式＞」をつけてない場合は、既存データすべてを上書きしてしまうので注意。<br />
<br />
<pre class="brush: sql;">
  UPDATE テーブル名 SET &lt;カラム名&gt;='値',&lt;カラム名&gt;='値',&lt;カラム名&gt;='値' WHERE ＜条件式＞;
</pre>
<br />
codeが1のデータを更新する。<br />
<pre class="brush: sql;">
  UPDATE items SET name='MySQLの覚え書き' WHERE code=1;
</pre>
<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e6%9b%b4%e6%96%b0%e3%81%99%e3%82%8b%e3%83%bcupdate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>データを追加するーINSERT INTO</title>
		<link>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bcinsert-into/</link>
		<comments>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bcinsert-into/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 00:39:00 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=49</guid>
		<description><![CDATA[データは「INSERT INTO」で追加する。 INSERT INTO テーブル名(&#60;カラム名1&#62;,&#60;カラム名2&#62;,&#60;カラム名3&#62;) VALUES (&#60;値1&#62;,&#60;値2 [...]]]></description>
			<content:encoded><![CDATA[<p>
データは「INSERT INTO」で追加する。<br />
<br />
<pre class="brush: sql;">
   INSERT INTO テーブル名(&lt;カラム名1&gt;,&lt;カラム名2&gt;,&lt;カラム名3&gt;) VALUES
      (&lt;値1&gt;,&lt;値2&gt;,&lt;値3&gt;),
      (&lt;値1&gt;,&lt;値2&gt;,&lt;値3&gt;);
</pre>
<br />
<pre class="brush: sql;">
   INSERT INTO member (code, name, dete) VALUES ('1', '名前', '2020-01-01');
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/10/06/%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bcinsert-into/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TABELを追加するーcreate table</title>
		<link>http://www.paging.jp/mysql/2010/10/06/tabel%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bccreate-table/</link>
		<comments>http://www.paging.jp/mysql/2010/10/06/tabel%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bccreate-table/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 23:56:13 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[コマンド]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=42</guid>
		<description><![CDATA[テーブルを作成する場合は「CREATE TABLE」で作成する。 CREATE TABLE テーブル名( &#60;カラム名&#62; &#60;型&#62; [DEFAULT &#60;デフォルト値&#62;] [AUTO_INC [...]]]></description>
			<content:encoded><![CDATA[<p>
テーブルを作成する場合は「CREATE TABLE」で作成する。<br />
<br />
<pre class="brush: sql;">
CREATE TABLE テーブル名(
   &lt;カラム名&gt; &lt;型&gt; [DEFAULT &lt;デフォルト値&gt;] [AUTO_INCREMENT] [PRIMARY KEY]
・・・・・・);
</pre>
<br />
以下のような会員用テーブルを作成する。<br />
検索しやすくするためにcodeを設定。名前は必ず入力。メールアドレス、誕生日は空でもOK。出席回数も記録する。<br />
<pre class="brush: sql;">
CREATE TABLE member (
   code int  auto_increment primary key,
   name text not null,
   mail text,
   birthday date,
   attendance int default '0'
);
</pre>
<br />
<strong>■ 属性</strong><br />
<br />
<strong>auto_increment</strong><br />
このカラムに NULL か 0 を挿入すると、自動的に最大値 + 1 の値が設定される。AUTO_INCREMENT指定するにはキー指定されている必要がある。<br />
<br />
<strong>primary key</strong><br />
重複する値の入力を許さないフィールド。テーブル１つに１つだけ設定できる。これを指定したカラムには自動的にインデックスが作成されるので、高速な検索が行える。<br />
<br />
<strong>not null</strong><br />
NULLを許可しない。<br />
<br />
<strong>default &#8216;値&#8217;</strong><br />
入力がない場合の初期値を設定する。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/10/06/tabel%e3%82%92%e8%bf%bd%e5%8a%a0%e3%81%99%e3%82%8b%e3%83%bccreate-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQLのWEB管理ツール「SQL Buddy」</title>
		<link>http://www.paging.jp/mysql/2010/10/06/mysql%e3%81%aeweb%e7%ae%a1%e7%90%86%e3%83%84%e3%83%bc%e3%83%ab%e3%80%8csql-buddy%e3%80%8d/</link>
		<comments>http://www.paging.jp/mysql/2010/10/06/mysql%e3%81%aeweb%e7%ae%a1%e7%90%86%e3%83%84%e3%83%bc%e3%83%ab%e3%80%8csql-buddy%e3%80%8d/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 23:32:54 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[ツール]]></category>

		<guid isPermaLink="false">http://www.paging.jp/mysql/?p=40</guid>
		<description><![CDATA[MySQLのお手軽WEB管理ツールが「SQL Buddy」です。 config.phpにMySQL接続先を書き込んでアップロードするだけで利用できます。 SQL Buddy &#8211; Web based MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>
MySQLのお手軽WEB管理ツールが「<a href="http://www.sqlbuddy.com/">SQL Buddy</a>」です。<br />
config.phpにMySQL接続先を書き込んでアップロードするだけで利用できます。<br />
<br />
<a href="http://www.sqlbuddy.com/" class="lk">SQL Buddy &#8211; Web based MySQL administration</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/10/06/mysql%e3%81%aeweb%e7%ae%a1%e7%90%86%e3%83%84%e3%83%bc%e3%83%ab%e3%80%8csql-buddy%e3%80%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQLのデータ型</title>
		<link>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ae%e9%a0%85%e7%9b%ae%e5%9e%8b/</link>
		<comments>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ae%e9%a0%85%e7%9b%ae%e5%9e%8b/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 17:27:06 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[TABEL&COLUMN]]></category>
		<category><![CDATA[カラム]]></category>
		<category><![CDATA[データ型]]></category>

		<guid isPermaLink="false">http://www.paging.jp/wp/mysql/?p=28</guid>
		<description><![CDATA[tableを作成する際にカラムにどんなデータが入るかデータ型を設定する必要があります。 もしカラムに名前が入るのであれば「文字型のTINYTEXT」、金額が入るのであれば「数字型のINT」などtableを作成する際にどの [...]]]></description>
			<content:encoded><![CDATA[<p>
tableを作成する際にカラムにどんなデータが入るかデータ型を設定する必要があります。<br />
もしカラムに名前が入るのであれば「文字型のTINYTEXT」、金額が入るのであれば「数字型のINT」などtableを作成する際にどのタイプを利用するかを検討し設定します。<br />
<br />
<b>数字型</b><br />
<ul>
<li>TINYINT ***-128 ～ 127 / 0 ～ 255</li>
<li>SMALLINT ***-32768 ～ 32767 / 0 ～ 65535</li>
<li>MEDIUMINT ***-8388608 ～ 8388607 / 0 ～ 16777215</li>
<li>INT(INTEGER) ***-2147483648 ～ 2147483647/ 0 ～ 4294967295</li>
<li>BIGINT ***-9223372036854775808 ～ 9223372036854775807 / 0 ～ 18446744073709551615</li>
</ul>
<br />
<b>浮動小数点</b><br />
<ul>
<li>FLOAT(M,D) ***-3.402823466E+38 ～ -1.175494351E-38、0、1.175494351E-38 ～ 3.402823466E+38</li>
<li>DOUBLE(M,D) ***-1.7976931348623157E+308 ～ -2.2250738585072014E-308、0、2.2250738585072014E-308 ～ 1.7976931348623157E+308</li>
<li>DECIMAL(M,D) ***-999.99 ～ 999.99(MySQL 5.03以降:バイナリ形式)</li>
</ul>
<br />
<b>文字型</b><br />
<ul>
<li>CHAR(M) ***0 ～ 255桁の長さの固定領域</li>
<li>VARCHAR(M) ***0 ～ 65,535桁の長さの可変領域(5.0.3以降のバージョン)</li>
<li>TINYBLOB ***最長255桁の文字列</li>
<li>BLOB ***最長255桁の文字列</li>
<li>MEDIUMBLOB ***最長65535桁の文字列</li>
<li>LONGBLOB ***最長4294967295桁の文字列</li>
<li>TINYTEXT ***最長255桁の文字列</li>
<li>TEXT ***最長65535桁の文字列</li>
<li>MEDIUMTEXT ***最長16777215桁の文字列</li>
<li>LONGTEXT ***最長4294967295桁の文字列</li>
</ul>
<br />
<b>SET/ENUM</b><br />
<ul>
<li>ENUM(&#8220;a&#8221;,&#8221;b&#8221;,&#8221;c&#8221;&#8230;) ***最大65,535の明確な値</li>
<li>SET(&#8220;a&#8221;,&#8221;b&#8221;,&#8221;c&#8221;&#8230;) …最大64の要素</li>
</ul>
<br />
<b>日付・時間</b><br />
<ul>
<li>DATE ***YYYY-MM-DD</li>
<li>TIME ***HH:MM:SS</li>
<li>DATETIME ***YYYY-MM-DD HH:MM:SS</li>
<li>TIMESTAMP ***YYYY-MM-DD HH:MM:SS(1970-01-01 00:00:00&#8242; ～ 2037年の途中)</li>
<li>YEAR ***YYYY</li>
</ul></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ae%e9%a0%85%e7%9b%ae%e5%9e%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQLについてちょこちょこメモ</title>
		<link>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%81%a1%e3%82%87%e3%81%93%e3%81%a1%e3%82%87%e3%81%93%e3%83%a1%e3%83%a2/</link>
		<comments>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%81%a1%e3%82%87%e3%81%93%e3%81%a1%e3%82%87%e3%81%93%e3%83%a1%e3%83%a2/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 16:14:49 +0000</pubDate>
		<dc:creator>sakuralove</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://www.paging.jp/wp/mysql/?p=25</guid>
		<description><![CDATA[MySQLについて、簡単なとこからちょこちょこまとめていこう。]]></description>
			<content:encoded><![CDATA[<p>
MySQLについて、簡単なとこからちょこちょこまとめていこう。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paging.jp/mysql/2010/09/27/mysql%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%81%a1%e3%82%87%e3%81%93%e3%81%a1%e3%82%87%e3%81%93%e3%83%a1%e3%83%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

