<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2629026891971804548</id><updated>2025-02-26T04:57:04.383+05:00</updated><category term="What is Sql"/><category term="Database Management System VS SQL"/><category term="Database Normalization"/><category term="Select &amp; Distinct Statement"/><category term="WHERE &amp; ORDER BY Clause"/><title type='text'>Sql development &amp;amp; DataBase Management</title><subtitle type='html'>https://de-sql.blogspot.com/ is a blog that helps you in dealing with sql development, query writing, database management, erd &amp;amp; relational database.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2629026891971804548.post-8082928367504257585</id><published>2023-02-25T23:35:00.003+05:00</published><updated>2023-02-25T23:41:13.846+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="What is Sql"/><title type='text'>Indexes in Databases: What They Are and Why They Matter</title><content type='html'>&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;If you&#39;ve ever worked with databases, you&#39;ve likely heard the term &quot;index&quot; before. But what exactly are indexes, and why are they important? In this blog post, we&#39;ll explore the basics of indexes in databases and why they matter.&lt;/span&gt;&lt;div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue;&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;What is an Index?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhlNuh26O3xROeB6cSx8zzvzl1XbvxYEU774dMgFt8GSgb1jQ9sVS5n6BeVQQ4TknYSq4-JAhfXb8rbhSXRpMgxtTMkPd4k8SvD9EmqGwECzWgvdXZ392T39bUuVEMHVtMl1hzS65hlBuU9xaTMd7Un9c2v8dX72A9C4iP86aMugkgRiV7b_iVl0Ri7Q/s2500/database-index.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2500&quot; data-original-width=&quot;2000&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhlNuh26O3xROeB6cSx8zzvzl1XbvxYEU774dMgFt8GSgb1jQ9sVS5n6BeVQQ4TknYSq4-JAhfXb8rbhSXRpMgxtTMkPd4k8SvD9EmqGwECzWgvdXZ392T39bUuVEMHVtMl1hzS65hlBuU9xaTMd7Un9c2v8dX72A9C4iP86aMugkgRiV7b_iVl0Ri7Q/w488-h320/database-index.jpg&quot; width=&quot;488&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Helvetica Neue;&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;An index is a data structure that is used to improve the speed of database queries. When you perform a query on a database, the database must search through all of the rows in the table to find the data you&#39;re looking for. This can be slow and inefficient, especially if the table is very large.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;Indexes provide a way to speed up this process. An index is essentially a list of pointers that point to the locations of data in the table. When you perform a query on the database, the database can use the index to quickly find the data you&#39;re looking for, rather than searching through all of the rows in the table.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;Why Are Indexes Important?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;Indexes are important for several reasons. First and foremost, they can significantly improve the speed of database queries. By using an index, the database can quickly locate the data you&#39;re looking for, even if the table is very large.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;In addition to improving query speed, indexes can also improve the performance of other database operations, such as sorting and grouping data. Without an index, the database may need to perform a full table scan to sort or group data, which can be slow and resource-intensive.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;Finally, indexes can also improve the overall efficiency of the database. By using indexes, the database can avoid performing unnecessary operations, such as full table scans, which can save resources and improve performance.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;Types of Indexes&lt;/span&gt;&lt;br /&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; text-align: justify;&quot;&gt;There are several types of indexes that are commonly used in databases. The most common types include:&lt;/p&gt;&lt;ul class=&quot;ul1&quot; style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;B-Tree Indexes: &lt;/span&gt;B-Tree indexes are the most common type of index and are used in most databases. B-Tree indexes are balanced tree structures that allow for fast searching and sorting of data.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;Hash Indexes:&lt;/span&gt; Hash indexes are used in some databases and are particularly useful for queries that involve exact matches. Hash indexes use a hash function to map keys to values, which can be used to quickly locate data.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #ffa400;&quot;&gt;Bitmap Indexes:&lt;/span&gt; Bitmap indexes are used for columns with a small number of distinct values. Bitmap indexes use a bitmap to represent each possible value in the column, which can be used to quickly locate data.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;p class=&quot;p1&quot; style=&quot;font-family: &amp;quot;Helvetica Neue&amp;quot;; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; text-align: justify;&quot;&gt;Indexes are an essential component of databases and play a crucial role in improving the speed and efficiency of database queries. By understanding the basics of indexes and how they work, you can optimize your database for improved performance and efficiency. Whether you&#39;re working with a small database or a large enterprise-level database, indexes are an important tool that should not be overlooked.&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/8082928367504257585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://de-sql.blogspot.com/2023/02/indexes-in-databases-what-they-are-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/8082928367504257585'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/8082928367504257585'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/2023/02/indexes-in-databases-what-they-are-and.html' title='Indexes in Databases: What They Are and Why They Matter'/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhlNuh26O3xROeB6cSx8zzvzl1XbvxYEU774dMgFt8GSgb1jQ9sVS5n6BeVQQ4TknYSq4-JAhfXb8rbhSXRpMgxtTMkPd4k8SvD9EmqGwECzWgvdXZ392T39bUuVEMHVtMl1hzS65hlBuU9xaTMd7Un9c2v8dX72A9C4iP86aMugkgRiV7b_iVl0Ri7Q/s72-w488-h320-c/database-index.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2629026891971804548.post-5614343092896021714</id><published>2020-07-17T22:12:00.001+05:00</published><updated>2020-07-17T22:12:15.574+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Normalization"/><title type='text'>Database Normalization</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;Here we will discuss four types&amp;nbsp; of &lt;b&gt;Normalization&lt;/b&gt; and some important concepts like &lt;b&gt;candidate keys&lt;/b&gt;, &lt;b&gt;Prime &amp;amp; Non-Prime attributes&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeC0CvfZT03ohfWl4lFjF7bqLY5_vNNtEc4myWvGubhn7xVtgNRYxu765jPJ094rphn5T8QPCwWhyfZ6Wq74CWSeZZxa7QFKVkBEqsem4Ow_b1EnhffXbZROoa-L4hmiNRmPeKuJskH8_X/s476/Database+Normalization.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Database Normalization&quot; border=&quot;0&quot; data-original-height=&quot;263&quot; data-original-width=&quot;476&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeC0CvfZT03ohfWl4lFjF7bqLY5_vNNtEc4myWvGubhn7xVtgNRYxu765jPJ094rphn5T8QPCwWhyfZ6Wq74CWSeZZxa7QFKVkBEqsem4Ow_b1EnhffXbZROoa-L4hmiNRmPeKuJskH8_X/w400-h221/Database+Normalization.jpg&quot; title=&quot;Database Normalization&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;Database Normalization&lt;/b&gt; is a technique to remove or reduce redundancy from the tables in the &lt;b&gt;database.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;h2 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#ffa400&quot;&gt;Types of Redundancy&lt;/font&gt;&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;There are two types of redundancies that can occur in database tables.&lt;/div&gt;&lt;h3 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;Row Level Redundancy&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In this type of redundancy, there is a repetition of the same row in the same table. For example, a table name as &#39;STUDENT&#39; in which data of students is entered, if we enter the same student&#39;s data multiple time then, in this case, Row Level redundancy occurs as shown below:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_DHIfrYTB5uMYTX2QOwv4RLz4MYpHd8cIA7skhRSOjjJFBLSBGJS0lRlDhLyIJHFGUY_DLa6R60N-VWXAiOsQ7cjpPI_q7RWg-TpU1RGbMEnZRL3aGbGCDUQuxq_Neml2gqL675VTfKFj/s583/Database+Normalization+Row+Level+Redundancy.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Database Normalization Row Level Redundancy&quot; border=&quot;0&quot; data-original-height=&quot;263&quot; data-original-width=&quot;583&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_DHIfrYTB5uMYTX2QOwv4RLz4MYpHd8cIA7skhRSOjjJFBLSBGJS0lRlDhLyIJHFGUY_DLa6R60N-VWXAiOsQ7cjpPI_q7RWg-TpU1RGbMEnZRL3aGbGCDUQuxq_Neml2gqL675VTfKFj/w400-h180/Database+Normalization+Row+Level+Redundancy.png&quot; title=&quot;Database Normalization Row Level Redundancy&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In the above case, there is a repetition of a student data whose name is &#39;Haider&#39;, this is what we called row-level redundancy.&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;The solution of Row Level Redundandancy&lt;/font&gt;&lt;/h4&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This Row-level Redundancy can be corrected by setting a primary column in the table. In this case, we set SID as the &lt;u style=&quot;font-weight: bold;&quot;&gt;primary key column&lt;/u&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;u style=&quot;font-weight: bold;&quot;&gt;(&lt;/u&gt;such column must contain unique &amp;amp; not null values&lt;u style=&quot;font-weight: bold;&quot;&gt;)&lt;/u&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2wj4_R6nWDbxqjBtJpx3tcfU5gEd3F3NdCB1xni898GK9itwKR4BB1SNrY-Eo04cWk5CKMpKu3JF1ism7eKEUl0E2LSjxa0HJM6tWjPmW7f1PvI6lcGf3kj7PyS_i7L1D3fC_4klAY5os/s476/Corrected+Row+level+redundancy+Database+Normalization.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Corrected Row Level redundancy Database Normalization&quot; border=&quot;0&quot; data-original-height=&quot;221&quot; data-original-width=&quot;476&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2wj4_R6nWDbxqjBtJpx3tcfU5gEd3F3NdCB1xni898GK9itwKR4BB1SNrY-Eo04cWk5CKMpKu3JF1ism7eKEUl0E2LSjxa0HJM6tWjPmW7f1PvI6lcGf3kj7PyS_i7L1D3fC_4klAY5os/w400-h186/Corrected+Row+level+redundancy+Database+Normalization.png&quot; title=&quot;Corrected Row Level redundancy Database Normalization&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now, this is the Redundancy free table.&lt;/div&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;Column Level Redundancy&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This type of redundancy occurs when the data of the different entities assemble in a single table. For example in the case of a university&#39;s database, if we assemble the information of entities like &#39;Student&#39;, &#39;Course&#39; and &#39;Faculty&#39; in a single table then Column Level Redundancy occurs as shown below:&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5hshLf-VpNKMhvuQwCisFsefs9s4y644FF1de32qJ4sCB8MsQlmEjYpeyryKT9eSrWJRF3K-UNRzJnJgXRYnk2SMtOVTvxJ8UsvGp3GGNPS0pbmT_DhfqiTIx6sWAu9ZCcrNQcxsroAH/s866/column+Level+redundancy+Database+Normalization.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;column level redundancy Database normalization&quot; border=&quot;0&quot; data-original-height=&quot;383&quot; data-original-width=&quot;866&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5hshLf-VpNKMhvuQwCisFsefs9s4y644FF1de32qJ4sCB8MsQlmEjYpeyryKT9eSrWJRF3K-UNRzJnJgXRYnk2SMtOVTvxJ8UsvGp3GGNPS0pbmT_DhfqiTIx6sWAu9ZCcrNQcxsroAH/w640-h284/column+Level+redundancy+Database+Normalization.png&quot; title=&quot;column level redundancy Database normalization&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In this case, there are 3 types of anomalies that occur when we start working on this database.&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Deletion Anomaly&lt;/font&gt;&lt;/h4&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;u&gt;If we want to delete any row from the given table&lt;/u&gt;:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Let suppose we want to delete data of student having SID=1 from the given example, we write the following query:&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Delete&lt;/font&gt; &lt;font color=&quot;#3d85c6&quot;&gt;From&lt;/font&gt; Student &lt;font color=&quot;#3d85c6&quot;&gt;Where &lt;/font&gt;SID=1;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;The query will be executed successfully but the problem is that along with student data all other important data related to &#39;Course&#39; &amp;amp; &#39;Faculty&#39; will also be deleted by the SQL server.&lt;/div&gt;&lt;div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Insertion Anomaly&lt;/font&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;u style=&quot;font-weight: bold;&quot;&gt;If we want to insert anything in the given table&lt;/u&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Let suppose we want to introduce a new course having CID=C4 &amp;amp; CName=&#39;Programing Fundamental&#39; in the given table, we write the following query:&lt;/div&gt;&lt;div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Insert Into&lt;/font&gt; Student &lt;font color=&quot;#3d85c6&quot;&gt;Values&lt;/font&gt; (C4, &#39;Programing Fundamental&#39;);&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;But at the moment not a single student is enrolled in this course &amp;amp; we also don&#39;t know about the faculty related to that course. So, there is a redundancy in this table.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;h4 style=&quot;clear: both;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Update Anomaly&lt;/font&gt;&lt;/h4&gt;&lt;div&gt;&lt;b&gt;&lt;u&gt;If we want to update anything in the given table&lt;/u&gt;:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Suppose we want to update the faculty name having FID= &#39;F1&#39; from FName= &#39;Tanveer&#39; to &#39;Sadiq&#39; in the given example, we write the following query:&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div&gt;&lt;font color=&quot;#e06666&quot;&gt;Update&lt;/font&gt; student &lt;font color=&quot;#3d85c6&quot;&gt;set&lt;/font&gt; FName = &#39;Sadiq&#39; &lt;font color=&quot;#3d85c6&quot;&gt;where&lt;/font&gt; FID = &#39;F1&#39;;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;The &lt;span&gt;q&lt;/span&gt;uery will be executed successfully, But! as you notice the repetition of FID = &#39;F1&#39;, FName will be updated from &#39;Tanveer&#39; to &#39;Sadiq&#39; every time where FID = &#39;F1&#39; and it will create a problem when data is very large i.e it is not time efficient.&lt;/div&gt;&lt;div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;The solution of Row Level Redundandancy&lt;/font&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;The solution of column-level redundancy is that we divide this single table into three separate tables as shown below. By doing so all the anomalies can be resolved.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRmfbaO-f2G-iCX85COfstKVCtvC1WFoI1vxBtUqd3eunyrVNX8jR7QuiXa9Dg6CfgxH24V376FNeEkqadUICNmbOeXRwZjtxSbd8NB7AHxoWk3hLvSKyaAQJikUxves2Gp5qVhpBwAwNp/s866/Database+Normalized+Table+corrected+Column+level+redundancy.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Database Normalized Column level redundancy&quot; border=&quot;0&quot; data-original-height=&quot;417&quot; data-original-width=&quot;866&quot; height=&quot;309&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRmfbaO-f2G-iCX85COfstKVCtvC1WFoI1vxBtUqd3eunyrVNX8jR7QuiXa9Dg6CfgxH24V376FNeEkqadUICNmbOeXRwZjtxSbd8NB7AHxoWk3hLvSKyaAQJikUxves2Gp5qVhpBwAwNp/w640-h309/Database+Normalized+Table+corrected+Column+level+redundancy.png&quot; title=&quot;Database Normalized Column level redundancy&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#ffa400&quot;&gt;Some Important Aspects&lt;/font&gt;&lt;/h2&gt;&lt;h3&gt;&lt;font color=&quot;#0b5394&quot;&gt;Candidate key&lt;/font&gt;&lt;/h3&gt;&lt;div&gt;Keys that are able to determine the whole table it can be a single column or combination of more than one columns. From candidate columns, one is selected as a &lt;b&gt;primary column &lt;/b&gt;and all others are known as &lt;b&gt;alternative columns.&lt;/b&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;Prime Attribute&lt;/font&gt;&lt;/h3&gt;&lt;div&gt;Attributes that help to determine the candidate keys.&lt;/div&gt;&lt;div&gt;&lt;h3&gt;&lt;font color=&quot;#0b5394&quot;&gt;Non-Prime Attribute&lt;/font&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;All the attributes other than Prime attributes are known as Prime Attributes.&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#6fa8dc&quot;&gt;Example:&lt;/font&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlhh-Dy3gWOi2vPOQqbRRFRth8dAoaqNr6nM48DFzi1_zyYIdkTVGUBep8vaWbXDiZMglBOyi4MFlCLn0KTjTSo8_IUWAEOxkMtOx20-uCJoK-x8LpSS448ff8RVZj7O399GCkXRmFR-A/s827/Candidate+key%252C+prime+%2526+non-prime+attributes.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Candidate key, prime &amp;amp; Non-prime Attribute&quot; border=&quot;0&quot; data-original-height=&quot;554&quot; data-original-width=&quot;827&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlhh-Dy3gWOi2vPOQqbRRFRth8dAoaqNr6nM48DFzi1_zyYIdkTVGUBep8vaWbXDiZMglBOyi4MFlCLn0KTjTSo8_IUWAEOxkMtOx20-uCJoK-x8LpSS448ff8RVZj7O399GCkXRmFR-A/w400-h268/Candidate+key%252C+prime+%2526+non-prime+attributes.png&quot; title=&quot;Candidate key, prime &amp;amp; Non-prime Attribute&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;&lt;font color=&quot;#0b5394&quot;&gt;Composite Key&lt;/font&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;When two or more columns are combined to uniquely determine the whole table, it forms a composite key.&lt;/div&gt;&lt;div&gt;&lt;h4&gt;&lt;font color=&quot;#6fa8dc&quot;&gt;Example:&lt;/font&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2GDjD8dX5bCgo98frqP0rqPj1-mJGqbbKJDSPQMplxmW1itJuwq7BC8CGZZpspsVzyjkNM-hdNOiBx9SzwhAYYCEDbrMW0fELH_cRpbNXL-4Rpz8EcJyOmqGhtDLVFUI15-99192MKoJp/s775/Composite+Key.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Composite Key&quot; border=&quot;0&quot; data-original-height=&quot;352&quot; data-original-width=&quot;775&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2GDjD8dX5bCgo98frqP0rqPj1-mJGqbbKJDSPQMplxmW1itJuwq7BC8CGZZpspsVzyjkNM-hdNOiBx9SzwhAYYCEDbrMW0fELH_cRpbNXL-4Rpz8EcJyOmqGhtDLVFUI15-99192MKoJp/w400-h181/Composite+Key.png&quot; title=&quot;Composite Key&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#ffa400&quot;&gt;Types of Normalization&lt;/font&gt;&lt;/h2&gt;&lt;div&gt;There are four types of normalizations:&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;First Normal Form (1NF)&lt;/font&gt;&lt;/h3&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;The table should not contain any multivalued attribute&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;let&#39;s take an example to understand this point.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibkpFpUlRDl1uJwdYbn1-BQwb6pUKKfuauG0PTgi3ibYP0zHg42NnvtpQpVnbLqnX-lnQDd2ial2CugmJRrzCKLLCz_4x7QWNHrcqeNvUV7m0IKLVcIba_bnNwczlhFklG-GVVfVGvQgMa/s486/error+in+First+normal+form+Database+Normalization.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Errors in First normalization form&quot; border=&quot;0&quot; data-original-height=&quot;344&quot; data-original-width=&quot;486&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibkpFpUlRDl1uJwdYbn1-BQwb6pUKKfuauG0PTgi3ibYP0zHg42NnvtpQpVnbLqnX-lnQDd2ial2CugmJRrzCKLLCz_4x7QWNHrcqeNvUV7m0IKLVcIba_bnNwczlhFklG-GVVfVGvQgMa/w400-h284/error+in+First+normal+form+Database+Normalization.png&quot; title=&quot;Errors in First normalization form&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;The problem in the table&lt;/font&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;It is possible that a student may have more than 1 phone no.&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;But here in this case representation is wrong so we can say that this table is not in &lt;b&gt;First normal form (1NF).&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Normalize to First normal form (1NF)&lt;/font&gt;&lt;/b&gt;&lt;/h4&gt;&lt;div&gt;&lt;font&gt;For normalizing the above table to 1NF here are some methods shown below:&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;font&gt;In &lt;b&gt;1st case&lt;/b&gt;, we create two different attributes or columns of &#39;Phone no&#39; for the sake of Database Normalization as shown:&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifbRCwsH8fREHWxDtKvMcjqFfWNAlg-yPMV3Z0TC1VhoPP-_uXBj82nFa8H7FS6PsasrE35MAni5m8u5emMpHrWOJopy8F1HwxJvCcf6DdP9iKOWKiqZ4gZhzJFGJbj7hOuB728mYdVIFL/s481/First+Normalized+form+Database+%25281NF%2529.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Database normalization First normalization form (1NF)&quot; border=&quot;0&quot; data-original-height=&quot;328&quot; data-original-width=&quot;481&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifbRCwsH8fREHWxDtKvMcjqFfWNAlg-yPMV3Z0TC1VhoPP-_uXBj82nFa8H7FS6PsasrE35MAni5m8u5emMpHrWOJopy8F1HwxJvCcf6DdP9iKOWKiqZ4gZhzJFGJbj7hOuB728mYdVIFL/w400-h272/First+Normalized+form+Database+%25281NF%2529.png&quot; title=&quot;Database normalization First normalization form (1NF)&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;Now we can say that this table is in 1NF.&lt;/div&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In &lt;b&gt;2nd case&lt;/b&gt;, we divide a single table into two different tables &amp;amp; relate them by using a foreign key as shown:&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQS2A63ObkJSAzHu6keMJtBLaoT6724A5mmhKOktw29TZ1vsgHOedNwRpOQThmWihO4Xf_H1XdFyxUgQhc-l4fuNJ6-WzTlzMGbacCeRKwA8h6w7dhmB47mYb3I9188PbL2tN8AkfoBqZ/s799/Database+nomalization+1NF+2nd+case.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;First normalization form (1NF) 2nd case&quot; border=&quot;0&quot; data-original-height=&quot;365&quot; data-original-width=&quot;799&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQS2A63ObkJSAzHu6keMJtBLaoT6724A5mmhKOktw29TZ1vsgHOedNwRpOQThmWihO4Xf_H1XdFyxUgQhc-l4fuNJ6-WzTlzMGbacCeRKwA8h6w7dhmB47mYb3I9188PbL2tN8AkfoBqZ/w400-h183/Database+nomalization+1NF+2nd+case.png&quot; title=&quot;First normalization form (1NF) 2nd case&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt; In this case, we create a separate table for student&#39;s phone nos and form a &lt;b&gt;composite key &lt;/b&gt;by joining two columns &#39;Roll#&#39; &amp;amp; &#39;Phone no&#39;, &#39;Roll#&#39; as a foreign key gets its references from &#39;Student&#39; table.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In the&amp;nbsp;&lt;b&gt;3rd case&lt;/b&gt;, we Normalize the above example to &lt;b&gt;1NF &lt;/b&gt;without creating any extra table &amp;amp; columns as shown:&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHV_xPdkPk_XpGwgNlkXANfSnHX2K9QgLOTOpm13gau0JbUaeMBJ41J_hkTTySRMyw-P4dcUA0AlyrJmKDaK-pxJz7S7exrtVwBNhkjFFvV9sjK20VAO2UCtsYa7LS096tRortF7juGxg9/s392/Database+Normalization+1NF+3rd+case.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;First normal form 3rd case&quot; border=&quot;0&quot; data-original-height=&quot;392&quot; data-original-width=&quot;352&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHV_xPdkPk_XpGwgNlkXANfSnHX2K9QgLOTOpm13gau0JbUaeMBJ41J_hkTTySRMyw-P4dcUA0AlyrJmKDaK-pxJz7S7exrtVwBNhkjFFvV9sjK20VAO2UCtsYa7LS096tRortF7juGxg9/w287-h320/Database+Normalization+1NF+3rd+case.png&quot; title=&quot;First normal form 3rd case&quot; width=&quot;287&quot; /&gt;&lt;/a&gt;In this case, we just create extra rows and set &#39;Roll#&#39; &amp;amp; &#39;Phone no&#39; as a &lt;b&gt;composite key&lt;/b&gt;.&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;Second Normal Form (2NF)&lt;/font&gt;&lt;/h3&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;The table must be in First Normal Form.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;There should be no partial dependency in the relation.&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;let&#39;s take an example to understand the points.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuRmTMGHx2fcp4qt0W18_jw_Og9bOtCW8Co7mcbpstTKzPFn4MGU1p6k2sAkBJFztsuSb14CfgXRcsV0OlM8Fd_Yi4LhcrBrxb4hBs2Kx03GsTqR9xhyphenhyphenBmDD_Yo_KkBmEs3NfAkwzSf60Z/s670/Second+normal+form+%25282NF%2529+Database+Normalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;406&quot; data-original-width=&quot;670&quot; height=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuRmTMGHx2fcp4qt0W18_jw_Og9bOtCW8Co7mcbpstTKzPFn4MGU1p6k2sAkBJFztsuSb14CfgXRcsV0OlM8Fd_Yi4LhcrBrxb4hBs2Kx03GsTqR9xhyphenhyphenBmDD_Yo_KkBmEs3NfAkwzSf60Z/w400-h243/Second+normal+form+%25282NF%2529+Database+Normalization.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In this case, &#39;CustomerID&#39; &amp;amp; &#39;StoreID&#39; depends on each other i.e both are &lt;b&gt;Prime attributes&lt;/b&gt; or we can say that these two attributes are &lt;b&gt;Candidate keys.&lt;/b&gt;&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;&lt;font color=&quot;#3d85c6&quot;&gt;The problem in the table&lt;/font&gt;&lt;/b&gt;&lt;/h4&gt;&lt;div&gt;&lt;font&gt;The first condition of 2NF is satisfied that is &#39;Table should be in 1NF&#39; but the problem arises in the second condition that is described as follow:&lt;/font&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;font&gt;The column or attribute name as &#39;Location&#39; is fully dependent on &#39;StoreID&#39; &amp;amp; &#39;StoreID&#39; is fully dependent on &#39;CustomerID&#39; so &#39;Location&#39; is partially dependent on &#39;CustomerID&#39; and this the violation of &lt;b&gt;Second normal form (2NF).&lt;/b&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;Let&#39;s understand this point diagrammatically:&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQBsU1zZEZAm0_xyz0IdmxSeqHOyabFUzsfwDLp6dq8M-Xs3uNQOv173SN706hl6uKFkq5oxxPknslHANLcv2qoSGI16MjEDcOsynz0Vuafcyy8AJ5ZMpw57kMeuZ4UPIapkEt4nUHhYx6/s632/2NF+error+Database+Normalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Second normal form error&quot; border=&quot;0&quot; data-original-height=&quot;372&quot; data-original-width=&quot;632&quot; height=&quot;235&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQBsU1zZEZAm0_xyz0IdmxSeqHOyabFUzsfwDLp6dq8M-Xs3uNQOv173SN706hl6uKFkq5oxxPknslHANLcv2qoSGI16MjEDcOsynz0Vuafcyy8AJ5ZMpw57kMeuZ4UPIapkEt4nUHhYx6/w400-h235/2NF+error+Database+Normalization.png&quot; title=&quot;Second normal form error&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;This purely the violation of Second normal form.&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Normalize to 2NF&lt;/font&gt;&lt;/h4&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Simply, we divide the single table into two separate tables to normalize the table to 2NF as shown below:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglgWtMrBj0N9MT_pQ5SKghKC6dTV1gWaSDW4Xtl8erRQZm3mukWM-ilRp3LgLcTiWsBwkR_AXdiw8MzjGhAxB2BLyvJ8rhHJ_LDA5adDYhBBnr2Gc0PL46uONqykCQm6hla5pYfHH26HRC/s775/Second+normal+form+Database+Normalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;database Normalization 2NF&quot; border=&quot;0&quot; data-original-height=&quot;352&quot; data-original-width=&quot;775&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglgWtMrBj0N9MT_pQ5SKghKC6dTV1gWaSDW4Xtl8erRQZm3mukWM-ilRp3LgLcTiWsBwkR_AXdiw8MzjGhAxB2BLyvJ8rhHJ_LDA5adDYhBBnr2Gc0PL46uONqykCQm6hla5pYfHH26HRC/w400-h181/Second+normal+form+Database+Normalization.png&quot; title=&quot;database Normalization 2NF&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Now both tables are in Second normal form (2NF). In the case of the first table name as &lt;b&gt;&#39;&lt;/b&gt;&lt;b&gt;Store&lt;/b&gt;&lt;b&gt;&#39;,&lt;/b&gt;&amp;nbsp;&#39;Location&#39; (act as a &lt;b&gt;non-prime attribute&lt;/b&gt;) fully dependent on &#39;StoreID&#39; (act as a &lt;b&gt;prime attribute&lt;/b&gt;). So, we can say that it is in 2NF. In the case of the second table name as &lt;b&gt;&#39;Customer&#39;, &lt;/b&gt;there is no non-prime attribute, both are prime-attributes and dependent on each other.&lt;/div&gt;&lt;h3 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#0b5394&quot;&gt;Third Normal Form (3NF)&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;The table should be in 2NF.&amp;nbsp;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Any non-prime attribute should not be determined by non-prime attribute.&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Let&#39;s take an example to understand the points.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5jVcop4cMSeKfENDycQDOwsarBxkNKwk2VyS307F4j_2_OkcfC9hdPZVlZX4GCIb1-YDEca642gcgPGwHXhYfs594bUPHkeAfugkssxSrtB17Nh1GOKBXV07vswwi4NEGxRkDbd84iPM/s439/error+in+3NF+database+normalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;324&quot; data-original-width=&quot;439&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5jVcop4cMSeKfENDycQDOwsarBxkNKwk2VyS307F4j_2_OkcfC9hdPZVlZX4GCIb1-YDEca642gcgPGwHXhYfs594bUPHkeAfugkssxSrtB17Nh1GOKBXV07vswwi4NEGxRkDbd84iPM/s320/error+in+3NF+database+normalization.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;In this case, &#39;Roll#&#39; is a &lt;b&gt;candidate key &lt;/b&gt;&amp;amp; &lt;b&gt;prime attribute&lt;/b&gt; and set as a primary key, on the other hand &#39;State&#39; &amp;amp; &#39;City&#39; are &lt;b&gt;non-prime attributes. &lt;/b&gt;&#39;State&#39; &amp;amp; &#39;City&#39; are non-prime attribute because these attributes are not helpful in selecting a candidate key that is &#39;Roll#&#39; in this example.&lt;/div&gt;&lt;h4 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;&lt;font color=&quot;#3d85c6&quot;&gt;The problem in the table&lt;/font&gt;&lt;/b&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now come toward the point that is this table in 3NF?&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In this case,&amp;nbsp;&lt;b&gt;Candidate Key = C.k = &#39;Roll#&#39;, Prime attribute = &#39;Roll#&#39;, Non-Prime attribute = &#39;State&#39; &amp;amp; &#39;City&#39;.&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Functional dependencies: (&lt;/b&gt;Shown below&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAI7NQcZu1coxPXXv3gqkYx-LrRaDSfo79XfdaTC1lFTcfdt8nn4GyYYsJU0D6P2pQE1voVoO3DMHzZgzkp0hYIYC3-0X3Pv93RKLxPmwJRb2aKETYOFnP0bCLbqQ6AYwQSh1ANvmzQ3Ee/s446/Error+in+3NF+database+nomalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Functional Dependency (error in 3NF)&quot; border=&quot;0&quot; data-original-height=&quot;283&quot; data-original-width=&quot;446&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAI7NQcZu1coxPXXv3gqkYx-LrRaDSfo79XfdaTC1lFTcfdt8nn4GyYYsJU0D6P2pQE1voVoO3DMHzZgzkp0hYIYC3-0X3Pv93RKLxPmwJRb2aKETYOFnP0bCLbqQ6AYwQSh1ANvmzQ3Ee/w400-h254/Error+in+3NF+database+nomalization.png&quot; title=&quot;Functional Dependency (error in 3NF)&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;This table is not in &lt;b&gt;3NF &lt;/b&gt;because &#39;state&#39;(non-prime attribute) determines &#39;city&#39;(non-prime attribute) &amp;amp; this is against the law of 3NF that is (Any non-prime attribute should not be determined by non-prime attribute). In the above fig. first functional dependency is a valid but second functional dependency is not valid according to &lt;b&gt;Third normal form (3NF).&lt;/b&gt;&lt;/div&gt;&lt;h3 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;&lt;font color=&quot;#0b5394&quot;&gt;BCNF(Boyce Codd Normal Form)&lt;/font&gt;&lt;/b&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;The table should be in 3NF.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;L.H.S of each Functional Dependency (FD) should be a candidate key or super key.&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Let&#39;s take an example to understand the points.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ALmG9fUfW2X7zhbgGC-OPSxTD-5cyyym4dpCX2QR__zbwL4UAkyWlperHPugwNtioKD0viN3LC2MdiTigEjGNBqvbEUtYFjk6FH2VoKiKO0O6bYVOor7YsIk-l_S1SgRsyVxoJvWgiin/s621/BCNF+Database+Normalization.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;BCNF Database normalization&quot; border=&quot;0&quot; data-original-height=&quot;425&quot; data-original-width=&quot;621&quot; height=&quot;274&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3ALmG9fUfW2X7zhbgGC-OPSxTD-5cyyym4dpCX2QR__zbwL4UAkyWlperHPugwNtioKD0viN3LC2MdiTigEjGNBqvbEUtYFjk6FH2VoKiKO0O6bYVOor7YsIk-l_S1SgRsyVxoJvWgiin/w400-h274/BCNF+Database+Normalization.png&quot; title=&quot;BCNF Database normalization&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;font color=&quot;#3d85c6&quot;&gt;Description of table&lt;/font&gt;&lt;/h4&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In this case &lt;b&gt;Candidate key ={Roll#, Reg#}&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&amp;nbsp;Functional Dependency(FD): (&lt;/b&gt;Shown below&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyZywPTigJHOP8VF8pLQEvBCe9QrP22e88rKO6hLJt0M8kWPp6xBIQZGecyOpNU-O1qVM7gmuqpZafnrLxJ8Eehpz_96Mr1ox2aO-WftIj_c4BOIdpHUkEk_lpqrNX4hloaF7_qR11Ibtr/s432/BCNF+Functional+Dependencies.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;BCNF Functional dependencies&quot; border=&quot;0&quot; data-original-height=&quot;329&quot; data-original-width=&quot;432&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyZywPTigJHOP8VF8pLQEvBCe9QrP22e88rKO6hLJt0M8kWPp6xBIQZGecyOpNU-O1qVM7gmuqpZafnrLxJ8Eehpz_96Mr1ox2aO-WftIj_c4BOIdpHUkEk_lpqrNX4hloaF7_qR11Ibtr/w400-h305/BCNF+Functional+Dependencies.png&quot; title=&quot;BCNF Functional dependencies&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;So we can say that both the conditions of &lt;b&gt;BCNF&lt;/b&gt;&amp;nbsp;are fulfiled in the given example, i.e table is in 3NF &amp;amp; L.H.S of each functional dependencies are candidate keys as shown above.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/5614343092896021714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://de-sql.blogspot.com/2020/07/database-normalization.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/5614343092896021714'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/5614343092896021714'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/2020/07/database-normalization.html' title='Database Normalization'/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeC0CvfZT03ohfWl4lFjF7bqLY5_vNNtEc4myWvGubhn7xVtgNRYxu765jPJ094rphn5T8QPCwWhyfZ6Wq74CWSeZZxa7QFKVkBEqsem4Ow_b1EnhffXbZROoa-L4hmiNRmPeKuJskH8_X/s72-w400-h221-c/Database+Normalization.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2629026891971804548.post-4896047888910763110</id><published>2020-07-14T23:02:00.004+05:00</published><updated>2020-07-15T10:16:22.720+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Management System VS SQL"/><title type='text'>Database Management System VS SQL</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;To run any computer application, Database is the most essential. And for this, one must have a clear idea about the difference between &lt;b&gt;DBMS&lt;/b&gt; software and &lt;b&gt;&lt;a href=&quot;http://de-sql.blogspot.com/2020/07/what-is-sql.html&quot; target=&quot;_blank&quot;&gt;SQL&lt;/a&gt; tool&lt;/b&gt;. In this article, you’ll be better able to understand this important aspect.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://de-sql.blogspot.com/2020/07/database-management-system-sql.html&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Database Management System VS SQL&quot; border=&quot;0&quot; data-original-height=&quot;506&quot; data-original-width=&quot;616&quot; height=&quot;263&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj5yvOD6EP8_dxRlSlGwyCV3GvbmY4XN_WM-4ONCwlWyrBjG7Gfc9fmBUZ4jhDhmxuSZ85uXVjd9wB-gMXO6ganORs4SylQ79eH3ps7_1xIiITbAAEQhmp0RlkdCQFmTQC3hcn86JW9a0b/w320-h263/Database+Management+System+vs+SQL.png&quot; title=&quot;Database Management System VS SQL&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;First of all, what is actually a &lt;b&gt;Database also known as DB&lt;/b&gt;? The answer is, Database is a collection of data which allows the storage &amp;amp; manipulation of data. The reason we prefer a database over storing data in a random text file is actually the better management system. To manage large data, there is a need for a proper system, as per the requirement of the application. Such a system is called Database Management System.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;On the other hand, &lt;b&gt;&lt;a href=&quot;http://de-sql.blogspot.com/2020/07/what-is-sql.html&quot; target=&quot;_blank&quot;&gt;Structured Query Language&lt;/a&gt;&amp;nbsp;&lt;/b&gt;is a Programming Language basically used to access the DB.&amp;nbsp;Structured Query Language&amp;nbsp;is such a command; you write to manipulate data. It is the most popular programming language for the&amp;nbsp;&lt;b&gt;Database Management Systems&lt;/b&gt; to date.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Therefore, in a linear structure, first comes the &lt;b&gt;DB&lt;/b&gt;, then &lt;b&gt;DBMS&lt;/b&gt;, then &lt;b&gt;SQL &lt;/b&gt;tools and finally comes the clients and application.&amp;nbsp;SQL&amp;nbsp;tools are concerned with manipulating data whereas&amp;nbsp;&lt;b&gt;Database Management Systems&amp;nbsp;&lt;/b&gt;are used&amp;nbsp;for managing the data in the DB. In simple words, these tools create a link between users and application.&lt;/div&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot;&gt;Database Management System Software VS SQL Tools&lt;/font&gt;&lt;/h2&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;Types&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;DBMS software application basically varies on the type of system. It includes 4 types. These are&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Hierarchical&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Network&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Relational&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Object-Oriented Relational&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;All of these are quite well known, depending on the client as well as the application, as to which &lt;b&gt;DBMS &lt;/b&gt;type is used. The system software is also determined accordingly. &lt;b&gt;Hierarchical&lt;/b&gt; type is good for small applications as it has a typical tree and node concept. &lt;b&gt;Network&lt;/b&gt; type works best when there are too many relations of an application. A &lt;b&gt;Relational&lt;/b&gt; type is mostly used with its tabular data concept. The &lt;b&gt;OOR&lt;/b&gt; type is primarily involved in storing new data.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Structured Query Language&lt;/b&gt; mostly uses a &lt;b&gt;Relational Database&lt;/b&gt;. The programing language depends on the operation, the tool is about to perform. Some of these operations include manipulation, maintenance &amp;amp; optimization etc. MySQL, Oracle, MS SQL Server and likewise are some of the popular software, while some well-known management tools include Navicat Monitor, Adminer, DBComparer etc.&lt;/div&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;Learning Curve&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The learning curve for both &lt;b&gt;DBMS&lt;/b&gt; &amp;amp; &lt;b&gt;SQL&lt;/b&gt; is somehow different.&amp;nbsp;&lt;b&gt;Database Management System&lt;/b&gt;&amp;nbsp;software applications are almost similar as far as the user interface goes. Therefore, if the DBMS type is the same, the learning curve is not that steep. However, the learning curve of &lt;b&gt;Structured Query Language&lt;/b&gt; is flat because once you have learnt it, you can use it on any&amp;nbsp;&lt;b&gt;Database Management System&lt;/b&gt;&amp;nbsp;software with a few modifications. However, tools vary a lot depending on the purpose they serve, so one needs to put effort to learn them in full details.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In simple words, the learning curve depends on the type of software or tool. However, SQL tools are easy to learn as they are limited in their functionalities and quite specific in use. But you might be handling multiple tools, and therefore, you have to put it all together. On the contrary,&amp;nbsp;&lt;b&gt;Database Management System&lt;/b&gt;&amp;nbsp;software will take much investment in time &amp;amp; effort to master in it.&amp;nbsp;&lt;/div&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;Functions&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;DBMS software is an application for creating &amp;amp; managing the database. It offers you the systematic user interface to create, retrieve, and manage data. However,&amp;nbsp;&lt;b&gt;Structured Query Language&amp;nbsp;&lt;/b&gt;is basically used to access different DB.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;DBMS does not support distributed property while SQL does. Also, normalization is not available in DBMS but present in SQL. However, you can use multiple SQL tools to analyze the data you have in your already created DB.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Even though&amp;nbsp;&lt;b&gt;Structured Query Language&lt;/b&gt;&amp;nbsp;is somewhat a smaller part of the entire system, it is not totally engulfed by DBMS. There are certain features that are exclusive in SQL tools and you cannot do them with any other tool available in the management system.&amp;nbsp;&lt;/div&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot;&gt;Conclusion&lt;/font&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Both DBMS software as well as SQL tool holds much importance in any application. DBMS is of no use without SQL language and vice versa. It is more likely to be said as &lt;b&gt;DBMS &lt;/b&gt;is an IDE and&amp;nbsp;&lt;b&gt;Structured Query Language&lt;/b&gt;&amp;nbsp;is the language to wire on the IDE. DBMS software is the system, and these tools are what you need to run it. These tools are dependent on the DB and cannot function without the presence of any DB.&lt;/div&gt;&lt;div style=&quot;text-align: right;&quot;&gt;&lt;font color=&quot;#990000&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;text-align: right;&quot;&gt;&lt;font color=&quot;#990000&quot;&gt;&lt;b&gt;Assisted By Ms. Anoosha Khurram&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/4896047888910763110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://de-sql.blogspot.com/2020/07/database-management-system-sql.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/4896047888910763110'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/4896047888910763110'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/2020/07/database-management-system-sql.html' title='Database Management System VS SQL'/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj5yvOD6EP8_dxRlSlGwyCV3GvbmY4XN_WM-4ONCwlWyrBjG7Gfc9fmBUZ4jhDhmxuSZ85uXVjd9wB-gMXO6ganORs4SylQ79eH3ps7_1xIiITbAAEQhmp0RlkdCQFmTQC3hcn86JW9a0b/s72-w320-h263-c/Database+Management+System+vs+SQL.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2629026891971804548.post-7663426892291579239</id><published>2020-07-14T01:03:00.004+05:00</published><updated>2020-07-14T23:17:37.330+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Select &amp; Distinct Statement"/><category scheme="http://www.blogger.com/atom/ns#" term="WHERE &amp; ORDER BY Clause"/><title type='text'>MS SQL SERVER &amp; MYSQL SELECT database with DISTINCT, WHERE &amp; ORDER BY Clause  </title><content type='html'>&lt;h1 style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://de-sql.blogspot.com/2020/07/ms-sql-server-mysql-select-database.html&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;MS SQL SERVER &amp;amp; MYSQL SELECT database with DISTINCT, WHERE &amp;amp; ORDER BY Clause&quot; border=&quot;0&quot; data-original-height=&quot;361&quot; data-original-width=&quot;652&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie1z-_4sD75vFRFCiNYtXLZP7Jd8dPuEjKahza3JN9uIyXPU7gMuSW-uuILfhLMJCdP8NDfreO_NTl-Gt3CWFbhSRc7fl-DWsaECHRGUc66Nn19E-WefoWvf1W6zI8wgO8ehG3jFtzgk94/w320-h177/Sql%252CDatabase%252CQuery+writing%252Cselect+statement.png&quot; title=&quot;MS SQL SERVER &amp;amp; MYSQL SELECT database with DISTINCT, WHERE &amp;amp; ORDER BY Clause&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/h1&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The&amp;nbsp;&lt;b&gt;SELECT&lt;/b&gt;&amp;nbsp;statement in&amp;nbsp;&lt;b&gt;SQL&lt;/b&gt;&amp;nbsp;syntax is used to retrieve data from the tables that exist in the database that we want to retrieve. Displays this result in tabular format.&lt;/p&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #f57c00; font-size: xx-large;&quot;&gt;Syntax:&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;font size=&quot;5&quot;&gt;&lt;font color=&quot;#3367d6&quot;&gt;SELECT&lt;/font&gt;&amp;nbsp;column_name&amp;nbsp;&lt;font color=&quot;#3367d6&quot;&gt;FROM&amp;nbsp;&lt;/font&gt;table_name;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The&amp;nbsp;&lt;b&gt;semicolon&lt;/b&gt;&amp;nbsp;is used at the end of the query just to show that our query is completed, for example, If you write two or more select queries than each query is separated by a semicolon. And&amp;nbsp;&lt;b&gt;FROM&lt;/b&gt;&amp;nbsp;is used to connect to the respective table we want to deal with.&amp;nbsp;&lt;u&gt;&lt;b&gt;The syntax of MS SQL SERVER and MYSQL SELECT database is the same.&lt;/b&gt;&lt;/u&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #f57c00; font-size: xx-large;&quot;&gt;Demo DataBase:&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;&lt;font face=&quot;inherit&quot;&gt;Here is a demo database tables to help you better understand.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: #f8f9fa;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip1cGJlimsjEFNHLtWiiXWK0BlglQqy8Wf9a58nC3Of5zm-ofzK7REQAG9HrKm3MS_KKoi5AmoaEEj3ORrPe70NBrsHIn4a4IT8vKsdelU473hDqsrEvfBZp3PWCjnRi4AopJvpYROeq57/s638/Demo+DATABASE+SQL+TABLE.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;DEMO database&quot; border=&quot;0&quot; data-original-height=&quot;245&quot; data-original-width=&quot;638&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip1cGJlimsjEFNHLtWiiXWK0BlglQqy8Wf9a58nC3Of5zm-ofzK7REQAG9HrKm3MS_KKoi5AmoaEEj3ORrPe70NBrsHIn4a4IT8vKsdelU473hDqsrEvfBZp3PWCjnRi4AopJvpYROeq57/w640-h246/Demo+DATABASE+SQL+TABLE.png&quot; title=&quot;DEMO database&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #222222; text-align: justify; white-space: pre-wrap;&quot;&gt;Here are the &lt;b&gt;Structured Query Language&lt;/b&gt; queries to create your own tables just like this table. Just copy it and paste it in your SQL server or MySQL workbench and start practising on MS SQL SERVER or MYSQL SELECT database with DISTINCT, WHERE &amp;amp; ORDER BY Clause.&lt;/div&gt;&lt;h3 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot;&gt;1ST:&lt;/font&gt;&lt;/h3&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #4285f4; white-space: pre-wrap;&quot;&gt;CREATE TABLE&lt;/span&gt;&lt;font face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt; &lt;/font&gt;DPT&lt;font color=&quot;#4285f4&quot;&gt; &lt;/font&gt;(&lt;font color=&quot;#4285f4&quot;&gt; &lt;/font&gt;DPTNO&lt;font color=&quot;#4285f4&quot;&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: #4285f4; white-space: pre-wrap;&quot;&gt;INT&lt;/span&gt;&lt;font face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;, DNAME&lt;font color=&quot;#4285f4&quot;&gt; VARCHAR&lt;/font&gt;(30), DptLoc &lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;color: #4285f4; white-space: pre-wrap;&quot;&gt;VARCHAR&lt;/span&gt;&lt;font face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;(20));&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot; face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot; face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;INSERT INTO &lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;DPT&lt;/span&gt;&lt;font color=&quot;#4285f4&quot; style=&quot;white-space: pre-wrap;&quot;&gt; &lt;/font&gt;&lt;font face=&quot;inherit&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt; VALUES &lt;/font&gt;(1, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;ACCOUNTING&#39;&lt;/font&gt;,&lt;font color=&quot;#4285f4&quot;&gt; &lt;/font&gt;&lt;font color=&quot;#d52c1f&quot;&gt;&#39;NEW YORK&#39; &lt;/font&gt;),(2, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;RESEARCH&#39;&lt;/font&gt;, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;DALLAS&#39;&lt;/font&gt;),(3, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;SALES&#39;&lt;/font&gt;, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;CHICAGO&#39; &lt;/font&gt;),(4, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;OPERATIONS&#39;&lt;/font&gt;, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;BOSTON&#39; &lt;/font&gt;),(5, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;DBM&#39;&lt;/font&gt;, &lt;font color=&quot;#d52c1f&quot;&gt;&#39;CANADA&#39; &lt;/font&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: #f8f9fa;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;h3 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; face=&quot;inherit&quot; size=&quot;5&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;2ND:&lt;/span&gt;&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;CREATE TABLE &lt;/font&gt;SALGRADE (GRADE &lt;font color=&quot;#4285f4&quot;&gt;INT &lt;/font&gt;,LOSAL &lt;font color=&quot;#4285f4&quot;&gt;INT &lt;/font&gt;,HISAL &lt;font color=&quot;#4285f4&quot;&gt;INT &lt;/font&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;INSERT INTO&lt;/font&gt; SALGRADE &lt;font color=&quot;#4285f4&quot;&gt;VALUES&lt;/font&gt;(1, 700, 1200), (2, 1201, 1400), (3, 1401, 2000), (4, 2001, 3000), (5, 3001, 9999)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;&lt;/h3&gt;&lt;/div&gt;&lt;h2 style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #f57c00; font-size: xx-large;&quot;&gt;Cases of SELECT Query:&lt;/span&gt;&lt;/h2&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #3367d6;&quot;&gt;&lt;font size=&quot;5&quot;&gt;Retrieve all the data from a table:&lt;/font&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;To retrieve all the data from the above table name as DPT we use the following query:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT * FROM &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPT&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;the same Syntax is used in both MS SQL Server &amp;amp; MYSQL as shown below:&lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjr5sS4YuNX1mDkKglwr0xVBtrIR4PQ44-fwUrZeG71pDQS2CIHNfS79TCOWryW_w7IyGbpWRWxCJ34Mi1SmzeQD4D8ztxtUumXVGZwxOCAYTdylaOnNuWnynds3_xDL4WYoaiyLnzkJg/s694/MYSQL+SELECT+DATABASE+all.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;How to fetch data in sql&quot; border=&quot;0&quot; data-original-height=&quot;333&quot; data-original-width=&quot;694&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjr5sS4YuNX1mDkKglwr0xVBtrIR4PQ44-fwUrZeG71pDQS2CIHNfS79TCOWryW_w7IyGbpWRWxCJ34Mi1SmzeQD4D8ztxtUumXVGZwxOCAYTdylaOnNuWnynds3_xDL4WYoaiyLnzkJg/w400-h193/MYSQL+SELECT+DATABASE+all.png&quot; title=&quot;MYSQL DATABASE SELECT&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#3367d6&quot;&gt;MYSQL WORKBENCH&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#4285f4&quot;&gt;retrieve&lt;/font&gt;&lt;font color=&quot;#3367d6&quot;&gt;&amp;nbsp;all data from a table&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7MW3RO97M6k_Gc63gPvJeCYxjCKlSVh4CVnlEnlodT8VjkPECzl9hVg2i8pmHYEFtivRIqQcGOzf9qvd0u_uVtGFfZnFI5g4nNTgjWnIC4kAXdv1dfIM6A-lo6NgPF07j-fHp9qJrgwHs/s487/SQL+SERVER+SELECT+QUERY+all.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;SELECT STATEMENT&quot; border=&quot;0&quot; data-original-height=&quot;270&quot; data-original-width=&quot;487&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7MW3RO97M6k_Gc63gPvJeCYxjCKlSVh4CVnlEnlodT8VjkPECzl9hVg2i8pmHYEFtivRIqQcGOzf9qvd0u_uVtGFfZnFI5g4nNTgjWnIC4kAXdv1dfIM6A-lo6NgPF07j-fHp9qJrgwHs/w400-h221/SQL+SERVER+SELECT+QUERY+all.png&quot; title=&quot;SELECT STATEMENT&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#3367d6&quot;&gt;MS SQL SERVER retrieve all data from a table&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;wp-block-group&quot;&gt;&lt;div class=&quot;wp-block-group__inner-container&quot;&gt;&lt;div&gt;&lt;h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #3367d6; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #3367d6;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Retrieve One Column from a table:&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Write a statement that displays DNAME from DPT.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DNAME &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;FROM &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPT&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--/wp:group--&gt;&lt;!--wp:heading {&quot;level&quot;:5}--&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/h4&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:image {&quot;id&quot;:19,&quot;width&quot;:512,&quot;height&quot;:288,&quot;sizeSlug&quot;:&quot;large&quot;,&quot;className&quot;:&quot;is-style-default&quot;}--&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6KiWMRjU8vFNh7eXcNqFE8GN77UJooUuzlyDSj76dcKDCGkRwXek9qwPQfJVwzmbSC1ZXC7_JHGUwJF402NIJWcmWEn5m3yM_4gYViQIq-8Zxn0xKQ1ZY11KUf1WInOrGWlVkHYt_64TR/s340/MYSQL+SELECT+1+column+DATABASE.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;318&quot; data-original-width=&quot;340&quot; height=&quot;374&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6KiWMRjU8vFNh7eXcNqFE8GN77UJooUuzlyDSj76dcKDCGkRwXek9qwPQfJVwzmbSC1ZXC7_JHGUwJF402NIJWcmWEn5m3yM_4gYViQIq-8Zxn0xKQ1ZY11KUf1WInOrGWlVkHYt_64TR/w400-h374/MYSQL+SELECT+1+column+DATABASE.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL retrieve data&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FxH4RcxlTGpANtf5onnKJAvYbT62TMcUuAIoOLge0AhtXwLUEJzByuh1g0hkRXC7iW4HQlB4ov4K_QDcdTqjKNV3fOQLQvjrUxOVuWgGEf1Nx7JRXCKyPgywmKwA5IIanF4gC5Up_Ua7/s276/SQL+SERVER+SELECT+1+COLUMN.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;258&quot; data-original-width=&quot;276&quot; height=&quot;374&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3FxH4RcxlTGpANtf5onnKJAvYbT62TMcUuAIoOLge0AhtXwLUEJzByuh1g0hkRXC7iW4HQlB4ov4K_QDcdTqjKNV3fOQLQvjrUxOVuWgGEf1Nx7JRXCKyPgywmKwA5IIanF4gC5Up_Ua7/w400-h374/SQL+SERVER+SELECT+1+COLUMN.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;SQL SERVER&amp;nbsp;retrieves&amp;nbsp;a single column&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #3367d6; font-size: x-large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #3367d6;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;Retrieve multiple Columns from a table:&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/h3&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Write a statement that displays the columns DPTNO and DNAME from DPT.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPTNO&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DNAME &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;FROM &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPT&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:heading {&quot;level&quot;:5}--&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/h4&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:image {&quot;id&quot;:20,&quot;width&quot;:512,&quot;height&quot;:288,&quot;sizeSlug&quot;:&quot;large&quot;}--&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid-yk-9-EEYNSe429EoDWL0a9RREzJE44rMWTa9K_d36HGfVrBi1raSFmfKWNSuBok5F-oQvgr80M6nlX_UdrQayhQ80zSVmeHgE6AM-Cs_dN-XramaaTsJsRuGKA9S29kOgku1uSBzfpN/s312/MYSQL+SELECT+DATABASE+multiple+columns.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MYSQL DATABASE  retrive multiple columns&quot; border=&quot;0&quot; data-original-height=&quot;312&quot; data-original-width=&quot;310&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid-yk-9-EEYNSe429EoDWL0a9RREzJE44rMWTa9K_d36HGfVrBi1raSFmfKWNSuBok5F-oQvgr80M6nlX_UdrQayhQ80zSVmeHgE6AM-Cs_dN-XramaaTsJsRuGKA9S29kOgku1uSBzfpN/w397-h400/MYSQL+SELECT+DATABASE+multiple+columns.png&quot; title=&quot;MYSQL DATABASE  retrive multiple columns&quot; width=&quot;397&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL WORKBENCH fetch multiple columns&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;!--wp:heading {&quot;level&quot;:4}--&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSKKN4uVaMUlL7_LNpGiY2Nc1P6aHXsDlvOzxYokxhksQ7HKL1v16zDUKk-9gZFj3VUzW8d3og7M7rM6WJrf_ve0UTyvU9mdc43mfNM6bZt8rAFsDlyFfPOVEwdLqdevmNySoBNRjW_oSq/s357/SQL+SERVER+SELECt+statement.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;retrive MULTIPLE COLUMNS&quot; border=&quot;0&quot; data-original-height=&quot;257&quot; data-original-width=&quot;357&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSKKN4uVaMUlL7_LNpGiY2Nc1P6aHXsDlvOzxYokxhksQ7HKL1v16zDUKk-9gZFj3VUzW8d3og7M7rM6WJrf_ve0UTyvU9mdc43mfNM6bZt8rAFsDlyFfPOVEwdLqdevmNySoBNRjW_oSq/w400-h288/SQL+SERVER+SELECt+statement.png&quot; title=&quot;retrive MULTIPLE COLUMNS&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;SQL SERVER fetch multiple columns&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #3367d6;&quot;&gt;&lt;font size=&quot;5&quot;&gt;Retrieve data from multiple tables:&lt;/font&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Write a Query that displays the data from both tables mentioned above.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;&lt;font size=&quot;5&quot;&gt;* &lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;FROM &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPT&lt;font size=&quot;5&quot;&gt;,&lt;/font&gt; SALGRADE&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;&lt;font color=&quot;#b51200&quot;&gt;[NOTE]&lt;/font&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#222222&quot;&gt;&lt;span style=&quot;background-color: white; white-space: pre-wrap;&quot;&gt;&lt;b&gt;Both the tables are separated by a comma. This simple Query is working in the form that if both tables contain 5 &amp;amp; 5 rows than the result contain  5*5=25 rows this case of the statement is also known as CROSS JOIN that we will learn later.&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9IPqGks9kb3n_qnlTVuqi3BCipvgX4xyZuA-nHsEjBoYeQI8n0hbA1SfRc0wdCAYvcpZhdTIGTDMKbmTPlTQJqUCiCh3fPYg1g3Z7D71NN1LalruEHBNomVWzRx73mBRwEMWp0DeCvLzS/s794/mysql+select+database+from+multiple+tables.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;CROSS JOIN&quot; border=&quot;0&quot; data-original-height=&quot;651&quot; data-original-width=&quot;794&quot; height=&quot;328&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9IPqGks9kb3n_qnlTVuqi3BCipvgX4xyZuA-nHsEjBoYeQI8n0hbA1SfRc0wdCAYvcpZhdTIGTDMKbmTPlTQJqUCiCh3fPYg1g3Z7D71NN1LalruEHBNomVWzRx73mBRwEMWp0DeCvLzS/w400-h328/mysql+select+database+from+multiple+tables.png&quot; title=&quot;CROSS JOIN&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL DATABASE&amp;nbsp; from multiple tables&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv8nBwt0xz4UD2Xe9q4u19Dr4vEMEmzjUR9GvWUDF1jk7uRJiP1MR4W9qpNN8S99ILZyRGFMrulcdOdDwFVp7cGEUBbJwMOPlUHOuoJsAPtMsDYW1_kTMp-I9sZn-HZRoQr6KMY1iXX9dP/s652/SQL+SERVER+RETRIVE+DATA+FROM+MULTIPLE+TABLES.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;SQL CROSS JOIN&quot; border=&quot;0&quot; data-original-height=&quot;652&quot; data-original-width=&quot;490&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv8nBwt0xz4UD2Xe9q4u19Dr4vEMEmzjUR9GvWUDF1jk7uRJiP1MR4W9qpNN8S99ILZyRGFMrulcdOdDwFVp7cGEUBbJwMOPlUHOuoJsAPtMsDYW1_kTMp-I9sZn-HZRoQr6KMY1iXX9dP/w300-h400/SQL+SERVER+RETRIVE+DATA+FROM+MULTIPLE+TABLES.png&quot; title=&quot;SQL CROSS JOIN&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MS SQL data from multiple tables.&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #f57c00;&quot;&gt;&lt;font size=&quot;6&quot;&gt;CLAUSES in SQL:&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;With&amp;nbsp;&lt;span class=&quot;has-inline-color has-secondary-color&quot;&gt;Distinct&lt;/span&gt;&amp;nbsp;Clause&lt;/font&gt;&lt;/h3&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The&lt;b&gt;&amp;nbsp;distinct&lt;/b&gt;&amp;nbsp;clause is used to eliminate duplicate rows from the result of a&amp;nbsp;&lt;b&gt;Statement&lt;/b&gt;. If&amp;nbsp;&lt;strong&gt;Distinct&lt;/strong&gt;&amp;nbsp;is not used, all rows are returned including duplicates.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Write a query to display all distinct LOC from DPT.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT DISTINCT &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;LOC&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;FROM &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; white-space: pre-wrap;&quot;&gt;DPT&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:heading {&quot;level&quot;:5}--&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/h4&gt;&lt;div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKwxB1jLL8kgtmJsjBKbf06RweMHFC6QfxdymhtWdIhy7u9RKF79uVQlhPmf6t0BfjTD79JxxDX_qtMtanw_oORBVm2Bo42DhyphenhyphenpxTrk7ArkWOmHFiiqNv7eqCdVzNzytBifJQf75X4eo6z/s394/MYSQL+Select+distinct+database.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MYSQL DATABASE SELECT DISTINCT statement&quot; border=&quot;0&quot; data-original-height=&quot;297&quot; data-original-width=&quot;394&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKwxB1jLL8kgtmJsjBKbf06RweMHFC6QfxdymhtWdIhy7u9RKF79uVQlhPmf6t0BfjTD79JxxDX_qtMtanw_oORBVm2Bo42DhyphenhyphenpxTrk7ArkWOmHFiiqNv7eqCdVzNzytBifJQf75X4eo6z/w400-h301/MYSQL+Select+distinct+database.png&quot; title=&quot;MYSQL DATABASE SELECT DISTINCT statement&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL DATABASE distinct statement&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy0G1m24KwjkHJq9tJud_Yn3Y5b1FOU3ETCtQrx6BxniMRFf5m50u98yySg_Y_Y2joXkT4QQg3lC5F7EI7CjdhsjsMymoyRjQNLv9-SLlBwXGnuTCGcJp-GSCai_x7xKqisIIph_i5z4ul/s376/SQL+SERVER+SELECT+DISTINCT+Clause.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;DIFFERENCE BEYWEEN simple &amp;amp; SELECT DISTINCT STATEMENT&quot; border=&quot;0&quot; data-original-height=&quot;376&quot; data-original-width=&quot;363&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy0G1m24KwjkHJq9tJud_Yn3Y5b1FOU3ETCtQrx6BxniMRFf5m50u98yySg_Y_Y2joXkT4QQg3lC5F7EI7CjdhsjsMymoyRjQNLv9-SLlBwXGnuTCGcJp-GSCai_x7xKqisIIph_i5z4ul/w386-h400/SQL+SERVER+SELECT+DISTINCT+Clause.png&quot; title=&quot;DIFFERENCE BEYWEEN simple &amp;amp; SELECT DISTINCT STATEMENT&quot; width=&quot;386&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;SQL SERVER difference b/w Simple &amp;amp; Distinct Statement&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;!--/wp:image--&gt;&lt;!--wp:heading {&quot;level&quot;:4}--&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;With&amp;nbsp;&lt;span class=&quot;has-inline-color has-secondary-color&quot;&gt;Where&lt;/span&gt;&amp;nbsp;Clause&lt;/font&gt;&lt;/h3&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Where&lt;/strong&gt;&amp;nbsp;clause is used to retrieve data from a table&amp;nbsp;&lt;em&gt;conditionally&lt;/em&gt;. It can appear only after&amp;nbsp;&lt;strong&gt;From&lt;/strong&gt;&amp;nbsp;clause.&lt;/p&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Example:&lt;/font&gt;&lt;/h4&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Write a query that displays records of departments located in NEW YORK from 1st table.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT * FROM DPT WHERE Loc = &#39;&lt;/span&gt;NEW YORK&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;&#39; ;&lt;/span&gt;&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:heading {&quot;level&quot;:5}--&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example:&lt;/font&gt;&lt;/h4&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:image {&quot;id&quot;:28,&quot;width&quot;:512,&quot;height&quot;:288,&quot;sizeSlug&quot;:&quot;large&quot;}--&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqwN3sBUqp-r2F34E-1O-47GkVZF4wl1C5ybtWSiPQSwFDFnq1phwLHE-hFF9bPap-0HDD7zk7uA1YaLCkHyGEZ3WmltOQl_8cEsk-3Ffc38ehez99OzbBJNFbygyCfZJpmSCZEVa_SlN/s391/MYSQL+SELECT+STATEMENT+with+WHERE+CLAUSE.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MYSQL DATABASE WHERE CLAUSE&quot; border=&quot;0&quot; data-original-height=&quot;287&quot; data-original-width=&quot;391&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqwN3sBUqp-r2F34E-1O-47GkVZF4wl1C5ybtWSiPQSwFDFnq1phwLHE-hFF9bPap-0HDD7zk7uA1YaLCkHyGEZ3WmltOQl_8cEsk-3Ffc38ehez99OzbBJNFbygyCfZJpmSCZEVa_SlN/w400-h294/MYSQL+SELECT+STATEMENT+with+WHERE+CLAUSE.png&quot; title=&quot;MYSQL DATABASE WHERE CLAUSE&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL WHERE clause&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLDFY3EErkPGteupFDcQoE-z3mVlnM2wZu0bPGJwdcYU7bVRHfqURw5wrdub0VulmwP9X9FPs5mhFYPHlEn8Wk9AgxpOMNZBOe-qoLYAhgZWXmWBwNFwpNazUbcLiT93YdtQT-zIK571a/s353/SQL+SERVER+WHERE+clause.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;SQL DATABASE WHERE CLAUSE&quot; border=&quot;0&quot; data-original-height=&quot;233&quot; data-original-width=&quot;353&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFLDFY3EErkPGteupFDcQoE-z3mVlnM2wZu0bPGJwdcYU7bVRHfqURw5wrdub0VulmwP9X9FPs5mhFYPHlEn8Wk9AgxpOMNZBOe-qoLYAhgZWXmWBwNFwpNazUbcLiT93YdtQT-zIK571a/w400-h264/SQL+SERVER+WHERE+clause.png&quot; title=&quot;SQL DATABASE WHERE CLAUSE&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;SQL SERVER WHERE clause&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h5&gt;&lt;/h5&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#b51200&quot;&gt;[NOTE]&lt;/font&gt;&lt;/h4&gt;&lt;font size=&quot;3&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Structured Query Language&lt;/b&gt;&amp;nbsp;uses single quotes around text values. Most database systems also accept double-quotes. Numeric values should not be enclosed in quotes.&lt;/div&gt;&lt;/font&gt;&lt;!--wp:heading {&quot;level&quot;:4}--&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#3367d6&quot; size=&quot;5&quot;&gt;With&amp;nbsp;&lt;span class=&quot;has-inline-color has-secondary-color&quot;&gt;Order BY&lt;/span&gt;&amp;nbsp;Clause&lt;/font&gt;&lt;/h3&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:group--&gt;&lt;div class=&quot;wp-block-group&quot;&gt;&lt;div class=&quot;wp-block-group__inner-container&quot;&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The&amp;nbsp;&lt;strong&gt;Order BY&lt;/strong&gt;&amp;nbsp;clause is used to sort the row. The process of arranging data or records in a sequence is called&amp;nbsp;&lt;b&gt;SORTING&lt;/b&gt;. A sort can be ascending or descending.&lt;b&gt;&amp;nbsp;Structured query language&lt;/b&gt;&amp;nbsp;uses&amp;nbsp;&lt;strong&gt;ASC&lt;/strong&gt;&amp;nbsp;keyword to specify ascending sort and&amp;nbsp;&lt;strong&gt;DESC&lt;/strong&gt;&amp;nbsp;keyword for descending sort, and by default, data is arranged in ascending order.&amp;nbsp;&lt;strong&gt;Order BY&lt;/strong&gt;&amp;nbsp;must be the last clause in the Select statement.&lt;/p&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Example:&lt;/font&gt;&lt;/h4&gt;&lt;!--/wp:heading--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Display records of departments located in NEW YORK from DPT table in descending order by DPTNO.&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:paragraph--&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;SELECT * FROM DPT WHERE Loc = &#39;&lt;/span&gt;NEW YORK&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;&#39; ORDER BY &lt;/span&gt;DPTNO&amp;nbsp;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;DESC &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-size: x-large; white-space: pre-wrap;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;!--/wp:paragraph--&gt;&lt;!--wp:heading {&quot;level&quot;:5}--&gt;&lt;h4 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;Practical Example&lt;/font&gt;&lt;/h4&gt;&lt;!--/wp:heading--&gt;&lt;!--wp:image {&quot;id&quot;:33,&quot;sizeSlug&quot;:&quot;large&quot;}--&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeTewf_2pBeqbplruG6haIwWARmej1zzNqTBreqZ4f6uXuYxeMF5quTgsBuFbQpc-CyIt-euIwhdN35ZLetpDRWmQ9vc6_KYhoo9Pl0BBpzBE9gbSy_qeMnr5Qzg02mDbeyo177WJsWpef/s387/MYSQL+SELECT+DATABASE+WITH+ORDER+BY+CLAUSE.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;DATABASE ORDER BY CLAUSE&quot; border=&quot;0&quot; data-original-height=&quot;273&quot; data-original-width=&quot;387&quot; height=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeTewf_2pBeqbplruG6haIwWARmej1zzNqTBreqZ4f6uXuYxeMF5quTgsBuFbQpc-CyIt-euIwhdN35ZLetpDRWmQ9vc6_KYhoo9Pl0BBpzBE9gbSy_qeMnr5Qzg02mDbeyo177WJsWpef/w400-h283/MYSQL+SELECT+DATABASE+WITH+ORDER+BY+CLAUSE.png&quot; title=&quot;MYSQL DATABASE ORDER BY CLAUSE&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;MYSQL WORKBENCH ORDER BY&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOn3ZoTyvxMEbGinONb1fVYrccKHPo3uEQ2QjPy9_OIkT9uX0IZVyq09_qMU_Hic9WOW7hjB11A2pC_fkRs9rQ2aqE-KQUMjk3bxVyYqGOD3hLk80Euc7Jdp28Z5WgA2-fapJxHpbGQoIM/s355/MS+SQL+SERVER+ORDER+BY+Clause.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;ORDER BY CLAUSE&quot; border=&quot;0&quot; data-original-height=&quot;235&quot; data-original-width=&quot;355&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOn3ZoTyvxMEbGinONb1fVYrccKHPo3uEQ2QjPy9_OIkT9uX0IZVyq09_qMU_Hic9WOW7hjB11A2pC_fkRs9rQ2aqE-KQUMjk3bxVyYqGOD3hLk80Euc7Jdp28Z5WgA2-fapJxHpbGQoIM/w400-h265/MS+SQL+SERVER+ORDER+BY+Clause.png&quot; title=&quot;SQL DATABASE ORDER BY CLAUSE&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;font color=&quot;#4285f4&quot;&gt;SQL SERVER ORDER BY&lt;/font&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot;&gt;Conclusion:&lt;/font&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font size=&quot;5&quot;&gt;In this session, we have learned the bases of SQL development that is how to fetch data from the tables given to us and we also learn how to apply any conditions to our query by using&amp;nbsp;&lt;b&gt;WHERE&amp;nbsp;&lt;/b&gt;clause, that is the most important keyword of&amp;nbsp;&lt;b&gt;Structured Query Language,&amp;nbsp;&lt;/b&gt;in most cases, we have to deal with this keyword and in the end, we learn how to use&amp;nbsp;&lt;b&gt;ORDER BY&lt;/b&gt;&amp;nbsp;clause, when we want our output in a specific arranged order we use it.&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/7663426892291579239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://de-sql.blogspot.com/2020/07/ms-sql-server-mysql-select-database.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/7663426892291579239'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/7663426892291579239'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/2020/07/ms-sql-server-mysql-select-database.html' title='MS SQL SERVER &amp; MYSQL SELECT database with DISTINCT, WHERE &amp; ORDER BY Clause  '/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie1z-_4sD75vFRFCiNYtXLZP7Jd8dPuEjKahza3JN9uIyXPU7gMuSW-uuILfhLMJCdP8NDfreO_NTl-Gt3CWFbhSRc7fl-DWsaECHRGUc66Nn19E-WefoWvf1W6zI8wgO8ehG3jFtzgk94/s72-w320-h177-c/Sql%252CDatabase%252CQuery+writing%252Cselect+statement.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2629026891971804548.post-5588921711008714008</id><published>2020-07-09T18:21:00.015+05:00</published><updated>2020-07-14T23:18:05.757+05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="What is Sql"/><title type='text'>What is Sql</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; line-height: 1.5; text-align: center;&quot;&gt;&lt;font size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;font face=&quot;inherit&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;Here we learn about important aspects of the structured query language, its importance, its use, and its&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;relation with databases.&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;font face=&quot;inherit&quot;&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://de-sql.blogspot.com/2020/07/what-is-sql.html&quot; style=&quot;background-color: white; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;What-is-sql&quot; border=&quot;0&quot; data-original-height=&quot;361&quot; data-original-width=&quot;652&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDrIGD-uXbrnLNJfOCSxjnsfRMii7METftZavIIs1Wkk5thRd7VTNV25CJYTzX_q-ASz1sdawDmt_NFG9owmwMGawsT7yIh9YllbgX-jYJ7gj7QLNc-n-IqpgZcEt0UDoeU7fUy9Kb5BZ/w400-h221/Sql-Database-Query-writing-what-is-sql.png&quot; title=&quot;What-is-sql&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; line-height: 1.5; text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b style=&quot;font-family: inherit; line-height: 1.5;&quot;&gt;SQL&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; is a domain-specific language used in programming and to handle data in a &lt;b&gt;&lt;a href=&quot;https://de-sql.blogspot.com/2020/07/database-management-system-sql.html&quot; target=&quot;_blank&quot;&gt;database management system&lt;/a&gt;&lt;/b&gt;. In simple words, it&amp;nbsp;is used to communicate with databases. Writing and executing the way you render data from the database is called a query.&amp;nbsp;The code you use to write the queries is a structured query language.&lt;/span&gt;&lt;/div&gt;&lt;/font&gt;&lt;div&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white; line-height: 1.5;&quot;&gt;What is meant by domain-specific?&amp;nbsp;&lt;/font&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;Here is a quick definition to help you understand domain-specific languages, but first you need to understand what a &lt;b&gt;general-purpose language or GPL&lt;/b&gt; is, these are programming dialects that can be used to tackle a wide variety of problems using one of these languages. e.g C++, C#, Java, Ruby, Python, Rust.&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;b&gt;domain-specific languages or DSL &lt;/b&gt;for short are created to work on a known problem they are often created within an organization that wants a way to define their solutions using a syntax that more closely matches their work model. &lt;b&gt;DSLs&amp;nbsp;&lt;/b&gt;are abstractions that make it easier to express a problem and define a solution. They can be used to better communicate between programmers and non-programmers because the syntax is typically more human-readable. Since &lt;b&gt;DSLs&amp;nbsp;&lt;/b&gt;can better guess at what you are trying to do then a &lt;b&gt;GPL&lt;/b&gt; they are better able to check for common mistakes and misuses, a couple of examples of &lt;b&gt;DSL &lt;/b&gt;are HTML and SQL there is a lot of other dsls out there but many of them are developed privately by companies and are never released publicly.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: justify;&quot;&gt;&lt;font color=&quot;#f4a900&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;Why SQL is a domain-specific language?&lt;/font&gt;&lt;/h3&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;b&gt;Structured Query Language&lt;/b&gt;, is used to work with data in DB. It is used by every relational database management system, abbreviated DBMS, even if there are some slight degree differences across platforms. And it can not be used for any other purpose other than DB handling like other general-purpose languages.&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white; line-height: 1.5;&quot;&gt;SQL is easy to learn:&lt;/font&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;&lt;ul style=&quot;line-height: 1.5; text-align: left;&quot;&gt;&lt;li style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;It is not a programming language, it is a query language.&lt;/font&gt;&lt;/li&gt;&lt;li style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;It&lt;b&gt;&amp;nbsp;&lt;/b&gt;is almost close to simple English text.&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white; line-height: 1.5;&quot;&gt;Syntax:&lt;/font&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;font color=&quot;#3367d6&quot;&gt;Select&lt;/font&gt; Column_Name &lt;font color=&quot;#3367d6&quot;&gt;from &lt;/font&gt;Table_Name;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy5flDFuWryurfIrfTeogIiqW44q_QzWehr7WhP-2WIlxZZUY1wnwyvt3_dfYIFkStqHeHmcJu-74_21xtMTpkynYWbVk3q1KNF8vXZSyyJyzVJtVRuketXiBdR91rnrPwg3UjysmpjS0f/s518/SQL-Syntax.png&quot; style=&quot;background-color: white; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;What-is-SQL-syntax&quot; border=&quot;0&quot; data-original-height=&quot;258&quot; data-original-width=&quot;518&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy5flDFuWryurfIrfTeogIiqW44q_QzWehr7WhP-2WIlxZZUY1wnwyvt3_dfYIFkStqHeHmcJu-74_21xtMTpkynYWbVk3q1KNF8vXZSyyJyzVJtVRuketXiBdR91rnrPwg3UjysmpjS0f/w400-h199/SQL-Syntax.png&quot; title=&quot;What-is-SQL-syntax&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;font size=&quot;5&quot; style=&quot;background-color: #f4c7c3;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white; line-height: 1.5;&quot;&gt;Use of SQL:&lt;/font&gt;&lt;/b&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;It is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard dialect for &lt;b style=&quot;line-height: 1.5;&quot;&gt;RDBM&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 1.5;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;S&lt;/b&gt;&lt;/span&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;(relational database management systems).&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;SQL&lt;/strong&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&amp;nbsp;statements are used to perform tasks such as delete data, update data, retrieve data, and delete data from a database. These tasks are commonly known as &lt;b style=&quot;line-height: 1.5;&quot;&gt;CURD&lt;/b&gt;(create, update, retrieve, and delete).In the database world, you are interacting with DB that do not use traditional relational structures, most DBMS try hard to create query&amp;nbsp;&lt;span style=&quot;text-align: center;&quot;&gt;languages&lt;/span&gt;&amp;nbsp;that look as similar as&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: center;&quot;&gt;structured query language&lt;/span&gt;&lt;span&gt;&amp;nbsp;because it is so common in the database world. So, no matter what DB platform you want to work with,&amp;nbsp;&lt;/span&gt;&lt;span&gt;it will advance your career.&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 1.5; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white;&quot;&gt;Major RDBMS:&lt;/font&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;There are many types of relational databases such as...&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; list-style-type: disc; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;Oracle&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; list-style-type: disc; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;MySQL&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; list-style-type: disc; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;Ms SQL Server&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; list-style-type: disc; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;PostgreSQL&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; list-style-type: disc; margin-bottom: 0pt; margin-top: 0pt; text-align: justify;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot;&gt;SQLite... etc&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;All the relational databases use &lt;/span&gt;&lt;b style=&quot;font-family: inherit;&quot;&gt;SQL&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; as there core language, but the syntax of each database is different to some extent. The names mentioned above are &lt;/span&gt;&lt;b style=&quot;font-family: inherit;&quot;&gt;RDB &lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;(relational databases) and SQL&lt;/span&gt;&lt;b style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;is used in these RDBs to deal with the database.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;Both &lt;b&gt;MySQL &lt;/b&gt;and &lt;b&gt;MS SQL Server &lt;/b&gt;are widely used in enterprise database systems. &lt;b&gt;MySQL &lt;/b&gt;is an open-source RDBMS and is offered by Oracle, while MySQL Server is a Microsoft product.&lt;/span&gt;&lt;/div&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;line-height: 1.5; text-align: justify;&quot;&gt;&lt;b style=&quot;line-height: 1.5;&quot;&gt;&lt;font color=&quot;#f57c00&quot; size=&quot;6&quot; style=&quot;background-color: white; line-height: 1.5;&quot;&gt;History of SQL:&lt;/font&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;font face=&quot;inherit&quot; size=&quot;5&quot; style=&quot;background-color: white;&quot;&gt;It was first developed in the 1970s by IBM researchers Raymond Boyce and Donald Chamberlain. Now it is known as the Sequel, was created in 1970 following the publication of Edgar Frank Todd&#39;s paper, &quot;A Relationship Model of Data for Large Shared Data Banks.&quot;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: inherit; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;&lt;h1 class=&quot;Uo8X3b&quot; style=&quot;clip: rect(1px, 1px, 1px, 1px); color: #222222; font-family: arial, sans-serif; font-size: 14px; font-weight: normal; height: 1px; line-height: 1.5; margin: 0px; overflow: hidden; padding: 0px; position: absolute; text-align: justify; white-space: nowrap; width: 1px; z-index: -1000;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Search ResultsFeatured snippet from the&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://de-sql.blogspot.com/feeds/5588921711008714008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://de-sql.blogspot.com/2020/07/what-is-sql.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/5588921711008714008'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2629026891971804548/posts/default/5588921711008714008'/><link rel='alternate' type='text/html' href='https://de-sql.blogspot.com/2020/07/what-is-sql.html' title='What is Sql'/><author><name>Moez Nazir</name><uri>http://www.blogger.com/profile/10906920280982452337</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRh03xgWJA_Ne1UqW_NELaWlwKUUyeym_iDD92_NDgmVYLIyW0qUkzv4Pqvwj4h1JvTWTAdJhW0z4L_csDg9-8SQycJ-warJohFpT6mELj6YYQHeDly8iFGh_KQM-4i5c/s113/IMG_20190813_201405_301.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDrIGD-uXbrnLNJfOCSxjnsfRMii7METftZavIIs1Wkk5thRd7VTNV25CJYTzX_q-ASz1sdawDmt_NFG9owmwMGawsT7yIh9YllbgX-jYJ7gj7QLNc-n-IqpgZcEt0UDoeU7fUy9Kb5BZ/s72-w400-h221-c/Sql-Database-Query-writing-what-is-sql.png" height="72" width="72"/><thr:total>4</thr:total></entry></feed>