<?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>update &#8211; スグブログ</title>
	<atom:link href="https://sugublog.org/tag/update/feed/" rel="self" type="application/rss+xml" />
	<link>https://sugublog.org</link>
	<description>ブログ運営について発信中</description>
	<lastBuildDate>Tue, 12 Mar 2024 02:17:29 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://sugublog.org/wp-content/uploads/2021/07/icon_20210703-min-150x150.png</url>
	<title>update &#8211; スグブログ</title>
	<link>https://sugublog.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【SQL基礎】4大命令文一覧！insert、update、select、deleteについて</title>
		<link>https://sugublog.org/sql-base-4major-commands/</link>
					<comments>https://sugublog.org/sql-base-4major-commands/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[suguru]]></dc:creator>
		<pubDate>Thu, 12 Aug 2021 16:09:57 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[update]]></category>
		<guid isPermaLink="false">https://sugublog.org/?p=3985</guid>

					<description><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-2-1024x576.jpg" class="webfeedsFeaturedVisual" /></p>SQLでよく使用される命令文があります。SQLの4大命令文です。 SQLでデータベースを操作する時に良く使用されます。しっかりと基礎構文を抑えて、良いサービスを構築しましょう。 【SQL基礎】insert、update、 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-2-1024x576.jpg" class="webfeedsFeaturedVisual" /></p>
<p>SQLでよく使用される命令文があります。SQLの4大命令文です。</p>



<p>SQLでデータベースを操作する時に良く使用されます。しっかりと基礎構文を抑えて、良いサービスを構築しましょう。</p>



<h2 class="wp-block-heading">【SQL基礎】insert、update、select、deleteの4大命令文</h2>



<p>DB操作の4大命令文は下記です。</p>



<ol class="is-style-num_circle wp-block-list">
<li>select</li>



<li>update</li>



<li>insert</li>



<li>delete </li>
</ol>



<p>１つずつ見ていきましょう。詳細はリンクも貼っていますので、詳しく知りたい方はリンクを辿ってください。</p>



<h2 class="wp-block-heading">DBを参照するselectコマンド</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="768" src="https://sugublog.org/wp-content/uploads/2021/08/DB0804-1-1024x768.jpg" alt="DB" class="wp-image-3840" srcset="https://sugublog.org/wp-content/uploads/2021/08/DB0804-1-1024x768.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-1-300x225.jpg 300w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-1-768x576.jpg 768w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-1.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>DBから値などを参照する時に使用します。構文は下記になります。</p>



<h3 class="wp-block-heading">基本構文</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-sql" data-lang="SQL"><code>select 欲しい値のカラム,欲しい値のカラム from テーブル名 条件;</code></pre></div>



<h3 class="wp-block-heading">select構文の注意点</h3>



<p class="is-style-big_icon_caution">欲しいカラムが複数ある場合は「,」で区切れば良いですね。</p>



<p class="is-style-balloon_box">select構文の詳細を知りたい方は、下記の「select文でDBの値を取得する」の記事を参照してください。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/08/DB0804-1-300x225.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/sql-base-select/">【SQL基礎】select文でDBの値を取得する!データ抽出方法</a>
						<span class="p-blogCard__excerpt">SQLのデータベースを使用する時の、構文を忘れる事が多々あるので覚書します。 データベースを扱えるようになれば、業務の幅も広がりますし、コードも少なく綺麗にする&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">DBの値を更新するupdateコマンド</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="545" src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7-1024x545.jpg" alt="script" class="wp-image-3955" srcset="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7-1024x545.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7-300x160.jpg 300w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7-768x409.jpg 768w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>DBの値を更新する時に使用します。基本構文は下記です。</p>



<h3 class="wp-block-heading">基本構文</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-sql" data-lang="SQL"><code>update テーブル名 set カラム名1 = 値,カラム名2 = 値2 where カラム 比較演算子 値;</code></pre></div>



<h3 class="wp-block-heading">update構文の注意点</h3>



<p class="is-style-big_icon_caution">updateコマンドで更新したいカラムを指定する時は「set」を使用します。他の４つでは「set」は出てこないので注意</p>



