<?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>query Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/query/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/query/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 03 Apr 2021 12:42:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Alter Table in MySql</title>
		<link>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/</link>
					<comments>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 03 Apr 2021 12:42:14 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[alter table]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[modify]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[where]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5794</guid>

					<description><![CDATA[<p>In this tutorial we will see the commands which we can use to make changes in our table (as per [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/">Alter Table in MySql</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will see the commands which we can use to make changes in our table (as per <strong>April 2k21</strong>).</p>



<ul class="wp-block-list"><li>To add a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>ADD </strong>column_name <strong>DATATYPE</strong>;</code></pre>



<ul class="wp-block-list"><li>To delete a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>DROP </strong>column_name;</code></pre>



<ul class="wp-block-list"><li>To change the data type of a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>MODIFY COLUMN </strong>column_name <strong>NEW DATA TYPE;</strong></code></pre>



<ul class="wp-block-list"><li>To rename a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE</strong> table_name <strong>CHANGE </strong>column_name <strong>NEW_COLUMN_NAME</strong>;</code></pre>



<ul class="wp-block-list"><li>To update the column as NOT NULL Constraint:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>MODIFY </strong>column_name <strong>DATATYPE NOT NULL;</strong></code></pre>



<ul class="wp-block-list"><li>To Sort the data in the Table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT </strong>"column_name" <strong>FROM </strong>"table-name" &#91;<strong>WHERE </strong>"condition"] <strong>ORDER BY </strong>"column_name" &#91;<strong>ASC/DESC</strong>];</code></pre>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/">Alter Table in MySql</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Table using MySql queries:</title>
		<link>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/</link>
					<comments>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 01 Apr 2021 12:37:37 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[query]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5785</guid>

					<description><![CDATA[<p>In this we will learn how we can create tables in the database using sql queries. As we know it [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/">Creating a Table using MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this we will learn how we can create tables in the database using sql queries. As we know it becomes quite complicated to make the tables manually in the database. To ease the process we can follow the steps to make tables using my sql queries.</p>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code>CREATE TABLE table_name (
    column1 column1 datatype column1 constraint,
    column2 column2 datatype column2 constraint,
    column3 column3 datatype column3 constraint,
   ....
);</code></pre>



<p class="wp-block-paragraph"><strong>Constraints:</strong></p>



<ul class="wp-block-list"><li><strong>NOT NULL CONSTRAINT</strong> &#8211; Ensures that a column cannot have a null value.</li><li><strong>DEFAULT CONSTRAINT</strong> &#8211; Provides a default value for a column when none is specified.</li><li><strong>UNIQUE CONSTRAINT</strong> &#8211; Ensures that all value in a column are different.</li><li><strong>CHECK CONSTRAINT </strong>&#8211; Make sure all values in a column satisfy certian criteria.</li><li><strong>PRIMARY_KEY CONSTRAINT </strong>&#8211; Used to uniquely identify a row in a table.</li><li><strong>FOREIGN_KEY CONSTRAINT </strong>&#8211; Used to ensure referential integrity of the data.</li></ul>



<p class="wp-block-paragraph"><strong>Keys:</strong></p>



<ul class="wp-block-list"><li>A primary key is used to uniquely identify each row in a table.</li><li>A primary key can consists of one or more columns on a table.</li><li>When multiple columns are used as primary key, it is called as Composite key.</li><li>A foreign key is a column (or columns) that references a column (most often primary key) of other table.</li><li>The purpose of foreign key is to referential integrity of the data.</li></ul>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="904" height="362" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1.jpg" alt="" class="wp-image-5786" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1.jpg 904w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1-300x120.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1-768x308.jpg 768w" sizes="(max-width: 904px) 100vw, 904px" /></figure>



<p class="wp-block-paragraph">As shown in the above picture, Cust_ID is the foreign key for order table whereas it is primary key for in the Customer table that means the value of Cust_ID will not change in either of the table.</p>



<p class="wp-block-paragraph">For example we will create a table named as customer_table inside the &#8216;test&#8217; database:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f9cd72fcba465481909e066d538a3eb2.js"></script>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/">Creating a Table using MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
