<?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>PHP Interview Questions and answers&#187; MySql Questions Archives  &#8211; interview questions and answers</title>
	<atom:link href="http://www.phpinterviewquestions.com/category/mysql-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpinterviewquestions.com</link>
	<description>Prepare for your next php based interview with high confidence</description>
	<lastBuildDate>Mon, 26 Sep 2011 08:37:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Delete multiple duplicated rows</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/delete-multiple-duplicate-rows/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/delete-multiple-duplicate-rows/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 10:52:56 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[MySql Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[mssql]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=137</guid>
		<description><![CDATA[mssql, mysql alternative to set rowcount]]></description>
			<content:encoded><![CDATA[<p>How we can delete duplicate records of a table where it has no unique or primary keys?</p>
<p><strong>Mysql</strong><br />
delete from table where x = &#8216;aaa&#8217; limit 1;</p>
<p><strong>Mssql</strong><br />
set rowcount 1;<br />
delete from table where x = &#8216;aaa&#8217;;<br />
set rowcount 0;</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/delete-multiple-duplicate-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Self Join</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/self-join/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/self-join/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 10:03:34 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[MySql Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[sql joins]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=129</guid>
		<description><![CDATA[What is a self join?
Self                                       join is just like any other join, except     [...]]]></description>
			<content:encoded><![CDATA[<p>What is a self join?</p>
<p><span style="font-family: Verdana,Arial,Helvetica,sans-serif;"><span style="font-size: x-small;">Self                                       join is just like any other join, except                                       that two instances of the same table will                                       be joined in the query.</span></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/self-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql Joins</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/sql-joins/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/sql-joins/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 08:41:13 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[MySql Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[sql joins]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=124</guid>
		<description><![CDATA[All sql join operations left join, left outer join,right join, right outer join]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s the difference between LEFT, RIGHT, INNER, OUTER, JOIN?</p>
<p>The difference is in the way tables are joined if there are no common records.</p>
<p>JOIN is same as INNER JOIN and means to only show records common to both tables. Whether the records are common is determined by the fields in join clause. For example:<br />
<span><br />
FROM t1<br />
JOIN t2 on t1.ID = t2.ID<br />
</span><br />
means show only records where the same ID value exists in both tables.</p>
<p>LEFT JOIN is same as LEFT OUTER JOIN and means to show all records from left table (i.e. the one that precedes in SQL statement) regardless of the existance of matching records in the right table.</p>
<p>RIGHT JOIN is same as RIGHT OUTER JOIN and means opposite of LEFT JOIN, i.e. shows all records from the second (right) table and only matching records from first (left) table.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/sql-joins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Number of rows</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/number-of-rows/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/number-of-rows/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:49:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[MySql Questions]]></category>
		<category><![CDATA[Regular level]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=23</guid>
		<description><![CDATA[How can we find the number of rows in a table using MySQL?
SELECT COUNT(*) FROM table_name;
]]></description>
			<content:encoded><![CDATA[<p>How can we find the number of rows in a table using MySQL?</p>
<p>SELECT COUNT(*) FROM table_name;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/number-of-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Increment id in Mysql</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/auto-increment-id-in-mysql/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/auto-increment-id-in-mysql/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:49:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=27</guid>
		<description><![CDATA[There is a structure of a table with an auto-increment ID.Last inserted id is 2145. What will be the next ID after following conditions?
- Delete from tablename? 
- Delete from tablename where ID=&#8221;2145&#8243; 
- truncate table tablename 
2146, 2146, 1
]]></description>
			<content:encoded><![CDATA[<p>There is a structure of a table with an auto-increment ID.Last inserted id is 2145. What will be the next ID after following conditions?<br />
- Delete from tablename? <br />
- Delete from tablename where ID=&#8221;2145&#8243; <br />
- truncate table tablename </p>
<p>2146, 2146, 1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/auto-increment-id-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql Join Operations</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/sql-join-operations/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/sql-join-operations/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:49:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=28</guid>
		<description><![CDATA[What is the difference between inner join and outer join?
Simply, inner join gives both table&#8217;s common fields and outer join gives uncommon fields.
Inner join
SELECT CUSTOMERS.NAME, ORDERS.NAME
FROM CUSTOMERS
INNER JOIN ORDERS
ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID
Outer join
SELECT CUSTOMERS.NAME, ORDERS.NAME
FROM CUSTOMERS
LEFT JOIN ORDERS
ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID
]]></description>
			<content:encoded><![CDATA[<p>What is the difference between inner join and outer join?</p>
<p>Simply, inner join gives both table&#8217;s common fields and outer join gives uncommon fields.</p>
<p><b>Inner join</b><br />
SELECT CUSTOMERS.NAME, ORDERS.NAME<br />
FROM CUSTOMERS<br />
INNER JOIN ORDERS<br />
ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID</p>
<p><b>Outer join</b><br />
SELECT CUSTOMERS.NAME, ORDERS.NAME<br />
FROM CUSTOMERS<br />
LEFT JOIN ORDERS<br />
ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/advanced-level-mysql-interview-questions/sql-join-operations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stored procedures,  Triggers,  Indexes</title>
		<link>http://www.phpinterviewquestions.com/mysql-interview-questions/expert-level-mysql-interview-questions/stored-procedures-triggers-indexes/</link>
		<comments>http://www.phpinterviewquestions.com/mysql-interview-questions/expert-level-mysql-interview-questions/stored-procedures-triggers-indexes/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:19:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Expert level]]></category>
		<category><![CDATA[SP's]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/wordpress/?p=34</guid>
		<description><![CDATA[What are the advantages of stored procedures, triggers, indexes?
stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients donâ€™t need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has [...]]]></description>
			<content:encoded><![CDATA[<p>What are the advantages of stored procedures, triggers, indexes?</p>
<p><strong><em>stored procedure</em></strong> is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients donâ€™t need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application) side.</p>
<p><strong><em>A trigger</em> </strong>is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.</p>
<p><strong><em>Indexes</em> </strong>are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/mysql-interview-questions/expert-level-mysql-interview-questions/stored-procedures-triggers-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