<p class="is-style-balloon_box">SQLのupdateコマンドの詳細は、下記の「データベースの値を変更するupdateコマンド」の記事を参照してください。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-7-300x160.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/sql-base-update/">【SQL基礎】データベースの値を変更するupdateコマンド</a>
						<span class="p-blogCard__excerpt">SQLでデータベースの値を変更したい場合、SQL4大命令文の一つ「update」コマンドを使用します。 一つのサービスでデータを変更する事は、頻繁にあると思います。 きちん&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">DBにデータを挿入するinsertコマンド</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="683" src="https://sugublog.org/wp-content/uploads/2021/08/script_0809-3-1024x683.jpg" alt="スクリプト" class="wp-image-3871" srcset="https://sugublog.org/wp-content/uploads/2021/08/script_0809-3-1024x683.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/08/script_0809-3-300x200.jpg 300w, https://sugublog.org/wp-content/uploads/2021/08/script_0809-3-768x512.jpg 768w, https://sugublog.org/wp-content/uploads/2021/08/script_0809-3.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>DBにデータを挿入したい場合に使用します。基礎構文は下記です。</p>



<h3 class="wp-block-heading">基本構文</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-sql" data-lang="SQL"><code>insert into テーブル名 (カラム名,カラム名,カラム名,,) value (値,値,値,,);</code></pre></div>



<h3 class="wp-block-heading">update構文の注意点</h3>



<p class="is-style-big_icon_caution">テーブル名を指定する時は「into」を使用します。他の4つでは「into」は出てこないので注意です。</p>



<p>データベースにデータを挿入したい場合の詳細は、下記の記事を参照してください。</p>



<p class="is-style-balloon_box">「insertでDBにデータを挿入する」の記事はこちら</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/08/script_0809-3-300x200.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/sql-base-insert/">【SQL基礎】insert文でDB（データベース）にデータを挿入する</a>
						<span class="p-blogCard__excerpt">MySQLの4大命令文の中の1つ、insert文について見ていきます。 insert文はデータベースにデータを挿入する事が可能です。 insert文の基礎を学んで、データベースにデータ&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">DBからデータを削除するdeleteコマンド</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="585" src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8-1024x585.jpg" alt="script" class="wp-image-3956" srcset="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8-1024x585.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8-300x171.jpg 300w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8-768x438.jpg 768w, https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>DBからデータを削除する場合にdeleteコマンドを使用します。基本構文は下記です。</p>



<h3 class="wp-block-heading">基本構文</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-sql" data-lang="SQL"><code>delete from テーブル名 where カラム 比較演算子 値;</code></pre></div>



<h3 class="wp-block-heading">delete構文の注意点</h3>



<p class="is-style-big_icon_caution">where以降の条件式を指定しなければ、テーブルごと削除されますので注意が必要です。</p>



<p class="is-style-balloon_box">詳しくは「【SQL基礎】deleteでデータベースの値を削除する方法とは？」を参照してください。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/08/programing_0812-8-300x171.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/sql-base-delete/">【SQL基礎】deleteでデータのレコードを行削除する方法とは？</a>
						<span class="p-blogCard__excerpt">SQLでデータベースからレコードの行の値を削除する方法をご紹介します。 SQLでレコードを削除する事は多いと思いますので、deleteの構文の基礎をしっかり取得しましょう&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p class="is-style-big_icon_check">SQL4大命令文はよく使用されますので、きちんと構文を抑えて使用しましょう。</p>



<p>今回は以上になります。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/08/school_08-7-300x200.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/programing-school/">【2024年】プログラミングスクールおすすめランキング！評判と口コミ</a>
						<span class="p-blogCard__excerpt">プログラミングスクールで学習して、スキルを上げて年収を上げたい。フリーランスになるためにプログラミングを習いたい。 こういった願望を抱いている人も沢山います。&#8230;</span>					</div>
				</div>
			</div>
		</div>]]></content:encoded>
					
					<wfw:commentRss>https://sugublog.org/sql-base-4major-commands/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
