<?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>discard query result &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/discard-query-result/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 28 Sep 2017 12:37:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 13 Jun 2016 19:27:38 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[composite key]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database Developer]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[discard query result]]></category>
		<category><![CDATA[foreign key]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[natural key]]></category>
		<category><![CDATA[Primary key]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[unique key]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3035</guid>

					<description><![CDATA[What are the different main type of normalization? In database design, we start with one single table, with all possible columns. A lot of redundant data would be present since it’s a single table. The process of removing the redundant data, by splitting up the table in a well defined fashion is called normalization. First [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2%2F&#038;title=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-primary-unique-foregin-super-natural-surrogate-candidate-composite-key-normalization-day-2/" data-a2a-title="SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-2)"></a></p><p><strong>What are the different main type of normalization?</strong></p>
<blockquote><p>In database design, we start with one single table, with all possible columns. A lot of redundant data would be present since it’s a single table. The process of removing the redundant data, by splitting up the table in a well defined fashion is called normalization.</p>
<p><strong>First Normal Form (1NF):</strong>A relation is said to be in first normal form if and only if all underlying domains contain atomic values only. After 1NF, we can still have redundant data.</p>
<p><strong>Second Normal Form (2NF):</strong>A relation is said to be in 2NF if and only if it is in 1NF and every non key attribute is fully dependent on the primary key. After 2NF, we can still have redundant data.</p>
<p><strong>Third Normal Form (3NF):</strong>A relation is said to be in 3NF, if and only if it is in 2NF and every non key attribute is non-transitively dependent on the primary key.</p></blockquote>
<p><strong>What is the Primary key?</strong></p>
<blockquote><p>A primary key is a one or more fields that uniquely identifies a row in a table. The primary key cannot be null (blank). The primary key is indexed.</p>
<p>A primary key is a value that can be used to identify a unique row in a table.</p></blockquote>
<p><strong>What should be your best practice with Primary Key?</strong></p>
<blockquote class="wp-embedded-content" data-secret="9NktFhZ1G1"><p><a href="https://www.dbrnd.com/2015/09/best-practice-for-primary-key-in-database-management-system/">Best practice for Primary Key in Database Management System</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/09/best-practice-for-primary-key-in-database-management-system/embed/#?secret=9NktFhZ1G1" data-secret="9NktFhZ1G1" width="600" height="338" title="&#8220;Best practice for Primary Key in Database Management System&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>How to find all the Tables without having a Primary Key?</strong></p>
<blockquote class="wp-embedded-content" data-secret="9xi49k8KqF"><p><a href="https://www.dbrnd.com/2016/01/sql-server-script-to-find-all-the-tables-without-having-a-primary-key/">SQL Server: Script to find all the Tables without having a Primary Key</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-script-to-find-all-the-tables-without-having-a-primary-key/embed/#?secret=9xi49k8KqF" data-secret="9xi49k8KqF" width="600" height="338" title="&#8220;SQL Server: Script to find all the Tables without having a Primary Key&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is the Unique key?</strong></p>
<blockquote><p>Unique key also ensures data uniqueness like primary key.</p>
<p>A column with unique key defined allows null value. By default, it creates non-clustered index.</p></blockquote>
<p><strong>What is the Super key?</strong></p>
<blockquote><p>A superkey is defined in the relational model as a set of attributes of a relation variable (relvar) for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set. Equivalently a superkey can also be defined as a set of attributes of a relvar upon which all attributes of the relvar are functionally dependent.</p></blockquote>
<p><strong>What is the Foreign key?</strong></p>
<blockquote><p> A foreign key is a relationship between columns in two database tables (one of which is indexed) designed to insure consistency of data.</p>
<p>Usually a foreign key in one table refers to the primary key (PK) of another table. This way references can be made to link information together and it is an essential part of database normalization.</p></blockquote>
<p><strong>How to Find Foreign key References in SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="JBYQPgMqrd"><p><a href="https://www.dbrnd.com/2015/06/find-foreign-key-reference-source-target-in-sql-server/">How to Find Foreign key References in SQL Server</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/06/find-foreign-key-reference-source-target-in-sql-server/embed/#?secret=JBYQPgMqrd" data-secret="JBYQPgMqrd" width="600" height="338" title="&#8220;How to Find Foreign key References in SQL Server&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>How you can find source and destination information of all foreign keys?</strong></p>
<blockquote class="wp-embedded-content" data-secret="aR1cKvqKP8"><p><a href="https://www.dbrnd.com/2015/10/postgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint/">PostgreSQL: Script to find Source and Destination of All Foreign Key Constraint</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/10/postgresql-script-to-find-source-and-destination-of-all-foreign-key-constraint/embed/#?secret=aR1cKvqKP8" data-secret="aR1cKvqKP8" width="600" height="338" title="&#8220;PostgreSQL: Script to find Source and Destination of All Foreign Key Constraint&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is the Composite key?</strong></p>
<blockquote><p>A composite key consists of more than one field to uniquely identify a record. This differs from a compound key in that one or more of the attributes, which make up the key, are not simple keys in their own right. Taking the example from compound key, imagine we identified a student by their firstName + lastName.</p>
<p>In our table representing students on modules our primary key would now be firstName + lastName + moduleCode. Because firstName + lastName represent a unique reference to a student, they are not each simple keys, they have to be combined in order to uniquely identify the student. Therefore the key for this table is a composite key.</p></blockquote>
<p><strong>What is the Natural key?</strong></p>
<blockquote><p>A composite primary key which is composed of attributes (fields) which already exist in the real world e.g. First Name, Last Name, Social Security Number.</p></blockquote>
<p><strong>What is the Surrogate key?</strong></p>
<blockquote><p>A primary key which is internally generated (typically auto-incremental integer value) that does not exist in the real world i.e. ID=1 for Customer A and ID=2 for Customer B serves to uniquely identify the record but has no bearing the customer themselves and is an attribute they will never (need to) be aware of.</p></blockquote>
<p><strong>What is the Candidate key?</strong></p>
<blockquote><p>A candidate key is a column or group of columns that can uniquely identify a row in the table without referring to any other source.</p></blockquote>
<p><strong>What is the Compound key?</strong></p>
<blockquote><p> A composite key consisting of two or more fields that uniquely describe a row in a table. The difference between compound and candidate is that all of the fields in the compound key are foreign keys; in the candidate key one or more of the fields may be foreign keys.</p></blockquote>
<p><strong>Can a foreign key reference a non-primary key?</strong></p>
<blockquote><p>Yes, a foreign key can actually reference a key that is not the primary key of a table. But, a foreign key must reference a unique key.</p></blockquote>
<p><strong>Can a foreign key contain null values?</strong></p>
<blockquote><p>Yes, a foreign key can hold NULL values. Because foreign keys can reference unique, non-primary keys – which can hold NULL values – this means that foreign keys can themselves hold NULL values as well.</p></blockquote>
<p><strong>What are the type of data integrity?</strong></p>
<ul>
<li>Domain Integrity: data type, check constraints</li>
<li>Entity Integrity: primary key, unique constraint</li>
<li>Referential Integrity: foreign key constraint</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: After execution discard a result of the Query</title>
		<link>https://www.dbrnd.com/2016/01/sql-server-after-execution-discard-a-result-of-the-query/</link>
					<comments>https://www.dbrnd.com/2016/01/sql-server-after-execution-discard-a-result-of-the-query/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 20 Jan 2016 19:44:16 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[discard query result]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1347</guid>

					<description><![CDATA[I am describing the necessary help of SSMS to discard the result of the query after it executed in SQL Server. I was testing my SQL query performance with the 10000000 records and enabled execution plan. I found that SQL Query Window is taking very high memory resource and taking too much time to display [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&amp;linkname=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F01%2Fsql-server-after-execution-discard-a-result-of-the-query%2F&#038;title=SQL%20Server%3A%20After%20execution%20discard%20a%20result%20of%20the%20Query" data-a2a-url="https://www.dbrnd.com/2016/01/sql-server-after-execution-discard-a-result-of-the-query/" data-a2a-title="SQL Server: After execution discard a result of the Query"></a></p><p>I am describing the necessary help of SSMS to discard the result of the query after it executed in SQL Server.</p>
<blockquote><p>I was testing my SQL query performance with the 10000000 records and enabled execution plan.<br />
I found that SQL Query Window is taking very high memory resource and taking too much time to display all this data into our result grid.</p></blockquote>
<p>I just want to check execution plan of that query, but unfortunately, it was taking more time.<br />
We have an option in SSMS, using this we can discard the result of a query after its execution.</p>
<p><strong>You can find this menu, Tools -&gt; Options -&gt; Query Results -&gt; SQL Server -&gt; Results to Grid Tab and check mark the &#8221; Discard results after execution &#8221; option.</strong></p>
<p>Note: This option is applied in your new query window so do not test any query in existing open query window.</p>
<p><a href="https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult.png" rel="attachment wp-att-1351"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1351" src="https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult.png" alt="SQL Server Discard Query Result" width="764" height="449" srcset="https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult.png 764w, https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult-300x176.png 300w, https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult-750x441.png 750w, https://www.dbrnd.com/wp-content/uploads/2016/01/SQLServerDiscardQueryResult-150x88.png 150w" sizes="auto, (max-width: 764px) 100vw, 764px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/01/sql-server-after-execution-discard-a-result-of-the-query/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
