<?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-7332461235075335417</id><updated>2026-04-25T15:42:33.458+05:30</updated><category term="Numbers"/><category term="pattern"/><category term="string"/><category term="series"/><category term="array"/><category term="recursion"/><category term="c/c++/java/python practice question and ans"/><category term="Sql queries"/><category term="SQL"/><category term="2d Array"/><category term="Matrix"/><category term="Cracking the coding interview"/><category term="convert"/><category term="function"/><category term="company question"/><category term="sort"/><category term="bit manipulation"/><category term="Android Project"/><category term="Artical"/><category term="search"/><title type='text'>Programming Practice</title><subtitle type='html'> Free Online Information, Programming  practice provides online coding practice like c programming problems exercises, programming problems and solutions in c++,  programming problems and solutions in java, programming problems and solutions in python,  core java, RDBMS SQL queries, SQL qeries , etc. for beginners and professionals</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.csinfo360.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default?max-results=20&amp;redirect=false'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default?start-index=21&amp;max-results=20&amp;redirect=false'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>518</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>20</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3088940125726591793</id><published>2024-09-03T23:29:00.000+05:30</published><updated>2024-09-03T23:29:17.037+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Performance Tuning: Query Profiling and Query Cache Optimization</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Performance tuning&lt;/strong&gt;&amp;nbsp;in database systems is essential to ensure efficient data retrieval, minimize query execution time, and handle growing datasets. Two key areas of performance tuning are&amp;nbsp;&lt;strong&gt;Query Profiling and Analysis&lt;/strong&gt;, which help identify bottlenecks in query execution, and&amp;nbsp;&lt;strong&gt;Query Cache Optimization&lt;/strong&gt;, which reduces the need to re-execute frequently run queries by caching results.&lt;/p&gt;&lt;h2&gt;Query Profiling and Analysis&lt;/h2&gt;&lt;h3&gt;1. Query Profiling Tools&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Profiling queries helps understand how the database engine processes queries, identifies inefficient operations, and reveals performance bottlenecks. Most databases provide tools to analyze query execution plans.&lt;/p&gt;&lt;h4&gt;MySQL Example: EXPLAIN&lt;/h4&gt;&lt;p&gt;The &lt;code&gt;EXPLAIN&lt;/code&gt; statement shows the execution plan for a query, providing insight into how the database executes it and whether indexes are being used efficiently.&lt;/p&gt;&lt;h5&gt;Example:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;EXPLAIN &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h5&gt;Key Output:&lt;/h5&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;id&lt;/strong&gt;: Order of query execution steps.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;select_type&lt;/strong&gt;: Type of query (e.g., simple, subquery).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;table&lt;/strong&gt;: The table being accessed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;type&lt;/strong&gt;: Type of access (&lt;code&gt;ALL&lt;/code&gt;, &lt;code&gt;index&lt;/code&gt;, &lt;code&gt;range&lt;/code&gt;), with &lt;code&gt;ALL&lt;/code&gt; indicating a full table scan, which is inefficient.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;possible_keys&lt;/strong&gt;: Which indexes are considered for the query.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;key&lt;/strong&gt;: The index actually used.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;rows&lt;/strong&gt;: Estimated number of rows scanned by the query.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;extra&lt;/strong&gt;: Additional info like sorting or temporary tables.&lt;/li&gt;&lt;/ul&gt;&lt;h5&gt;Sample Output:&lt;/h5&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;id&lt;/th&gt;&lt;th&gt;select_type&lt;/th&gt;&lt;th&gt;table&lt;/th&gt;&lt;th&gt;type&lt;/th&gt;&lt;th&gt;possible_keys&lt;/th&gt;&lt;th&gt;key&lt;/th&gt;&lt;th&gt;rows&lt;/th&gt;&lt;th&gt;extra&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;SIMPLE&lt;/td&gt;&lt;td&gt;orders&lt;/td&gt;&lt;td&gt;ref&lt;/td&gt;&lt;td&gt;customer_id&lt;/td&gt;&lt;td&gt;cust_id&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;Using index&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;strong&gt;Optimization Tip&lt;/strong&gt;: If &lt;code&gt;type = ALL&lt;/code&gt; indicates a full table scan, ensure an index exists for &lt;code&gt;customer_id&lt;/code&gt;. If not, create one to improve query performance:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_customer_id &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders(customer_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;PostgreSQL Example: EXPLAIN ANALYZE&lt;/h4&gt;&lt;p&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; executes the query and provides detailed runtime statistics, including actual execution time and number of rows processed.&lt;/p&gt;&lt;h5&gt;Example:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;EXPLAIN ANALYZE &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h5&gt;Output Breakdown:&lt;/h5&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Execution Time&lt;/strong&gt;: The time taken to execute the query.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Rows&lt;/strong&gt;: The number of rows processed at each step.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Seq Scan&lt;/strong&gt;: Indicates a full table scan (sequential scan) if no index is used.&lt;/li&gt;&lt;/ul&gt;&lt;h5&gt;Sample Output:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Seq Scan on orders  (cost=0.00..431.00 rows=100 width=104)
  Filter: (customer_id = 100)
  Rows Removed by Filter: 4300
Planning Time: 0.123 ms
Execution Time: 12.345 ms
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Optimization Tip&lt;/strong&gt;: If a &lt;code&gt;Seq Scan&lt;/code&gt; is detected, adding an index can optimize the query by using an index scan instead.&lt;/p&gt;&lt;h3&gt;2. Identifying Performance Bottlenecks&lt;/h3&gt;&lt;p&gt;Common query performance bottlenecks include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Full Table Scans&lt;/strong&gt;: Indicated by &lt;code&gt;ALL&lt;/code&gt; or &lt;code&gt;Seq Scan&lt;/code&gt;, which occurs when the database scans the entire table.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Add or improve indexes.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Too Many Rows Accessed&lt;/strong&gt;: When queries scan more rows than necessary.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Use more specific filters (e.g., &lt;code&gt;WHERE&lt;/code&gt; clauses) and ensure proper indexing.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Suboptimal Joins&lt;/strong&gt;: Large tables with inefficient joins can degrade performance.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Create indexes on join columns and analyze join strategies (e.g., switch from &lt;strong&gt;NESTED LOOPS&lt;/strong&gt; to &lt;strong&gt;HASH JOIN&lt;/strong&gt; if appropriate).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Expensive Sorts&lt;/strong&gt;: Queries with &lt;code&gt;ORDER BY&lt;/code&gt; clauses can become slow if no index supports the sorting.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Create indexes on columns often used in &lt;code&gt;ORDER BY&lt;/code&gt; clauses.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Query Rewriting for Optimization&lt;/h3&gt;&lt;p&gt;Simple query rewriting can often yield significant performance improvements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid &lt;code&gt;SELECT *&lt;/code&gt;&lt;/strong&gt;: Instead of selecting all columns, specify only the necessary columns to reduce I/O.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Before&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; first_name, last_name &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;5&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use &lt;code&gt;EXISTS&lt;/code&gt; Instead of &lt;code&gt;IN&lt;/code&gt;&lt;/strong&gt;: &lt;code&gt;EXISTS&lt;/code&gt; can be more efficient than &lt;code&gt;IN&lt;/code&gt; for subqueries.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Before&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-keyword&quot;&gt;IN&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; customer_id &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EXISTS&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; orders.customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; customers.customer_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Query Cache Optimization&lt;/h2&gt;&lt;h3&gt;1. How Query Cache Works&lt;/h3&gt;&lt;p&gt;Query caching stores the result of a query in memory, allowing the database to retrieve cached results when identical queries are run again, without re-executing the query.&lt;/p&gt;&lt;h4&gt;Example in MySQL:&lt;/h4&gt;&lt;p&gt;To enable and configure the query cache:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;SET GLOBAL query_cache_size = 268435456;  -- Set cache size (256 MB)
SET GLOBAL query_cache_type = ON;         -- Enable query cache
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;To check the status of the cache:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SHOW&lt;/span&gt; VARIABLES &lt;span class=&quot;hljs-keyword&quot;&gt;LIKE&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;query_cache%&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;To clear the cache:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;RESET QUERY CACHE;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;2. Optimizing Query Cache Usage&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query Consistency&lt;/strong&gt;: The cache only works if the query is identical, including spacing and case sensitivity. Use parameterized queries to ensure consistency.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Before (Not Cached)&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;After (Consistent Query for Caching)&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; ?;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Cache Frequently Run Queries&lt;/strong&gt;: Focus on caching queries that are executed frequently, such as those used in reports or dashboards. Avoid caching queries on highly dynamic data, as frequent changes will invalidate the cache.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Partition Cache by Complexity&lt;/strong&gt;: Cache complex queries involving multiple joins, subqueries, or aggregations. Simple queries may not benefit as much from caching.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Limitations of Query Caching&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Invalidation&lt;/strong&gt;: If the data changes (via &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, or &lt;code&gt;DELETE&lt;/code&gt;), the cache is invalidated, requiring the database to re-execute the query.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cache Size&lt;/strong&gt;: Large caches can consume significant memory. Ensure proper sizing to avoid overuse of resources.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. Query Cache in Other Databases&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;: PostgreSQL doesn&#39;t have built-in query caching but relies on the OS for caching disk I/O and internal optimizations like prepared statements.&lt;/p&gt;&lt;p&gt;Tools like &lt;strong&gt;PgBouncer&lt;/strong&gt; or &lt;strong&gt;Redis&lt;/strong&gt; can provide external query caching in PostgreSQL.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;SQL Server&lt;/strong&gt;: Automatically caches query execution plans and results. It reuses execution plans to reduce re-compilation overhead.&lt;/p&gt;&lt;p&gt;To view cache details:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; sys.dm_exec_cached_plans;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Query Profiling and Analysis&lt;/strong&gt;: Tools like &lt;code&gt;EXPLAIN&lt;/code&gt; and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; help identify performance issues like full table scans, slow joins, and sorting inefficiencies. By optimizing these queries, you can improve query execution speed.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Query Cache Optimization&lt;/strong&gt;: Caching frequently executed queries reduces the load on the database by avoiding re-execution. However, it&#39;s important to configure caching carefully, as highly dynamic data can invalidate the cache frequently.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Combining &lt;strong&gt;query profiling&lt;/strong&gt; with &lt;strong&gt;cache optimization&lt;/strong&gt; leads to significant performance improvements, reduced server load, and faster query response times.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3088940125726591793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/performance-tuning-query-profiling-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3088940125726591793'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3088940125726591793'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/performance-tuning-query-profiling-and.html' title='Performance Tuning: Query Profiling and Query Cache Optimization'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-7556580664160611929</id><published>2024-09-03T23:18:00.002+05:30</published><updated>2024-09-03T23:18:57.913+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Database Transactions: Savepoints, Nested Transactions, and Two-Phase Commit</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Database transactions&lt;/strong&gt;&amp;nbsp;are essential for maintaining&amp;nbsp;&lt;strong&gt;data consistency&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;integrity&lt;/strong&gt;, especially when multiple operations must be treated as a single unit. A transaction ensures that a series of operations either complete successfully or not at all, safeguarding data against failures. Advanced transaction management concepts like&amp;nbsp;&lt;strong&gt;Savepoints&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Nested Transactions&lt;/strong&gt;, and the&amp;nbsp;&lt;strong&gt;Two-Phase Commit Protocol (2PC)&lt;/strong&gt;&amp;nbsp;offer more granular control, particularly in complex, distributed database systems.&lt;/p&gt;&lt;h2&gt;Savepoints and Nested Transactions&lt;/h2&gt;&lt;h3&gt;1. Savepoints&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Savepoint&lt;/strong&gt; is a marker set within a transaction that allows you to partially roll back the transaction to a specific point. This is useful for complex transactions where only certain operations need to be undone without affecting the entire transaction.&lt;/p&gt;&lt;h4&gt;Key Features:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Partial Rollback&lt;/strong&gt;: Allows undoing operations after a savepoint without discarding the entire transaction.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Resuming Transactions&lt;/strong&gt;: After rolling back to a savepoint, you can continue executing other operations.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Multiple Savepoints&lt;/strong&gt;: You can define multiple savepoints within a single transaction, giving you control over different stages of the transaction.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Syntax for Savepoints&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;MySQL/PostgreSQL Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;  &lt;span class=&quot;hljs-comment&quot;&gt;-- Start the transaction&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot;&gt;SAVEPOINT&lt;/span&gt; sp1;  &lt;span class=&quot;hljs-comment&quot;&gt;-- Define a savepoint&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; accounts (account_id, balance) &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (&lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;1000&lt;/span&gt;);

&lt;span class=&quot;hljs-keyword&quot;&gt;SAVEPOINT&lt;/span&gt; sp2;  &lt;span class=&quot;hljs-comment&quot;&gt;-- Define another savepoint&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;

&lt;span class=&quot;hljs-comment&quot;&gt;-- Something went wrong, roll back to the first savepoint&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ROLLBACK&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;SAVEPOINT&lt;/span&gt; sp1;

&lt;span class=&quot;hljs-comment&quot;&gt;-- Transaction can still continue&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;

&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;  &lt;span class=&quot;hljs-comment&quot;&gt;-- Commit the transaction&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;Benefits of Savepoints:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Error Recovery&lt;/strong&gt;: If an error occurs, you can roll back part of the transaction to a specific savepoint, minimizing data loss.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Flexibility for Long Transactions&lt;/strong&gt;: For long, complex transactions, savepoints provide flexibility by allowing partial rollbacks and avoiding the need to restart the entire transaction.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Nested Transactions&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Nested Transactions&lt;/strong&gt; allow breaking a large transaction into smaller sub-transactions, each of which can be committed or rolled back independently. Nested transactions are useful for handling complex workflows where different parts of a transaction need to be treated independently.&lt;/p&gt;&lt;h4&gt;How Nested Transactions Work:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Sub-Transaction Independence&lt;/strong&gt;: Each sub-transaction behaves like a regular transaction and can commit or roll back individually.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Outer Transaction Control&lt;/strong&gt;: If the outer (main) transaction rolls back, all nested transactions are also rolled back, even if they were previously committed.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;: Useful for complex business logic where different segments of a transaction need to be isolated from each other.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Example (Systems Supporting Nested Transactions):&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;

&lt;span class=&quot;hljs-comment&quot;&gt;-- Outer transaction&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; users (user_id, name) &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (&lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot;&gt;&#39;John&#39;&lt;/span&gt;);

&lt;span class=&quot;hljs-comment&quot;&gt;-- Begin nested transaction&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; accounts (account_id, balance) &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (&lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;500&lt;/span&gt;);
&lt;span class=&quot;hljs-comment&quot;&gt;-- Commit nested transaction&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;

&lt;span class=&quot;hljs-comment&quot;&gt;-- Rollback the outer transaction (rolls back everything)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ROLLBACK&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;Support for Nested Transactions:&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;: Does not fully support nested transactions but offers &lt;strong&gt;savepoints&lt;/strong&gt;, which provide similar functionality.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SQL Server&lt;/strong&gt;: Supports true nested transactions.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Two-Phase Commit Protocol (2PC)&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The &lt;strong&gt;Two-Phase Commit (2PC) Protocol&lt;/strong&gt; is a distributed transaction protocol used to ensure consistency across multiple databases in a distributed system. It guarantees that all databases either commit the transaction or roll back if a failure occurs, ensuring data consistency across distributed systems.&lt;/p&gt;&lt;h3&gt;1. Two Phases of the 2PC Protocol&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Phase 1: Prepare Phase (Voting Phase)&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The &lt;strong&gt;Coordinator&lt;/strong&gt; asks all participating databases to prepare for a commit.&lt;/li&gt;&lt;li&gt;Each participant must vote either:&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Commit&lt;/strong&gt;: Ready to commit the transaction.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Abort&lt;/strong&gt;: Unable to commit due to an error.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Phase 2: Commit Phase (Execution Phase)&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;If all participants vote to commit, the coordinator sends a &lt;strong&gt;commit&lt;/strong&gt; message, and each participant commits the transaction.&lt;/li&gt;&lt;li&gt;If any participant votes to abort, the coordinator sends a &lt;strong&gt;rollback&lt;/strong&gt; message, and all participants roll back the transaction.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2PC Protocol Flow&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Coordinator          Participant 1          Participant 2
     |                        |                      |
     |--- Prepare ------------&amp;gt;|--- Prepare ---------&amp;gt;|
     |                        |                      |
     |&amp;lt;-- Vote Commit/Abort ---|&amp;lt;-- Vote Commit/Abort-|
     |                        |                      |
     |--- Commit/Rollback ----&amp;gt;|--- Commit/Rollback --&amp;gt;|
     |                        |                      |
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;2. Example of Two-Phase Commit&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Consider a scenario where money is being transferred from an account in &lt;strong&gt;Database A&lt;/strong&gt; to an account in &lt;strong&gt;Database B&lt;/strong&gt;. To ensure both databases either commit or roll back the transaction, the &lt;strong&gt;Two-Phase Commit Protocol&lt;/strong&gt; is used.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Phase 1&lt;/strong&gt;: The coordinator sends a &lt;strong&gt;prepare&lt;/strong&gt; message to both databases. Each database responds with &lt;strong&gt;vote commit&lt;/strong&gt; if it can successfully commit.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Phase 2&lt;/strong&gt;: If both databases vote to commit, the coordinator sends a &lt;strong&gt;commit&lt;/strong&gt; message. If either database votes to abort, the coordinator sends a &lt;strong&gt;rollback&lt;/strong&gt; message to ensure consistency.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Advantages of Two-Phase Commit&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Data Consistency Across Distributed Systems&lt;/strong&gt;: Ensures that all participating databases either commit or rollback the transaction together, maintaining consistency.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fault Tolerance&lt;/strong&gt;: If a participant is unable to commit, the entire transaction is aborted, avoiding partial commits that could lead to inconsistencies.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. Disadvantages of Two-Phase Commit&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Blocking&lt;/strong&gt;: If the coordinator fails after sending the prepare message, participants may remain in a waiting state, leading to blocking.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Slow Performance&lt;/strong&gt;: The protocol introduces delays due to multiple communication steps between the coordinator and participants.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single Point of Failure&lt;/strong&gt;: The coordinator is critical to the process. If it fails, the entire transaction may be in limbo.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Use Cases for Savepoints, Nested Transactions, and Two-Phase Commit&lt;/h2&gt;&lt;h3&gt;Savepoints Example&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;In an &lt;strong&gt;e-commerce checkout process&lt;/strong&gt;, where multiple items are added to an order, savepoints can be used to handle stock issues. If one item is out of stock, a savepoint allows rolling back only that item without canceling the entire order process.&lt;/p&gt;&lt;h3&gt;Nested Transactions Example&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;In &lt;strong&gt;financial applications&lt;/strong&gt;, where you need to handle separate debits and credits as part of a larger transaction, nested transactions can be useful. Each operation can be committed or rolled back independently, but if the outer transaction fails, all operations are rolled back.&lt;/p&gt;&lt;h3&gt;Two-Phase Commit Example&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;In a &lt;strong&gt;cross-bank money transfer&lt;/strong&gt;, 2PC ensures that funds are transferred from &lt;strong&gt;Bank A&lt;/strong&gt; to &lt;strong&gt;Bank B&lt;/strong&gt; consistently. Either both banks commit the transaction (deducting from one bank and adding to the other), or the entire transaction is rolled back.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Savepoints&lt;/strong&gt; provide fine-grained control within a transaction, allowing for partial rollbacks without affecting the entire transaction.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Nested Transactions&lt;/strong&gt; offer more granular control over transaction management by allowing sub-transactions, though support for them varies across databases.&lt;/li&gt;&lt;li&gt;The &lt;strong&gt;Two-Phase Commit Protocol&lt;/strong&gt; is crucial for ensuring consistency in distributed systems, making sure that all databases involved in a transaction either commit or rollback in unison.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By mastering these advanced transaction management techniques, you can ensure data integrity, prevent data inconsistencies, and manage complex, distributed database systems with confidence.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/7556580664160611929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/database-transactions-savepoints-nested.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/7556580664160611929'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/7556580664160611929'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/database-transactions-savepoints-nested.html' title='Database Transactions: Savepoints, Nested Transactions, and Two-Phase Commit'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-8702203649074622861</id><published>2024-09-03T20:27:00.001+05:30</published><updated>2024-09-03T20:27:19.749+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Advanced Indexing in SQL: Composite and Covering Indexes</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Indexing is one of the most effective techniques for improving database performance, as it speeds up data retrieval by allowing the database to locate rows more efficiently. While basic single-column indexes are common, advanced techniques like&amp;nbsp;&lt;strong&gt;Composite Indexes&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Covering Indexes&lt;/strong&gt;&amp;nbsp;take optimization to the next level, especially when dealing with complex queries that involve filtering, sorting, and joining across multiple columns.&lt;/p&gt;&lt;h2&gt;Composite Indexes&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Composite Index&lt;/strong&gt;, also known as a multi-column index, is an index that includes more than one column. It can significantly enhance query performance when queries frequently filter or sort based on multiple columns.&lt;/p&gt;&lt;h3&gt;1. Key Features of Composite Indexes&lt;/h3&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Multi-Column Search Optimization&lt;/strong&gt;: Composite indexes allow efficient searching across multiple columns, improving query performance when you need to filter or sort by more than one field.&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Column Order Matters&lt;/strong&gt;: The order of columns in a composite index is critical. The index will only be used when the query matches the indexed columns in the correct order.&lt;/li&gt;&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Leftmost Prefix Rule&lt;/strong&gt;: A composite index can be used for queries that reference the leftmost column(s) in the index. For example, if a composite index is created on &lt;code&gt;(A, B, C)&lt;/code&gt;, it can be used by queries referencing:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Column A&lt;/li&gt;&lt;li&gt;Columns A and B&lt;/li&gt;&lt;li&gt;Columns A, B, and C&lt;br /&gt;However, a query that only references &lt;strong&gt;B and C&lt;/strong&gt; won’t use the index.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Creating a Composite Index&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
To create a composite index that includes &lt;code&gt;last_name&lt;/code&gt;, &lt;code&gt;first_name&lt;/code&gt;, and &lt;code&gt;city&lt;/code&gt; for a &lt;code&gt;customers&lt;/code&gt; table:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_customer_name_city &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customers(last_name, first_name, city);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This index is useful for queries that filter or sort based on these three columns in order.&lt;/p&gt;&lt;h3&gt;3. Using Composite Indexes in Queries&lt;/h3&gt;&lt;h4&gt;Example Query:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; last_name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Smith&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;AND&lt;/span&gt; first_name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;John&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; city;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this query, the composite index on &lt;code&gt;(last_name, first_name, city)&lt;/code&gt; will be fully utilized because the query matches the leftmost columns of the index and includes sorting based on &lt;code&gt;city&lt;/code&gt;.&lt;/p&gt;&lt;h3&gt;4. Performance Considerations&lt;/h3&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Index Size&lt;/strong&gt;: Composite indexes include multiple columns, which can increase the size of the index and slow down write operations such as &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt;.&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Selective Columns&lt;/strong&gt;: Place the most selective column first in the index. The more selective a column (i.e., the more it reduces the number of rows returned), the greater the performance benefit. For instance, if &lt;code&gt;last_name&lt;/code&gt; is more selective than &lt;code&gt;city&lt;/code&gt;, create the index as &lt;code&gt;(last_name, city)&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Covering Indexes&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Covering Index&lt;/strong&gt; is an index that includes all the columns required by a query, allowing the database to satisfy the query using only the index. This eliminates the need to access the actual table (a table scan), significantly speeding up query execution.&lt;/p&gt;&lt;h3&gt;1. Key Features of Covering Indexes&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;All Columns in the Query&lt;/strong&gt;: A covering index contains all the columns that appear in the &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;WHERE&lt;/code&gt;, &lt;code&gt;JOIN&lt;/code&gt;, and &lt;code&gt;ORDER BY&lt;/code&gt; clauses of a query.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Eliminates Table Access&lt;/strong&gt;: Since all required data can be fetched directly from the index, the database avoids table lookups, improving performance.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Read-Heavy Optimization&lt;/strong&gt;: Covering indexes are particularly useful in read-heavy applications where frequent queries can benefit from avoiding full table scans.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Creating a Covering Index&lt;/h3&gt;&lt;h4&gt;Example Query:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; customer_id, last_name, first_name 
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; last_name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Smith&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; first_name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;To optimize this query, you can create a covering index that includes all the columns involved:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_covering_customers &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customers(last_name, first_name, customer_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;WHERE&lt;/strong&gt; clause: The covering index includes &lt;code&gt;last_name&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ORDER BY&lt;/strong&gt; clause: It includes &lt;code&gt;first_name&lt;/code&gt; for sorting.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SELECT&lt;/strong&gt; clause: The index also includes &lt;code&gt;customer_id&lt;/code&gt;, &lt;code&gt;first_name&lt;/code&gt;, and &lt;code&gt;last_name&lt;/code&gt;, allowing the query to be satisfied without scanning the main table.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Performance Considerations&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Reduces I/O&lt;/strong&gt;: By eliminating the need for additional table lookups, covering indexes improve query speed, especially for read-heavy operations.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Index Size&lt;/strong&gt;: Covering indexes can grow large due to the inclusion of multiple columns, consuming more memory and disk space.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Frequent Query Optimization&lt;/strong&gt;: Use covering indexes for queries that are frequently run and have high read workloads. For queries that run infrequently, the benefits may not outweigh the increased index size and maintenance costs.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Key Differences Between Composite Indexes and Covering Indexes&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;6&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW115754399 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoTableGrid&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW115754399 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{96}&quot; paraid=&quot;675608502&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Aspect&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW115754399 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{105}&quot; paraid=&quot;2129312757&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Composite Index&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW115754399 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{114}&quot; paraid=&quot;118628744&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Covering Index&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{123}&quot; paraid=&quot;986751605&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Purpose&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{132}&quot; paraid=&quot;1056970256&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Optimizes queries that filter or sort on multiple columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{141}&quot; paraid=&quot;2009644362&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Fully satisfies queries by including all needed columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{150}&quot; paraid=&quot;582203444&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Column Involvement&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{159}&quot; paraid=&quot;623387511&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Includes multiple columns, but not necessarily all query columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{168}&quot; paraid=&quot;2075012823&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Includes all columns in the query (SELECT, &lt;/span&gt;&lt;span class=&quot;NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlContextualSpellingAndGrammarErrorV2,url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjMiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMzVGIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxwYXRoIGQ9Ik0wIC41aDVNMCAyLjVoNSIvPjwvZz48L3N2Zz4=&amp;quot;)); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;, ORDER BY)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{177}&quot; paraid=&quot;1493277612&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Performance Benefit&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{186}&quot; paraid=&quot;2063351592&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Improves query performance by narrowing result sets&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{195}&quot; paraid=&quot;540564246&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Eliminates the need for table access (avoids table scans)&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{204}&quot; paraid=&quot;699280628&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Index Size&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{213}&quot; paraid=&quot;1210093948&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Size depends on the number of columns indexed&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{222}&quot; paraid=&quot;664688774&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlContextualSpellingAndGrammarErrorV2,url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjMiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMzVGIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjxwYXRoIGQ9Ik0wIC41aDVNMCAyLjVoNSIvPjwvZz48L3N2Zz4=&amp;quot;)); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Typically&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; larger as it covers all query columns&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW115754399 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 42px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 114px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{231}&quot; paraid=&quot;324754113&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Use Case&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 211px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{240}&quot; paraid=&quot;343809291&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Queries filtering on multiple columns, especially with leftmost prefix&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW115754399 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 245px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW115754399 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW115754399 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{dc614cec-5e3c-4ca2-ad5f-f7e7eb6fe14f}{249}&quot; paraid=&quot;131606046&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW115754399 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Read-heavy queries where the index can fully satisfy the query&lt;/span&gt;&lt;span class=&quot;EOP SCXW115754399 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Practical Example: Combining Composite and Covering Indexes&lt;/h2&gt;&lt;p&gt;Imagine an e-commerce application with a query that lists orders for customers, filtering by customer name and sorting by order date:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; customer_id, order_date, total_amount 
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;John Doe&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; order_date &lt;span class=&quot;hljs-keyword&quot;&gt;DESC&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;Step 1: Create a Composite Index&lt;/h3&gt;&lt;p&gt;A composite index on &lt;code&gt;customer_name&lt;/code&gt; and &lt;code&gt;order_date&lt;/code&gt; will optimize filtering and sorting:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_orders_name_date &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders(customer_name, order_date);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;Step 2: Optimize Further with a Covering Index&lt;/h3&gt;&lt;p&gt;To further optimize, create a covering index that includes all columns needed by the query:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_covering_orders &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders(customer_name, order_date, customer_id, total_amount);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;With this covering index, the query will be fully satisfied by the index alone, without needing to scan the &lt;code&gt;orders&lt;/code&gt; table.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Composite Indexes&lt;/strong&gt;: These are ideal for optimizing queries that filter or sort on multiple columns. The order of columns in the index matters, and the index can only be used if the query matches the columns in the same order.&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Covering Indexes&lt;/strong&gt;: These indexes fully satisfy queries by including all necessary columns, eliminating the need for table scans. This makes them ideal for read-heavy applications with frequent queries.&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Performance Benefits&lt;/strong&gt;: By using the right combination of &lt;strong&gt;Composite&lt;/strong&gt; and &lt;strong&gt;Covering Indexes&lt;/strong&gt;, you can significantly boost query performance, reduce table scans, and enhance the overall efficiency of your database, especially in applications with complex queries and large datasets.&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/8702203649074622861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/advanced-indexing-in-sql-Covering-Indexes-composite-.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/8702203649074622861'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/8702203649074622861'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/advanced-indexing-in-sql-Covering-Indexes-composite-.html' title='Advanced Indexing in SQL: Composite and Covering Indexes'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-5886319950067346782</id><published>2024-09-03T20:07:00.000+05:30</published><updated>2024-09-03T20:07:09.608+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Database Design: ER Diagrams and Normalization Techniques</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Database design&lt;/strong&gt;&amp;nbsp;plays a crucial role in ensuring that data is stored efficiently, consistently, and reliably. A well-designed database minimizes redundancy, improves data integrity, and enhances performance. Two fundamental components of database design are&amp;nbsp;&lt;strong&gt;Entity-Relationship Diagrams (ERDs)&lt;/strong&gt;, which visualize the structure of the database, and&amp;nbsp;&lt;strong&gt;Normalization Techniques&lt;/strong&gt;, which optimize the organization of data to avoid duplication and ensure data consistency.&lt;/p&gt;&lt;div class=&quot;min-h-[20px] text-message flex w-full flex-col items-end gap-2 break-words [.text-message+&amp;amp;]:mt-5 overflow-x-auto whitespace-normal&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;946a06dd-30bc-4bf9-940d-9132d7acba63&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[3px]&quot;&gt;&lt;div class=&quot;markdown prose w-full break-words dark:prose-invert light&quot;&gt;&lt;h2&gt;Entity-Relationship Diagrams (ERDs)&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Entity-Relationship Diagrams (ERDs)&lt;/strong&gt; are graphical representations that illustrate how entities (tables) in a database relate to each other. They help database designers visualize the logical structure of the database and understand the relationships between data points.&lt;/p&gt;&lt;h3&gt;1. Components of ERDs&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Entities&lt;/strong&gt;: Represent database tables, usually corresponding to real-world objects, such as Customers, Orders, or Products. Each entity has attributes that correspond to the columns of a table.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Attributes&lt;/strong&gt;: Characteristics or properties of an entity. For example, the &lt;code&gt;Customers&lt;/code&gt; entity might have attributes like &lt;code&gt;customer_id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, and &lt;code&gt;email&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Primary Key (PK)&lt;/strong&gt;: A unique identifier for each entity, such as &lt;code&gt;customer_id&lt;/code&gt; in the &lt;code&gt;Customers&lt;/code&gt; table.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Foreign Key (FK)&lt;/strong&gt;: A field in one table that links to the primary key in another table, establishing a relationship. For example, &lt;code&gt;customer_id&lt;/code&gt; in the &lt;code&gt;Orders&lt;/code&gt; table links each order to a specific customer in the &lt;code&gt;Customers&lt;/code&gt; table.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Relationships&lt;/strong&gt;: Define how entities are related:&lt;ul&gt;&lt;li&gt;&lt;strong&gt;One-to-One (1:1)&lt;/strong&gt;: Each row in one entity corresponds to exactly one row in another entity.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;One-to-Many (1&lt;div&gt;&lt;/div&gt;)&lt;/strong&gt;: A row in one entity can correspond to many rows in another entity (e.g., one customer can place multiple orders).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Many-to-Many (N&lt;div&gt;&lt;/div&gt;)&lt;/strong&gt;: Each row in one entity can relate to multiple rows in another, often resolved using a junction table.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. ERD Symbols and Notation&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Rectangles&lt;/strong&gt;: Represent entities (tables).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Ellipses&lt;/strong&gt;: Represent attributes (columns).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Diamonds&lt;/strong&gt;: Represent relationships between entities.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Lines&lt;/strong&gt;: Connect entities and indicate relationships, often with symbols to indicate one-to-one, one-to-many, or many-to-many relationships.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Example ERD&lt;/h3&gt;&lt;p&gt;Consider an ERD for a simple e-commerce system with &lt;code&gt;Customers&lt;/code&gt;, &lt;code&gt;Orders&lt;/code&gt;, and &lt;code&gt;Products&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;+------------------+     +------------------+      +------------------+
|   Customers      |     |   Orders         |      |   Products        |
|------------------|     |------------------|      |------------------|
| customer_id (PK) |&amp;lt;----| order_id (PK)    |      | product_id (PK)   |
| name             |     | customer_id (FK) |-----&amp;gt;| name              |
| email            |     | order_date       |      | price             |
+------------------+     +------------------+      +------------------+
                           |
                           |
                           v
                      +---------------------+
                      |   OrderDetails      |
                      |---------------------|
                      | order_id (FK)       |
                      | product_id (FK)     |
                      | quantity            |
                      +---------------------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Customers and Orders&lt;/strong&gt;: One customer can place many orders (1&lt;div&gt;&lt;/div&gt;relationship).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Orders and Products&lt;/strong&gt;: There&#39;s a many-to-many relationship between &lt;code&gt;Orders&lt;/code&gt; and &lt;code&gt;Products&lt;/code&gt;, resolved through the &lt;code&gt;OrderDetails&lt;/code&gt; table, which records the products in each order.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. Benefits of ERDs&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Clear Visualization&lt;/strong&gt;: ERDs provide a visual structure of the database, making it easier to understand relationships between tables.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Effective Communication&lt;/strong&gt;: ERDs serve as a communication tool between database designers, developers, and stakeholders.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Logical Data Flow&lt;/strong&gt;: ERDs help ensure that data flows logically between related entities, supporting efficient query design and data retrieval.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Normalization Techniques&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Normalization&lt;/strong&gt; is a process used to organize the data in a database by dividing it into smaller, logically related tables. It aims to minimize redundancy, avoid anomalies, and improve the integrity of the data.&lt;/p&gt;&lt;h3&gt;1. Key Normalization Forms&lt;/h3&gt;&lt;p&gt;The normalization process follows a series of steps, known as &lt;strong&gt;Normal Forms&lt;/strong&gt; (NF), each addressing a specific type of redundancy or anomaly.&lt;/p&gt;&lt;h4&gt;First Normal Form (1NF)&lt;/h4&gt;&lt;p&gt;A table is in &lt;strong&gt;1NF&lt;/strong&gt; if it contains only atomic values, meaning no repeating groups or arrays within a column. Each cell must contain a single value.&lt;/p&gt;&lt;h5&gt;Example of a violation of 1NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;+------------+-----------+-----------------------+
| customer_id| name      | orders                |
+------------+-----------+-----------------------+
| 1          | Alice     | Order1, Order2        |
| 2          | Bob       | Order3                |
+------------+-----------+-----------------------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h5&gt;Corrected to 1NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;+------------+-----------+---------+
| customer_id| name      | order   |
+------------+-----------+---------+
| 1          | Alice     | Order1  |
| 1          | Alice     | Order2  |
| 2          | Bob       | Order3  |
+------------+-----------+---------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Each order now has its own row, ensuring that all values are atomic.&lt;/p&gt;&lt;h4&gt;Second Normal Form (2NF)&lt;/h4&gt;&lt;p&gt;A table is in &lt;strong&gt;2NF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It is in 1NF.&lt;/li&gt;&lt;li&gt;All non-primary key columns are fully dependent on the primary key (no partial dependencies).&lt;/li&gt;&lt;/ul&gt;&lt;h5&gt;Example of a violation of 2NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;+------------+-----------+---------+--------------+
| order_id   | product_id| quantity| product_name |
+------------+-----------+---------+--------------+
| 1          | 101       | 2       | Laptop       |
| 2          | 102       | 1       | Phone        |
+------------+-----------+---------+--------------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, &lt;code&gt;product_name&lt;/code&gt; depends on &lt;code&gt;product_id&lt;/code&gt;, not &lt;code&gt;order_id&lt;/code&gt;, causing a partial dependency.&lt;/p&gt;&lt;h5&gt;Corrected to 2NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Orders Table:
+------------+-----------+---------+
| order_id   | product_id| quantity|
+------------+-----------+---------+
| 1          | 101       | 2       |
| 2          | 102       | 1       |
+------------+-----------+---------+

Products Table:
+-----------+--------------+
| product_id| product_name  |
+-----------+--------------+
| 101       | Laptop        |
| 102       | Phone         |
+-----------+--------------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;Products&lt;/code&gt; table separates product information, eliminating partial dependency.&lt;/p&gt;&lt;h4&gt;Third Normal Form (3NF)&lt;/h4&gt;&lt;p&gt;A table is in &lt;strong&gt;3NF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It is in 2NF.&lt;/li&gt;&lt;li&gt;There are no transitive dependencies (non-key columns depend only on the primary key).&lt;/li&gt;&lt;/ul&gt;&lt;h5&gt;Example of a violation of 3NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;+------------+-----------+---------+---------------+
| order_id   | customer_id| city    | customer_name |
+------------+-----------+---------+---------------+
| 1          | 101       | New York| Alice         |
| 2          | 102       | Paris   | Bob           |
+------------+-----------+---------+---------------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, &lt;code&gt;city&lt;/code&gt; depends on &lt;code&gt;customer_id&lt;/code&gt;, not &lt;code&gt;order_id&lt;/code&gt;, causing a transitive dependency.&lt;/p&gt;&lt;h5&gt;Corrected to 3NF:&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Orders Table:
+------------+-----------+
| order_id   | customer_id|
+------------+-----------+
| 1          | 101       |
| 2          | 102       |
+------------+-----------+

Customers Table:
+------------+--------------+--------+
| customer_id| customer_name| city   |
+------------+--------------+--------+
| 101        | Alice        | New York|
| 102        | Bob          | Paris  |
+------------+--------------+--------+
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;Customers&lt;/code&gt; table now holds the customer information, eliminating transitive dependency.&lt;/p&gt;&lt;h4&gt;Boyce-Codd Normal Form (BCNF)&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;BCNF&lt;/strong&gt; is an extension of 3NF that ensures for every functional dependency X -&amp;gt; Y, X must be a superkey (a unique identifier). BCNF resolves more complex cases that 3NF may not handle.&lt;/p&gt;&lt;h3&gt;2. Benefits of Normalization&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Reduced Data Redundancy&lt;/strong&gt;: By breaking down large tables into smaller, more focused tables, normalization reduces data duplication.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Improved Data Integrity&lt;/strong&gt;: Well-structured tables minimize the chances of anomalies, ensuring consistent and accurate data.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Faster Updates&lt;/strong&gt;: Updating data in a normalized database is more efficient, as changes only need to be made in a single location.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Easier Maintenance&lt;/strong&gt;: Small, well-organized tables are simpler to maintain and scale compared to large, unstructured ones.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Entity-Relationship Diagrams (ERDs)&lt;/strong&gt; are essential for visualizing and designing database structures, helping developers and stakeholders understand how entities relate to one another.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Normalization Techniques&lt;/strong&gt; ensure that databases are structured in an efficient, scalable, and reliable way by minimizing redundancy and preventing anomalies.&lt;/li&gt;&lt;li&gt;Together, ERDs and normalization form the backbone of effective database design, ensuring high performance, ease of maintenance, and consistent&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;min-h-[20px] text-message flex w-full flex-col items-end gap-2 break-words [.text-message+&amp;amp;]:mt-5 overflow-x-auto whitespace-normal&quot; data-message-author-role=&quot;assistant&quot; data-message-id=&quot;fe4ab118-045b-42fb-973e-5d6cff9f0762&quot; dir=&quot;auto&quot;&gt;&lt;div class=&quot;flex w-full flex-col gap-1 empty:hidden first:pt-[3px]&quot;&gt;&lt;div class=&quot;markdown prose w-full break-words dark:prose-invert light&quot;&gt;&lt;p&gt;data integrity.&lt;/p&gt;&lt;p&gt;By applying these design principles, you can create databases that are not only easy to scale and maintain but also optimized for performance and reliability.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/5886319950067346782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/ER-Diagrams-Normalization-Techniques.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5886319950067346782'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5886319950067346782'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/ER-Diagrams-Normalization-Techniques.html' title='Database Design: ER Diagrams and Normalization Techniques'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-5509873529328422482</id><published>2024-09-03T18:58:00.004+05:30</published><updated>2024-09-03T18:58:56.615+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Data Import and Export: Efficient Techniques for CSV, JSON, and SQL Dumps</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Data Import and Export&lt;/strong&gt;&amp;nbsp;are critical operations in database management, used for migrating data, backups, reporting, and integration with other systems. Common formats include&amp;nbsp;&lt;strong&gt;CSV&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;JSON&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;SQL Dump Files&lt;/strong&gt;, each suited for specific use cases. This guide explores how to import and export data efficiently using these formats, with examples in&amp;nbsp;&lt;strong&gt;MySQL&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;PostgreSQL&lt;/strong&gt;, as well as best practices to ensure data integrity during these operations.&lt;/p&gt;&lt;h2&gt;Importing and Exporting Data: CSV and JSON&lt;/h2&gt;&lt;h3&gt;1. CSV (Comma-Separated Values)&lt;/h3&gt;&lt;p&gt;CSV is a simple text format where rows and columns are separated by commas, making it widely supported across databases and tools.&lt;/p&gt;&lt;h4&gt;Importing CSV Data&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
In MySQL, you can use the &lt;code&gt;LOAD DATA INFILE&lt;/code&gt; statement to import a CSV file into a table:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;LOAD DATA INFILE &lt;span class=&quot;hljs-string&quot;&gt;&#39;/path/to/file.csv&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; table_name
FIELDS TERMINATED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;,&#39;&lt;/span&gt;   
ENCLOSED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;            
LINES TERMINATED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;\n&#39;&lt;/span&gt;   
IGNORE &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt; LINES;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;FIELDS TERMINATED BY&lt;/strong&gt;: Defines the delimiter (in this case, a comma).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ENCLOSED BY&lt;/strong&gt;: Specifies text enclosure (e.g., quotes).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;IGNORE 1 LINES&lt;/strong&gt;: Skips the header row containing column names.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
In PostgreSQL, you can use the &lt;code&gt;COPY&lt;/code&gt; command:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;COPY&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;/path/to/file.csv&#39;&lt;/span&gt;
DELIMITER &lt;span class=&quot;hljs-string&quot;&gt;&#39;,&#39;&lt;/span&gt;  
CSV HEADER;  
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;CSV HEADER&lt;/strong&gt;: Indicates the first row contains the column names.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Exporting CSV Data&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
Use &lt;code&gt;SELECT INTO OUTFILE&lt;/code&gt; to export data to a CSV file:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; 
&lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; OUTFILE &lt;span class=&quot;hljs-string&quot;&gt;&#39;/path/to/file.csv&#39;&lt;/span&gt;
FIELDS TERMINATED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;,&#39;&lt;/span&gt; 
ENCLOSED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;
LINES TERMINATED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;\n&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
Use the &lt;code&gt;COPY&lt;/code&gt; command to export data to CSV:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;COPY&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;/path/to/file.csv&#39;&lt;/span&gt;
DELIMITER &lt;span class=&quot;hljs-string&quot;&gt;&#39;,&#39;&lt;/span&gt; 
CSV HEADER;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;2. JSON (JavaScript Object Notation)&lt;/h3&gt;&lt;p&gt;JSON is ideal for hierarchical and semi-structured data, especially when working with APIs and web applications.&lt;/p&gt;&lt;h4&gt;Importing JSON Data&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
MySQL natively supports JSON data types, allowing you to insert JSON data directly into a JSON column:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; table_name (json_column)
&lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt;
    (&lt;span class=&quot;hljs-string&quot;&gt;&#39;{&quot;name&quot;: &quot;John&quot;, &quot;age&quot;: 30, &quot;city&quot;: &quot;New York&quot;}&#39;&lt;/span&gt;),
    (&lt;span class=&quot;hljs-string&quot;&gt;&#39;{&quot;name&quot;: &quot;Alice&quot;, &quot;age&quot;: 25, &quot;city&quot;: &quot;Paris&quot;}&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
PostgreSQL has native support for &lt;code&gt;json&lt;/code&gt; and &lt;code&gt;jsonb&lt;/code&gt; data types:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; table_name (json_column)
&lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt;
    (&lt;span class=&quot;hljs-string&quot;&gt;&#39;{&quot;name&quot;: &quot;John&quot;, &quot;age&quot;: 30, &quot;city&quot;: &quot;New York&quot;}&#39;&lt;/span&gt;::json),
    (&lt;span class=&quot;hljs-string&quot;&gt;&#39;{&quot;name&quot;: &quot;Alice&quot;, &quot;age&quot;: 25, &quot;city&quot;: &quot;Paris&quot;}&#39;&lt;/span&gt;::json);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;Exporting JSON Data&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
Use JSON functions to format the output as JSON:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;JSON_OBJECT&lt;/span&gt;(
    &lt;span class=&quot;hljs-string&quot;&gt;&#39;id&#39;&lt;/span&gt;, id,
    &lt;span class=&quot;hljs-string&quot;&gt;&#39;name&#39;&lt;/span&gt;, name,
    &lt;span class=&quot;hljs-string&quot;&gt;&#39;age&#39;&lt;/span&gt;, age,
    &lt;span class=&quot;hljs-string&quot;&gt;&#39;city&#39;&lt;/span&gt;, city
) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
In PostgreSQL, use &lt;code&gt;json_agg&lt;/code&gt; and &lt;code&gt;row_to_json&lt;/code&gt; to export data as JSON:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; json_agg(row_to_json(t))
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; (
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; id, name, age, city
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
) t;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This exports the entire table as a JSON array of objects, where each object represents a row.&lt;/p&gt;&lt;h2&gt;SQL Dump Files&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;An &lt;strong&gt;SQL Dump File&lt;/strong&gt; contains SQL statements to recreate both the database schema and its data. These files are commonly used for backups, migrations, and replication, providing a reliable way to transfer a full database across systems.&lt;/p&gt;&lt;h3&gt;1. Exporting Data as SQL Dump&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
Use the &lt;code&gt;mysqldump&lt;/code&gt; utility to create an SQL dump:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqldump -u username -p database_name &amp;gt; backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;You can customize the dump:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Export only schema&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqldump -u username -p --no-data database_name &amp;gt; schema_only.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Export specific table&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqldump -u username -p database_name table_name &amp;gt; table_backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
Use the &lt;code&gt;pg_dump&lt;/code&gt; utility to create an SQL dump:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;pg_dump -U username -d database_name -f backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;You can also customize the dump:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Export only schema&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;pg_dump -U username -d database_name --schema-only -f schema_only.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Export specific table&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;pg_dump -U username -d database_name -t table_name -f table_backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Importing Data from SQL Dump&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;MySQL Example&lt;/strong&gt;:
To import a SQL dump into MySQL, use the &lt;code&gt;mysql&lt;/code&gt; command:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysql -u username -p database_name &amp;lt; backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;:
In PostgreSQL, use the &lt;code&gt;psql&lt;/code&gt; command to restore data from a dump:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;psql -U username -d database_name -f backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h2&gt;Best Practices for Data Import and Export&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Data Validation&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Ensure that the imported data matches the target database schema. Use proper validation to handle errors like missing fields, data type mismatches, or formatting issues.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Backup Before Import&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Always create a backup of your database before performing large imports or critical updates. This ensures that you can recover data in case something goes wrong during the import process.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Optimize for Large Imports&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;For large datasets, disable indexes and foreign key checks during the import to improve performance, then re-enable them afterward.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;MySQL&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; foreign_key_checks &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;;
&lt;span class=&quot;hljs-comment&quot;&gt;-- Import data&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; foreign_key_checks &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; session_replication_role &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; replica;
&lt;span class=&quot;hljs-comment&quot;&gt;-- Import data&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; session_replication_role &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DEFAULT&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. &lt;strong&gt;Test Restores&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Periodically test restoring from your backups to ensure they are valid and can be used for recovery in case of an emergency.&lt;/p&gt;&lt;h3&gt;5. &lt;strong&gt;Data Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Check for data integrity issues such as duplicate rows, missing fields, or incorrect formatting when importing data, especially from external sources.&lt;/p&gt;&lt;h3&gt;6. &lt;strong&gt;Compression for Large SQL Dumps&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Compress large SQL dump files to save storage space and reduce network transfer time:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqldump -u username -p database_name | gzip &amp;gt; backup.sql.gz
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;CSV and JSON&lt;/strong&gt;: These formats are commonly used for importing and exporting structured and semi-structured data, and are supported natively by most databases.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SQL Dump Files&lt;/strong&gt;: These provide a reliable and portable way to back up entire databases, including both schema and data, and can be easily transferred or restored in different environments.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Best Practices&lt;/strong&gt;: Follow best practices like data validation, backups before import, and index optimization to ensure smooth and efficient data transfer.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By mastering the tools and methods for importing and exporting data, you can move data efficiently between systems, maintain backups, and safeguard your databases against data loss.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/5509873529328422482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/data-import-and-export-efficient.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5509873529328422482'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5509873529328422482'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/data-import-and-export-efficient.html' title='Data Import and Export: Efficient Techniques for CSV, JSON, and SQL Dumps'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-4987128481807163835</id><published>2024-09-03T18:29:00.003+05:30</published><updated>2024-09-03T18:29:23.200+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Full-Text Search: Advanced Indexing and Optimization Techniques</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Full-Text Search&lt;/strong&gt;&amp;nbsp;is a powerful feature for querying large text fields within a database, enabling users to search for words, phrases, and patterns in documents, descriptions, or other text-heavy fields. Unlike traditional&amp;nbsp;&lt;code&gt;LIKE&lt;/code&gt;&amp;nbsp;queries, which perform simple string matching and are inefficient for large datasets, full-text search uses specialized indexes and algorithms to deliver fast and relevant results. This article covers the fundamentals of&amp;nbsp;&lt;strong&gt;Full-Text Indexes&lt;/strong&gt;&amp;nbsp;and techniques for&amp;nbsp;&lt;strong&gt;Search Optimization&lt;/strong&gt;&amp;nbsp;to improve performance and relevancy in database searches.&lt;/p&gt;&lt;h2&gt;Full-Text Indexes&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Full-Text Index&lt;/strong&gt; is a special type of index designed for efficient text-based searches, especially in large text fields like articles, descriptions, or documents. By tokenizing the text and using advanced search algorithms, full-text indexes drastically improve search speed and relevance.&lt;/p&gt;&lt;h3&gt;Key Features of Full-Text Indexes&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Tokenization&lt;/strong&gt;: Text is broken into smaller parts (words or phrases), called tokens, which can be searched individually or as part of a phrase.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stop Words&lt;/strong&gt;: Common words (e.g., &quot;the&quot;, &quot;is&quot;, &quot;of&quot;) are excluded from the index to reduce its size and improve performance.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stemming&lt;/strong&gt;: Words are reduced to their root form (e.g., &quot;running&quot; becomes &quot;run&quot;), allowing variations of a word to match during a search.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Relevance Ranking&lt;/strong&gt;: Search results are ranked by relevance using algorithms like &lt;strong&gt;TF-IDF&lt;/strong&gt; (Term Frequency-Inverse Document Frequency), which measures the importance of a term in a document.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Advanced Search Operators&lt;/strong&gt;: Full-text search supports Boolean operators (&lt;code&gt;AND&lt;/code&gt;, &lt;code&gt;OR&lt;/code&gt;, &lt;code&gt;NOT&lt;/code&gt;), phrase searching, proximity searches, and more.&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Creating a Full-Text Index&lt;/h3&gt;&lt;p&gt;Full-text indexes are created differently in various database systems. Below are examples for &lt;strong&gt;MySQL&lt;/strong&gt; and &lt;strong&gt;SQL Server&lt;/strong&gt;.&lt;/p&gt;&lt;h4&gt;Example 1: MySQL Full-Text Index&lt;/h4&gt;&lt;p&gt;In MySQL, you can create a full-text index on &lt;code&gt;TEXT&lt;/code&gt;, &lt;code&gt;VARCHAR&lt;/code&gt;, or &lt;code&gt;CHAR&lt;/code&gt; columns.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; articles (
    id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,
    title &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;255&lt;/span&gt;),
    body TEXT,
    FULLTEXT(title, body)
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, a full-text index is created on both the &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt; columns of the &lt;code&gt;articles&lt;/code&gt; table.&lt;/p&gt;&lt;h4&gt;Example 2: SQL Server Full-Text Index&lt;/h4&gt;&lt;p&gt;In SQL Server, you need to create a full-text catalog before defining the full-text index.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-comment&quot;&gt;-- Step 1: Create a Full-Text Catalog&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; FULLTEXT CATALOG FullTextCatalog &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DEFAULT&lt;/span&gt;;

&lt;span class=&quot;hljs-comment&quot;&gt;-- Step 2: Create Full-Text Index on a Table&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; FULLTEXT INDEX &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; articles(body)
    KEY INDEX pk_articles &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; FullTextCatalog;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This code creates a full-text index on the &lt;code&gt;body&lt;/code&gt; column of the &lt;code&gt;articles&lt;/code&gt; table, using the primary key (&lt;code&gt;pk_articles&lt;/code&gt;) as a reference.&lt;/p&gt;&lt;h2&gt;Querying with Full-Text Search&lt;/h2&gt;&lt;p&gt;Once a full-text index is created, you can use it to perform complex search queries more efficiently than traditional methods.&lt;/p&gt;&lt;h3&gt;Example 1: Full-Text Search in MySQL&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; id, title, body
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; articles
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;MATCH&lt;/span&gt;(title, body) AGAINST(&lt;span class=&quot;hljs-string&quot;&gt;&#39;database optimization&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query searches for the phrase &lt;strong&gt;&quot;database optimization&quot;&lt;/strong&gt; in both the &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt; columns.&lt;/p&gt;&lt;h3&gt;Example 2: Full-Text Search in SQL Server&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; id, title, body
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; articles
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;CONTAINS&lt;/span&gt;(body, &lt;span class=&quot;hljs-string&quot;&gt;&#39;optimization&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query uses the &lt;strong&gt;CONTAINS()&lt;/strong&gt; function to search the &lt;code&gt;body&lt;/code&gt; column for the word &lt;strong&gt;&quot;optimization&quot;&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;Search Optimization Techniques&lt;/h2&gt;&lt;p&gt;Optimizing full-text search queries is crucial for improving performance and relevance, especially as the volume of data increases. Below are key techniques to achieve this.&lt;/p&gt;&lt;h3&gt;1. Index Design and Maintenance&lt;/h3&gt;&lt;h4&gt;Create Full-Text Indexes on Relevant Columns&lt;/h4&gt;&lt;p&gt;Only apply full-text indexes to columns where frequent text searches occur, such as &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, or &lt;code&gt;comments&lt;/code&gt;. Avoid indexing unnecessary columns to reduce overhead.&lt;/p&gt;&lt;h4&gt;Maintain Indexes Regularly&lt;/h4&gt;&lt;p&gt;Full-text indexes can become fragmented due to frequent updates, inserts, or deletes. Regularly rebuild or reorganize indexes to maintain search performance.&lt;/p&gt;&lt;h5&gt;Example (SQL Server):&lt;/h5&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; FULLTEXT INDEX &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; articles REORGANIZE;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This command reorganizes the full-text index on the &lt;code&gt;articles&lt;/code&gt; table to ensure optimal performance.&lt;/p&gt;&lt;h3&gt;2. Use Stop Words and Stemming&lt;/h3&gt;&lt;h4&gt;Stop Words&lt;/h4&gt;&lt;p&gt;Stop words are common words that don’t contribute to search relevance and are excluded from the index. By eliminating these words, you reduce the index size and improve performance.&lt;/p&gt;&lt;h4&gt;Stemming&lt;/h4&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Stemming allows different forms of a word to match. For example, a search for &lt;strong&gt;&quot;run&quot;&lt;/strong&gt; will also match &lt;strong&gt;&quot;running&quot;&lt;/strong&gt; and &lt;strong&gt;&quot;runs&quot;&lt;/strong&gt;. Make sure stemming is enabled in your full-text search engine for better result matching.&lt;/p&gt;&lt;h3&gt;3. Fine-Tune Queries with Boolean Operators&lt;/h3&gt;&lt;p&gt;Boolean operators such as &lt;strong&gt;AND&lt;/strong&gt;, &lt;strong&gt;OR&lt;/strong&gt;, and &lt;strong&gt;NOT&lt;/strong&gt; refine search results, allowing more control over the search logic.&lt;/p&gt;&lt;h4&gt;Example: Boolean Search in MySQL&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; articles 
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;MATCH&lt;/span&gt;(title, body) AGAINST(&lt;span class=&quot;hljs-string&quot;&gt;&#39;database OR optimization&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query searches for articles that contain either &lt;strong&gt;&quot;database&quot;&lt;/strong&gt; or &lt;strong&gt;&quot;optimization&quot;&lt;/strong&gt; in the text.&lt;/p&gt;&lt;h4&gt;Example: Phrase Search in MySQL&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; articles 
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;MATCH&lt;/span&gt;(title, body) AGAINST(&lt;span class=&quot;hljs-string&quot;&gt;&#39;&quot;database optimization&quot;&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;IN&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;BOOLEAN&lt;/span&gt; MODE);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query searches for the exact phrase &lt;strong&gt;&quot;database optimization&quot;&lt;/strong&gt; by using double quotes.&lt;/p&gt;&lt;h3&gt;4. Use Relevance Ranking&lt;/h3&gt;&lt;p&gt;Relevance ranking allows the database to rank search results based on how closely they match the query. This ensures that more relevant results are displayed at the top.&lt;/p&gt;&lt;h4&gt;Example: MySQL Relevance Ranking&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; product_name, 
       &lt;span class=&quot;hljs-keyword&quot;&gt;MATCH&lt;/span&gt;(description) AGAINST(&lt;span class=&quot;hljs-string&quot;&gt;&#39;laptop&#39;&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; relevance
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; products
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;MATCH&lt;/span&gt;(description) AGAINST(&lt;span class=&quot;hljs-string&quot;&gt;&#39;laptop&#39;&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; relevance &lt;span class=&quot;hljs-keyword&quot;&gt;DESC&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this query, products are ordered by their relevance to the search term &lt;strong&gt;&quot;laptop&quot;&lt;/strong&gt;.&lt;/p&gt;&lt;h3&gt;5. Leverage Search Caching&lt;/h3&gt;&lt;p&gt;For frequently run queries, caching search results can dramatically improve performance by reducing the need to re-execute the query and recalculate results every time.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Query Plan Caching&lt;/strong&gt;: Many databases cache query execution plans, speeding up repeated searches. Ensure this feature is enabled for your queries.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Result Caching&lt;/strong&gt;: Cache the results of commonly run queries to save resources.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;6. Partition Data for Performance&lt;/h3&gt;&lt;p&gt;For very large datasets, partitioning can improve search performance by dividing the data into more manageable subsets.&lt;/p&gt;&lt;h4&gt;Vertical Partitioning&lt;/h4&gt;&lt;p&gt;Store text-heavy columns like &lt;code&gt;description&lt;/code&gt; or &lt;code&gt;body&lt;/code&gt; in a separate table to reduce the size of the table that’s being searched.&lt;/p&gt;&lt;h4&gt;Horizontal Partitioning&lt;/h4&gt;&lt;p&gt;Divide tables into smaller partitions based on ranges (e.g., by date or ID) to limit the amount of data scanned during a search.&lt;/p&gt;&lt;h3&gt;7. Use Specialized Search Engines&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;For extremely large datasets or applications with high search demand, consider using dedicated search engines like &lt;strong&gt;Elasticsearch&lt;/strong&gt; or &lt;strong&gt;Apache Solr&lt;/strong&gt;. These tools are specifically optimized for full-text search and offer better scalability for high-performance text search operations.&lt;/p&gt;&lt;h4&gt;Example: Elasticsearch Search Query&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-json&quot;&gt;GET /products/_search
&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;query&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;hljs-attr&quot;&gt;&quot;match&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;hljs-attr&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;laptop&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This example performs a full-text search on the &lt;code&gt;description&lt;/code&gt; field in an Elasticsearch index.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Full-Text Indexes&lt;/strong&gt; provide the foundation for efficient searching within large text fields by leveraging tokenization, stop words, stemming, and relevance ranking. Optimizing full-text search performance is essential as the size of the dataset grows. Techniques like index maintenance, Boolean logic, proximity searches, and query/result caching ensure that searches remain fast and relevant. In cases of massive datasets, consider using specialized search engines like &lt;strong&gt;Elasticsearch&lt;/strong&gt; or &lt;strong&gt;Apache Solr&lt;/strong&gt; for even better performance and scalability.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/4987128481807163835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/full-text-search-advanced-indexing-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4987128481807163835'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4987128481807163835'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/full-text-search-advanced-indexing-and.html' title='Full-Text Search: Advanced Indexing and Optimization Techniques'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-5201300132463113946</id><published>2024-09-03T13:52:00.000+05:30</published><updated>2024-09-03T13:52:26.076+05:30</updated><title type='text'>Advanced SQL Queries: Leveraging Window Functions and Common Table Expressions (CTEs)</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Advanced SQL features such as&amp;nbsp;&lt;strong&gt;Window Functions&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Common Table Expressions (CTEs)&lt;/strong&gt;&amp;nbsp;provide powerful tools for performing complex data analysis and manipulation. These features simplify query logic, improve performance, and enable advanced analytics, making them indispensable for database professionals. This guide explores the use of window functions and CTEs to handle tasks such as ranking, aggregation, and processing hierarchical data.&lt;/p&gt;&lt;h2&gt;Window Functions&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Window Functions&lt;/strong&gt; allow calculations across a set of table rows that are related to the current row. Unlike traditional aggregate functions, which collapse the result set into a single value per group, window functions return a value for every row in the result set, while still considering a specified &quot;window&quot; of rows.&lt;/p&gt;&lt;h3&gt;Key Features:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;PARTITION BY&lt;/strong&gt;: Divides the data into subsets, or partitions, over which the window function is applied.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ORDER BY&lt;/strong&gt;: Determines the order in which rows are processed within each partition.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Window Frame&lt;/strong&gt;: Defines the range of rows used for the calculation relative to the current row (optional).&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Common Window Functions:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;ROW_NUMBER()&lt;/strong&gt;: Assigns a unique row number to each row within a partition.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;RANK()&lt;/strong&gt;: Assigns a rank to each row, with gaps in ranks for tied values.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DENSE_RANK()&lt;/strong&gt;: Similar to RANK() but with no gaps in ranking for tied values.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;LEAD() and LAG()&lt;/strong&gt;: Access data from the following (LEAD) or preceding (LAG) row relative to the current row.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SUM(), AVG(), COUNT()&lt;/strong&gt;: Windowed versions of these aggregate functions.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 1: ROW_NUMBER() with PARTITION BY and ORDER BY&lt;/h3&gt;&lt;p&gt;This example assigns row numbers to employees based on their department, ordered by salary within each department.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
    employee_id,
    department_id,
    salary,
    &lt;span class=&quot;hljs-built_in&quot;&gt;ROW_NUMBER&lt;/span&gt;() &lt;span class=&quot;hljs-keyword&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;PARTITION&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; department_id &lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; salary &lt;span class=&quot;hljs-keyword&quot;&gt;DESC&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; row_num
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;PARTITION BY&lt;/strong&gt;: Divides the employees by department.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ORDER BY&lt;/strong&gt;: Orders employees by salary within each department.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ROW_NUMBER()&lt;/strong&gt;: Assigns a sequential row number to each employee within their department.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 2: RANK() to Find Top Salaries&lt;/h3&gt;&lt;p&gt;This example ranks employees by salary within their departments. If two employees have the same salary, they receive the same rank.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
    employee_id,
    department_id,
    salary,
    &lt;span class=&quot;hljs-built_in&quot;&gt;RANK&lt;/span&gt;() &lt;span class=&quot;hljs-keyword&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;PARTITION&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; department_id &lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; salary &lt;span class=&quot;hljs-keyword&quot;&gt;DESC&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; rank
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;RANK()&lt;/strong&gt;: Assigns ranks based on salary. Ties receive the same rank, with gaps in the numbering.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 3: LEAD() and LAG()&lt;/h3&gt;&lt;p&gt;This example compares an employee’s salary with the next and previous employee&#39;s salary in the order.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
    employee_id,
    salary,
    &lt;span class=&quot;hljs-built_in&quot;&gt;LAG&lt;/span&gt;(salary, &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; salary) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; prev_salary,
    &lt;span class=&quot;hljs-built_in&quot;&gt;LEAD&lt;/span&gt;(salary, &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; salary) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; next_salary
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;LAG()&lt;/strong&gt;: Retrieves the previous row’s salary.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;LEAD()&lt;/strong&gt;: Retrieves the next row’s salary.&lt;/li&gt;&lt;li&gt;The third argument (&lt;code&gt;0&lt;/code&gt;) is the default value if there is no preceding or following row.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Common Table Expressions (CTEs)&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Common Table Expression (CTE)&lt;/strong&gt; is a temporary result set that you can reference within a &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, or &lt;code&gt;DELETE&lt;/code&gt; statement. CTEs make complex queries easier to read, write, and maintain by breaking them down into logical, manageable parts.&lt;/p&gt;&lt;h3&gt;Key Features:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;WITH Clause&lt;/strong&gt;: Defines the CTE.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Recursive CTEs&lt;/strong&gt;: Allow recursive operations, which are useful for querying hierarchical data like organizational trees.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 1: Simple CTE&lt;/h3&gt;&lt;p&gt;This example finds employees with salaries higher than their department’s average.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; DepartmentAvg &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; (
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
        department_id, 
        &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; avg_salary
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
    &lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; department_id
)
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
    e.employee_id, 
    e.salary, 
    da.avg_salary
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; DepartmentAvg da &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; da.department_id
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e.salary &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; da.avg_salary;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;DepartmentAvg&lt;/strong&gt;: CTE that calculates the average salary per department.&lt;/li&gt;&lt;li&gt;The main query selects employees with a salary higher than their department&#39;s average.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 2: Recursive CTE (Hierarchical Data)&lt;/h3&gt;&lt;p&gt;This example finds all employees and their managers, organized hierarchically.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;RECURSIVE&lt;/span&gt; EmployeeHierarchy &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; (
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
        employee_id,
        manager_id,
        &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; level
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
    &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; manager_id &lt;span class=&quot;hljs-keyword&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;NULL&lt;/span&gt;  &lt;span class=&quot;hljs-comment&quot;&gt;-- Start with top-level managers&lt;/span&gt;
    
    &lt;span class=&quot;hljs-keyword&quot;&gt;UNION&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ALL&lt;/span&gt;
    
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; 
        e.employee_id,
        e.manager_id,
        eh.level &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
    &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; EmployeeHierarchy eh &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.manager_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; eh.employee_id
)
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; EmployeeHierarchy;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Base Case&lt;/strong&gt;: Selects top-level managers (those without a manager).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Recursive Case&lt;/strong&gt;: Joins the employees table with the CTE to find employees reporting to managers found in the previous step.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;level&lt;/code&gt; column tracks the depth of the hierarchy.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example 3: Multiple CTEs&lt;/h3&gt;&lt;p&gt;This example defines multiple CTEs and uses them in the final query.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; SalesCTE &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; (
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; salesperson_id, &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(sales_amount) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; total_sales
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; sales
    &lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; salesperson_id
),
TopSales &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; (
    &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; salesperson_id, total_sales
    &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; SalesCTE
    &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; total_sales &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;50000&lt;/span&gt;
)
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; TopSales;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;SalesCTE&lt;/strong&gt;: Calculates total sales per salesperson.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;TopSales&lt;/strong&gt;: Filters out salespeople with total sales greater than 50,000.&lt;/li&gt;&lt;li&gt;The final query retrieves the top-performing salespeople.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Key Differences Between Window Functions and CTEs&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;6&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW196260316 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoNormalTable&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW196260316 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{d1bfaf2b-b003-4716-81e3-d0cd9d1e09df}{255}&quot; paraid=&quot;1460614521&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Aspect&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW196260316 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{9}&quot; paraid=&quot;2110727493&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Window Functions&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW196260316 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{18}&quot; paraid=&quot;161359598&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;CTEs (Common Table Expressions)&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{27}&quot; paraid=&quot;854593024&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Purpose&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{36}&quot; paraid=&quot;66086440&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Perform calculations over a set of rows&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{45}&quot; paraid=&quot;1387017658&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Define temporary result sets for complex queries&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{54}&quot; paraid=&quot;1067630707&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Use Case&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{63}&quot; paraid=&quot;18728980&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Ranking, aggregation, running totals, comparisons&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{72}&quot; paraid=&quot;1729271876&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Simplifying complex queries, hierarchical queries&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{81}&quot; paraid=&quot;1306805379&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Result Set&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{90}&quot; paraid=&quot;1469124313&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Returns all rows, with additional calculated columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{99}&quot; paraid=&quot;90373668&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Provides a temporary, reusable result set&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{108}&quot; paraid=&quot;761524435&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Scope&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{117}&quot; paraid=&quot;1513442198&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Works within the context of a single query result set&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{126}&quot; paraid=&quot;621226736&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can be referenced by multiple parts of a query&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW196260316 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 118px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{135}&quot; paraid=&quot;1935779524&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Recursive Capabilities&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 225px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{144}&quot; paraid=&quot;956336185&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;No recursion&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW196260316 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 255px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW196260316 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW196260316 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{f4e8885c-41a9-4810-b533-6dd3b5b60211}{153}&quot; paraid=&quot;485679921&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW196260316 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Supports recursive queries&lt;/span&gt;&lt;span class=&quot;EOP SCXW196260316 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Window Functions&lt;/strong&gt; enable sophisticated analytics over a set of rows without collapsing the result set, making them ideal for tasks like ranking, aggregation, and comparative analysis.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CTEs&lt;/strong&gt; simplify complex SQL queries by breaking them into smaller, more manageable parts, and they are especially useful for handling hierarchical data and recursive operations.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Both window functions and CTEs are powerful tools for writing advanced SQL queries, offering flexibility and efficiency in data management and analysis.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/5201300132463113946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/advanced-sql-queries-leveraging-window.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5201300132463113946'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/5201300132463113946'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/advanced-sql-queries-leveraging-window.html' title='Advanced SQL Queries: Leveraging Window Functions and Common Table Expressions (CTEs)'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3326957224341838014</id><published>2024-09-03T12:49:00.001+05:30</published><updated>2024-09-03T12:49:07.091+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Ensuring Data Integrity in Databases: Primary Keys, Foreign Keys, and Constraints</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Data Integrity&lt;/strong&gt;&amp;nbsp;is the cornerstone of a reliable and consistent database. It ensures that the data stored is accurate, consistent, and reliable throughout its lifecycle. Primary keys, foreign keys, and constraints are essential mechanisms for enforcing data integrity, preventing duplicates, and ensuring valid relationships across tables. This guide explores how primary keys and foreign keys work together to maintain data integrity and prevent common issues like orphaned records or data inconsistencies.&lt;/p&gt;&lt;h2&gt;Primary Key&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;Primary Key&lt;/strong&gt; is a column (or a set of columns) in a table that uniquely identifies each row. It is used to enforce &lt;strong&gt;entity integrity&lt;/strong&gt;, ensuring that every record in the table is distinct and has a unique identifier. A primary key cannot contain NULL values.&lt;/p&gt;&lt;h3&gt;Key Characteristics of a Primary Key:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Uniqueness&lt;/strong&gt;: Each value in the primary key column(s) must be unique.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Non-nullable&lt;/strong&gt;: A primary key cannot contain NULL values.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single Row Identifier&lt;/strong&gt;: Each row can be uniquely identified by its primary key.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single or Composite&lt;/strong&gt;: A primary key can consist of a single column or multiple columns (composite key).&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example of a Primary Key:&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; employees (
    employee_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,  &lt;span class=&quot;hljs-comment&quot;&gt;-- Primary Key&lt;/span&gt;
    first_name &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;),
    last_name &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;),
    email &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, &lt;code&gt;employee_id&lt;/code&gt; is the primary key for the &lt;code&gt;employees&lt;/code&gt; table, ensuring each employee has a unique ID.&lt;/p&gt;&lt;h3&gt;Composite Primary Key Example:&lt;/h3&gt;&lt;p&gt;A &lt;strong&gt;Composite Primary Key&lt;/strong&gt; is made up of two or more columns, collectively ensuring uniqueness.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; order_items (
    order_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,
    product_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,
    quantity &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,
    &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY (order_id, product_id)  &lt;span class=&quot;hljs-comment&quot;&gt;-- Composite Primary Key&lt;/span&gt;
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, the combination of &lt;code&gt;order_id&lt;/code&gt; and &lt;code&gt;product_id&lt;/code&gt; forms the primary key, ensuring that the same product cannot appear twice within the same order.&lt;/p&gt;&lt;h2&gt;Foreign Key&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Foreign Key&lt;/strong&gt; is a column (or a set of columns) in one table that references the &lt;strong&gt;Primary Key&lt;/strong&gt; of another table. Foreign keys enforce &lt;strong&gt;referential integrity&lt;/strong&gt;, ensuring that relationships between tables are valid. The foreign key value must match a primary key value in the referenced table, preventing orphaned or invalid records.&lt;/p&gt;&lt;h3&gt;Key Characteristics of a Foreign Key:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Referential Integrity&lt;/strong&gt;: Ensures that the value in the referencing table exists in the referenced table.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Relationship Definition&lt;/strong&gt;: Establishes relationships between tables (e.g., one-to-many, many-to-one).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cascading Actions&lt;/strong&gt;: Foreign keys can define actions like &lt;code&gt;ON DELETE CASCADE&lt;/code&gt; or &lt;code&gt;ON UPDATE CASCADE&lt;/code&gt; to automatically propagate changes from the parent to the child table.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example of a Foreign Key:&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; orders (
    order_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,
    customer_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,
    order_date &lt;span class=&quot;hljs-type&quot;&gt;DATE&lt;/span&gt;,
    &lt;span class=&quot;hljs-keyword&quot;&gt;FOREIGN&lt;/span&gt; KEY (customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;REFERENCES&lt;/span&gt; customers(customer_id)
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, &lt;code&gt;customer_id&lt;/code&gt; is a foreign key in the &lt;code&gt;orders&lt;/code&gt; table that references the &lt;code&gt;customer_id&lt;/code&gt; in the &lt;code&gt;customers&lt;/code&gt; table. This ensures that every order is associated with a valid customer.&lt;/p&gt;&lt;h3&gt;Cascading Actions in Foreign Keys&lt;/h3&gt;&lt;p&gt;Foreign keys can define cascading actions to automatically update or delete related records in child tables when changes occur in parent tables.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;ON DELETE CASCADE&lt;/strong&gt;: If a record in the parent table is deleted, the corresponding rows in the child table are also deleted.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FOREIGN&lt;/span&gt; KEY (customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;REFERENCES&lt;/span&gt; customers(customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DELETE&lt;/span&gt; CASCADE;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;ON UPDATE CASCADE&lt;/strong&gt;: If a primary key value in the parent table is updated, the foreign key values in the child table are updated automatically.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FOREIGN&lt;/span&gt; KEY (customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;REFERENCES&lt;/span&gt; customers(customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; CASCADE;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Example of Primary Key and Foreign Key Together&lt;/h3&gt;&lt;p&gt;Consider the relationship between &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; customers (
    customer_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,   &lt;span class=&quot;hljs-comment&quot;&gt;-- Primary Key in customers table&lt;/span&gt;
    customer_name &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)
);

&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; orders (
    order_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,
    customer_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,               &lt;span class=&quot;hljs-comment&quot;&gt;-- Foreign Key referencing customers table&lt;/span&gt;
    order_date &lt;span class=&quot;hljs-type&quot;&gt;DATE&lt;/span&gt;,
    &lt;span class=&quot;hljs-keyword&quot;&gt;FOREIGN&lt;/span&gt; KEY (customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;REFERENCES&lt;/span&gt; customers(customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DELETE&lt;/span&gt; CASCADE
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The &lt;code&gt;customers&lt;/code&gt; table has &lt;code&gt;customer_id&lt;/code&gt; as its primary key, ensuring that each customer is uniquely identified.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;orders&lt;/code&gt; table contains a foreign key (&lt;code&gt;customer_id&lt;/code&gt;) that references the &lt;code&gt;customer_id&lt;/code&gt; in the &lt;code&gt;customers&lt;/code&gt; table. This guarantees that every order is linked to a valid customer.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If a customer is deleted, the &lt;code&gt;ON DELETE CASCADE&lt;/code&gt; ensures that all related orders for that customer are also deleted, maintaining &lt;strong&gt;referential integrity&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;Differences Between Primary Key and Foreign Key&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; font-weight: 400; margin: 0px; overflow: visible; padding: 0px; position: relative; text-align: start; user-select: text;&quot;&gt;&lt;div class=&quot;TableContainer Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; display: flex; justify-content: flex-start; margin: 2px 0px 2px -5px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;table aria-rowcount=&quot;6&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW127621371 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoNormalTable&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background: transparent; border-collapse: collapse; border-spacing: 0px; empty-cells: show; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW127621371 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{20}&quot; paraid=&quot;709637576&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Aspect&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW127621371 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{29}&quot; paraid=&quot;652393418&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Primary Key&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW127621371 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{38}&quot; paraid=&quot;133232786&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Foreign Key&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{47}&quot; paraid=&quot;1404826311&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Uniqueness&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{56}&quot; paraid=&quot;479546430&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Ensures that each row in the table is unique&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{65}&quot; paraid=&quot;1233813786&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can contain duplicate values in the referencing table&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{74}&quot; paraid=&quot;901153937&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Nullability&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{83}&quot; paraid=&quot;793289462&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cannot contain NULL values&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{92}&quot; paraid=&quot;321705070&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can contain NULL values if the relationship is optional&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{101}&quot; paraid=&quot;1761946892&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Purpose&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{110}&quot; paraid=&quot;1168648509&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Uniquely identifies each row in a table&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{119}&quot; paraid=&quot;1037751769&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Establishes a relationship between two tables&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{128}&quot; paraid=&quot;1657714241&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Defined In&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{137}&quot; paraid=&quot;1201433075&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;The table that owns the data&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{146}&quot; paraid=&quot;1219764412&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;The table that references the primary key of another table&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW127621371 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 98px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{155}&quot; paraid=&quot;1212497062&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cascading&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 198px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{164}&quot; paraid=&quot;696429352&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Does not involve cascading actions directly&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW127621371 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 247px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{71da1e71-b023-4c3a-8407-9168eb9ab9bf}{173}&quot; paraid=&quot;857476649&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can define cascading actions like&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ON DELETE&lt;/span&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW127621371 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ON UPDATE&lt;/span&gt;&lt;span class=&quot;EOP SCXW127621371 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW127621371 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; font-weight: 400; margin: 0px; overflow: visible; padding: 0px; position: relative; text-align: start; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW127621371 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{000bcb7d-a3b2-410f-bb33-923f0ada8c31}{183}&quot; paraid=&quot;1249409115&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px 0px 10.6667px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Importance of Data Integrity&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Entity Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Entity integrity ensures that every row in a table is uniquely identifiable. This is achieved through the use of primary keys, which prevent duplicate records and ensure that each row has a unique identifier.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Referential Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Referential integrity ensures that relationships between tables are maintained correctly. Foreign keys enforce referential integrity by ensuring that any value in the foreign key column exists in the referenced primary key column.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Cascading Updates and Deletes&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Cascading actions ensure that changes to records in one table (the parent) are automatically reflected in related records in another table (the child). This prevents issues like orphaned records and maintains consistency in the database.&lt;/p&gt;&lt;h2&gt;Example Scenario: E-commerce Database&lt;/h2&gt;&lt;p&gt;Consider an e-commerce application with &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt; tables. Ensuring data integrity in this scenario would involve:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Defining a &lt;strong&gt;Primary Key&lt;/strong&gt; in the &lt;code&gt;customers&lt;/code&gt; table to uniquely identify each customer.&lt;/li&gt;&lt;li&gt;Defining a &lt;strong&gt;Foreign Key&lt;/strong&gt; in the &lt;code&gt;orders&lt;/code&gt; table to link each order to a valid customer.&lt;/li&gt;&lt;li&gt;Using &lt;strong&gt;Cascading Actions&lt;/strong&gt; to automatically delete all orders for a customer when that customer is deleted from the database.&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; customers (
    customer_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,
    customer_name &lt;span class=&quot;hljs-type&quot;&gt;VARCHAR&lt;/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)
);

&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt; orders (
    order_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PRIMARY&lt;/span&gt; KEY,
    customer_id &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;,
    order_date &lt;span class=&quot;hljs-type&quot;&gt;DATE&lt;/span&gt;,
    &lt;span class=&quot;hljs-keyword&quot;&gt;FOREIGN&lt;/span&gt; KEY (customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;REFERENCES&lt;/span&gt; customers(customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DELETE&lt;/span&gt; CASCADE
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Primary Keys&lt;/strong&gt; ensure entity integrity by uniquely identifying each row in a table and preventing NULL values.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Foreign Keys&lt;/strong&gt; enforce referential integrity by ensuring relationships between tables are valid and consistent.&lt;/li&gt;&lt;li&gt;Together, primary keys and foreign keys are essential for maintaining data integrity, preventing issues like duplicate entries and orphaned records, and enabling reliable cascading updates and deletes.&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;By effectively using primary keys, foreign keys, and cascading actions, you can ensure that your database maintains data integrity, is reliable, and prevents common issues such as data inconsistency or referential anomalies.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3326957224341838014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/Data-Integrity-Primary-Keys-Foreign-Keys.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3326957224341838014'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3326957224341838014'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/Data-Integrity-Primary-Keys-Foreign-Keys.html' title='Ensuring Data Integrity in Databases: Primary Keys, Foreign Keys, and Constraints'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-9080319466866682196</id><published>2024-09-03T12:40:00.000+05:30</published><updated>2024-09-03T12:40:31.196+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>NoSQL Databases Overview: Types, Use Cases, and Key Differences</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;NoSQL (Not Only SQL) databases are designed to handle large volumes of unstructured, semi-structured, and structured data. Unlike traditional relational databases (RDBMS), NoSQL databases provide flexibility, scalability, and high performance for specific use cases like real-time analytics, distributed systems, and big data. This guide provides an overview of NoSQL databases, including popular types like&amp;nbsp;&lt;strong&gt;MongoDB&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Cassandra&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Redis&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;Neo4j&lt;/strong&gt;, along with key differences between NoSQL and relational databases.&lt;/p&gt;&lt;h2&gt;Types of NoSQL Databases&lt;/h2&gt;&lt;h3&gt;1. MongoDB (Document Store)&lt;/h3&gt;&lt;h4&gt;Overview&lt;/h4&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;MongoDB&lt;/strong&gt; is a popular document-oriented NoSQL database that stores data in flexible, JSON-like documents called &lt;strong&gt;BSON&lt;/strong&gt; (Binary JSON). Unlike relational databases, MongoDB doesn’t require a predefined schema, making it ideal for applications where data structures can change over time.&lt;/p&gt;&lt;h4&gt;Key Features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Schema-less&lt;/strong&gt;: MongoDB allows documents within the same collection to have different fields and data types.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Flexible Data Model&lt;/strong&gt;: Supports arrays and nested objects directly in documents.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Horizontal Scalability&lt;/strong&gt;: MongoDB uses &lt;strong&gt;sharding&lt;/strong&gt; to distribute data across multiple servers for scalability.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Replication and High Availability&lt;/strong&gt;: &lt;strong&gt;Replica sets&lt;/strong&gt; provide redundancy and automatic failover.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Indexes&lt;/strong&gt;: Supports indexing for faster query performance.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Aggregation Framework&lt;/strong&gt;: Enables advanced data transformations and analytics across collections.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Example Data Structure (JSON-like):&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-json&quot;&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;_id&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;John Doe&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;john@example.com&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;hljs-attr&quot;&gt;&quot;orders&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-punctuation&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot;&gt;&quot;product&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Laptop&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1200&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;hljs-punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hljs-attr&quot;&gt;&quot;product&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&quot;Phone&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hljs-attr&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;800&lt;/span&gt;&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;hljs-punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;hljs-punctuation&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;Use Cases&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Real-time analytics and logging.&lt;/li&gt;&lt;li&gt;Content management systems (CMS).&lt;/li&gt;&lt;li&gt;Mobile and web applications.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Cassandra (Wide-Column Store)&lt;/h3&gt;&lt;h4&gt;Overview&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Apache Cassandra&lt;/strong&gt; is a distributed NoSQL database designed for high availability and scalability, particularly in environments handling massive amounts of structured data across multiple servers. It offers high write throughput and fault tolerance.&lt;/p&gt;&lt;h4&gt;Key Features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Wide-Column Store&lt;/strong&gt;: Data is stored in tables with dynamic columns, offering flexibility.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Horizontal Scalability&lt;/strong&gt;: Easily scale by adding nodes to the cluster.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Decentralized&lt;/strong&gt;: No single point of failure due to its decentralized architecture.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Eventual Consistency&lt;/strong&gt;: Allows configurable consistency levels to balance between availability and consistency.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fault Tolerance&lt;/strong&gt;: Survives hardware failures without data loss, thanks to replication across nodes.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Example Data Structure:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Table: users
------------------------------
| user_id | name  | email           | age |
------------------------------
| 1       | John  | john@example.com | 30  |
| 2       | Alice | alice@example.com| 25  |
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h4&gt;Use Cases&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Internet of Things (IoT) and time-series data.&lt;/li&gt;&lt;li&gt;High-volume data analytics.&lt;/li&gt;&lt;li&gt;Real-time data processing.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Key Differences Between MongoDB and Cassandra&lt;/h3&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;10&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW70627683 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoNormalTable&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW70627683 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a253e0d7-a8f1-4ba7-839d-a7cc2da284f7}{224}&quot; paraid=&quot;1228453561&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Feature&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW70627683 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a253e0d7-a8f1-4ba7-839d-a7cc2da284f7}{233}&quot; paraid=&quot;1476522648&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;MongoDB&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW70627683 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a253e0d7-a8f1-4ba7-839d-a7cc2da284f7}{242}&quot; paraid=&quot;691234058&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cassandra&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a253e0d7-a8f1-4ba7-839d-a7cc2da284f7}{251}&quot; paraid=&quot;1639825062&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Data Model&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{5}&quot; paraid=&quot;151563209&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Document Store (BSON format)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{14}&quot; paraid=&quot;739730333&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Wide-Column Store (Tables)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{23}&quot; paraid=&quot;1418860120&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Schema&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{32}&quot; paraid=&quot;1402041810&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Schema-less&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{41}&quot; paraid=&quot;102702277&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Schema-based but flexible columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{50}&quot; paraid=&quot;1526960157&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Consistency&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{59}&quot; paraid=&quot;852175735&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Strong (by default)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{68}&quot; paraid=&quot;796390638&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Eventual (configurable)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{77}&quot; paraid=&quot;1056495930&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Scalability&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{86}&quot; paraid=&quot;1021057193&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Horizontal (via sharding)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{95}&quot; paraid=&quot;936226711&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Horizontal (via partitioning)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{104}&quot; paraid=&quot;1602503905&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Write Speed&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{113}&quot; paraid=&quot;715769026&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;High write throughput&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{122}&quot; paraid=&quot;1657000243&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Very high write throughput&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;7&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{131}&quot; paraid=&quot;1442505&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Fault Tolerance&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{140}&quot; paraid=&quot;180088452&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;High (Replica Sets)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{149}&quot; paraid=&quot;1815952318&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Extremely high (No single point of failure)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;8&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{158}&quot; paraid=&quot;1841387191&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Query Language&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{167}&quot; paraid=&quot;1728304657&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;MongoDB Query Language (JSON-like)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{176}&quot; paraid=&quot;960826108&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;CQL (Cassandra Query Language)&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;9&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{185}&quot; paraid=&quot;937148618&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ACID Support&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{194}&quot; paraid=&quot;520224500&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ACID-compliant at the document level&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{203}&quot; paraid=&quot;1338929548&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Limited transactional support&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;10&quot; class=&quot;TableRow SCXW70627683 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 110px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{212}&quot; paraid=&quot;1191206652&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Best For&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 250px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{221}&quot; paraid=&quot;1405159969&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Real-time analytics, mobile apps&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW70627683 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW70627683 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW70627683 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{faf388bd-2ae7-4113-ad64-dec81f83bb50}{230}&quot; paraid=&quot;996944047&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW70627683 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Large-scale distributed systems&lt;/span&gt;&lt;span class=&quot;EOP SCXW70627683 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Other NoSQL Databases&lt;/h2&gt;&lt;h3&gt;1. Redis (Key-Value Store)&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Redis&lt;/strong&gt; is an in-memory, key-value store known for its blazing speed. It supports advanced data structures like lists, sets, and sorted sets.&lt;/p&gt;&lt;h4&gt;Key Features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;In-Memory&lt;/strong&gt;: All data is stored in memory for lightning-fast read/write operations.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Advanced Data Structures&lt;/strong&gt;: Supports lists, sets, hashes, and sorted sets.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Persistence Options&lt;/strong&gt;: Can be configured to persist data to disk at regular intervals.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Use Cases&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Caching for fast data retrieval.&lt;/li&gt;&lt;li&gt;Real-time data processing.&lt;/li&gt;&lt;li&gt;Leaderboards and session management.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Neo4j (Graph Database)&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Neo4j&lt;/strong&gt; is a graph database that uses nodes and relationships to represent and store data, optimized for traversing complex relationships.&lt;/p&gt;&lt;h4&gt;Key Features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Graph Model&lt;/strong&gt;: Data is represented as nodes and relationships, ideal for queries that involve relationships.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;High-Performance Traversals&lt;/strong&gt;: Optimized for queries like shortest paths, graph-based recommendations, and influence analysis.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Use Cases&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Social networks and recommendation engines.&lt;/li&gt;&lt;li&gt;Fraud detection.&lt;/li&gt;&lt;li&gt;Network topology management.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Couchbase (Document Store)&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Couchbase&lt;/strong&gt; combines key-value and document-oriented storage with a distributed architecture.&lt;/p&gt;&lt;h4&gt;Key Features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Flexible JSON Document Store&lt;/strong&gt;: Supports advanced queries through N1QL (similar to SQL).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Distributed Architecture&lt;/strong&gt;: Horizontally scalable for high availability and fault tolerance.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Use Cases&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;Real-time applications with large datasets.&lt;/li&gt;&lt;li&gt;Mobile and web applications.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Key Differences Between NoSQL and SQL Databases&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;8&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW169802030 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoNormalTable&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW169802030 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{def3c6cb-4ac7-44fb-bbea-e79728e49fad}{248}&quot; paraid=&quot;1329386510&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Aspect&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW169802030 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{2}&quot; paraid=&quot;1915563254&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;NoSQL&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW169802030 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #1e8bcd; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{11}&quot; paraid=&quot;2136780372&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;SQL (Relational)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{20}&quot; paraid=&quot;1865832817&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Data Model&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{29}&quot; paraid=&quot;945870277&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Non-relational (document, key-value, graph)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{38}&quot; paraid=&quot;1476379995&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Relational (tables with fixed schema)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{47}&quot; paraid=&quot;1202732627&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Schema Flexibility&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{56}&quot; paraid=&quot;1673533914&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Schema-less or dynamic&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{65}&quot; paraid=&quot;1623378141&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Fixed schema&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{74}&quot; paraid=&quot;619389941&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Scalability&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{83}&quot; paraid=&quot;862492268&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Horizontal (via sharding/partitioning)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{92}&quot; paraid=&quot;884812103&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Vertical (via server upgrades)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{101}&quot; paraid=&quot;1700825480&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Consistency&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{110}&quot; paraid=&quot;321685343&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Eventual or tunable&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{119}&quot; paraid=&quot;129215297&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Strong (ACID-compliant transactions)&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{128}&quot; paraid=&quot;1875281822&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ACID Transactions&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{137}&quot; paraid=&quot;1123335491&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Limited or document-level&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{146}&quot; paraid=&quot;1141844047&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Full ACID compliance&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;7&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{155}&quot; paraid=&quot;43567105&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Best For&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{164}&quot; paraid=&quot;1110463264&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Big data, real-time web apps, IoT&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{173}&quot; paraid=&quot;15191161&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Financial systems, ERP, CRM&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;8&quot; class=&quot;TableRow SCXW169802030 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 124px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{182}&quot; paraid=&quot;1232782154&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Examples&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 226px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{191}&quot; paraid=&quot;54697276&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;MongoDB, Cassandra, Redis, Neo4j&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW169802030 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 248px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW169802030 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW169802030 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{324f4372-237a-4609-ab15-2a3c983c3157}{200}&quot; paraid=&quot;982967864&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW169802030 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;MySQL, PostgreSQL, Oracle&lt;/span&gt;&lt;span class=&quot;EOP SCXW169802030 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;MongoDB&lt;/strong&gt; is ideal for applications that need flexible schema design and real-time access to data, such as content management systems and mobile/web applications.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cassandra&lt;/strong&gt; is the go-to choice for large distributed systems that require high availability, scalability, and high write throughput, like IoT and real-time data processing.&lt;/li&gt;&lt;li&gt;Each NoSQL database is optimized for different use cases, making it essential to choose the right one based on your data model, consistency requirements, and scalability needs.&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/9080319466866682196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/nosql-databases-overview-types-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/9080319466866682196'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/9080319466866682196'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/nosql-databases-overview-types-use.html' title='NoSQL Databases Overview: Types, Use Cases, and Key Differences'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3814794276547515741</id><published>2024-09-02T17:28:00.000+05:30</published><updated>2024-09-02T17:28:02.058+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Database Backup and Recovery: Strategies for Ensuring Data Integrity</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Database&amp;nbsp;&lt;strong&gt;Backup and Recovery&lt;/strong&gt;&amp;nbsp;are crucial for ensuring that data remains safe and recoverable in the event of a system failure, corruption, or human error. A solid backup strategy guarantees data availability and minimizes downtime. This guide explores different types of database backups, strategies for creating effective backup plans, and methods like&amp;nbsp;&lt;strong&gt;Point-in-Time Recovery (PITR)&lt;/strong&gt;&amp;nbsp;to restore data quickly and efficiently.&lt;/p&gt;&lt;h2&gt;Database Backups&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Database Backup&lt;/strong&gt; is a snapshot of your database that can be used to restore the database to its previous state in case of data loss, corruption, or system failure. Choosing the right backup type depends on how often your data changes and how quickly you need to recover it.&lt;/p&gt;&lt;h3&gt;1. Types of Database Backups&lt;/h3&gt;&lt;h4&gt;Full Backup&lt;/h4&gt;&lt;p&gt;A full backup contains a complete copy of the entire database, including data, logs, schemas, and metadata. It provides a complete snapshot of the database at a specific point in time.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Typically performed periodically (daily or weekly) because it takes more time and storage.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example (MySQL)&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqldump -u username -p database_name &amp;gt; full_backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Differential Backup&lt;/h4&gt;&lt;p&gt;A differential backup includes only the data that has changed since the last full backup. It is faster and smaller than a full backup but still captures recent changes.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: For faster backups and smaller file sizes between full backups.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example (SQL Server)&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;BACKUP DATABASE database_name
&lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; DISK &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;differential_backup.bak&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; DIFFERENTIAL;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Incremental Backup&lt;/h4&gt;&lt;p&gt;An incremental backup includes only the data that has changed since the last backup, whether that was full or incremental. Incremental backups are the smallest and fastest to create.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When frequent backups are needed, but storage space is limited.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example (MySQL)&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;innobackupex --incremental /path/to/backup --incremental-basedir=/path/to/previous_backup
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Transaction Log Backup&lt;/h4&gt;&lt;p&gt;A transaction log backup records all the transactions since the last transaction log or full backup. It’s useful for restoring the database to a specific point in time.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: For databases with full recovery models, allowing you to perform point-in-time recovery.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example (SQL Server)&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;BACKUP LOG database_name
&lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; DISK &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;log_backup.bak&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Backup Strategies&lt;/h3&gt;&lt;p&gt;An effective backup strategy minimizes potential data loss while balancing performance and storage requirements. The following strategies can help ensure your backups are efficient and reliable:&lt;/p&gt;&lt;h4&gt;Full + Differential + Transaction Log Backups&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Plan&lt;/strong&gt;: Perform full backups periodically, differential backups daily, and transaction log backups frequently (e.g., every hour).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Advantage&lt;/strong&gt;: Minimizes potential data loss while keeping backup sizes manageable.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Backup Frequency&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Critical data&lt;/strong&gt;: Backups should be frequent for critical databases. Some businesses may require backups every hour or even every minute using transaction log backups.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;: Automate frequent incremental or transaction log backups to minimize potential data loss.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Automated Backups&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Best practice&lt;/strong&gt;: Automate backups using cron jobs, SQL Server Agent jobs, or other scheduling tools to ensure regular backups without manual intervention.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Test Backups&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Importance&lt;/strong&gt;: Regularly test backups by restoring them to verify they are valid and that the recovery process works smoothly.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Point-in-Time Recovery (PITR)&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Point-in-Time Recovery (PITR)&lt;/strong&gt; is a method that allows restoring a database to a specific moment, typically just before a failure or error occurred. This recovery method is especially useful in scenarios like accidental deletions or unauthorized changes.&lt;/p&gt;&lt;h3&gt;1. Requirements for PITR&lt;/h3&gt;&lt;p&gt;To perform a point-in-time recovery, the following are needed:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Full Backup&lt;/strong&gt;: The last full backup taken before the failure or data loss.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Transaction Log Backups&lt;/strong&gt;: Log backups that track all changes made since the full backup.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. How PITR Works&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Restore the Full Backup&lt;/strong&gt;: Start by restoring the most recent full backup.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Apply Incremental or Differential Backups&lt;/strong&gt;: If using differential or incremental backups, apply those next.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Apply Transaction Log Backups&lt;/strong&gt;: Restore the log backups up to the specific point in time just before the failure.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stop at the Exact Time&lt;/strong&gt;: Use a precise stop point to avoid reapplying transactions that led to the failure.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. PITR Example (SQL Server)&lt;/h3&gt;&lt;p&gt;Suppose you have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A full backup at midnight.&lt;/li&gt;&lt;li&gt;Hourly transaction log backups.&lt;/li&gt;&lt;li&gt;A failure at 10:30 AM, but you want to restore the database to 10:15 AM.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Steps for recovery:&lt;/h4&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Restore the full backup&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;RESTORE DATABASE database_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; DISK &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;full_backup.bak&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; NORECOVERY;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Restore transaction logs&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;RESTORE LOG database_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; DISK &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;log_backup.bak&#39;&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; STOPAT &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;2024-08-31T10:15:00&#39;&lt;/span&gt;, NORECOVERY;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complete the recovery&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;RESTORE DATABASE database_name &lt;span class=&quot;hljs-keyword&quot;&gt;WITH&lt;/span&gt; RECOVERY;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;4. PITR Example (MySQL)&lt;/h3&gt;&lt;p&gt;Assume you&#39;re using &lt;strong&gt;binary logs&lt;/strong&gt; to track transactions.&lt;/p&gt;&lt;h4&gt;Steps for recovery:&lt;/h4&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Restore the full backup&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysql -u username -p database_name &amp;lt; full_backup.sql
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Apply the binary logs&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-bash&quot;&gt;mysqlbinlog --stop-datetime=&lt;span class=&quot;hljs-string&quot;&gt;&quot;2024-08-31 10:15:00&quot;&lt;/span&gt; binlog_file | mysql -u username -p
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This command applies the transactions from the binary logs up to the specified point in time.&lt;/p&gt;&lt;h2&gt;Backup and Recovery Best Practices&lt;/h2&gt;&lt;h3&gt;Use Redundant Backups&lt;/h3&gt;&lt;p&gt;Store backups in multiple locations, such as local storage, cloud storage, or remote servers. This ensures data availability even in case of local hardware failures.&lt;/p&gt;&lt;h3&gt;Encrypt Backups&lt;/h3&gt;&lt;p&gt;Backups contain sensitive data and should be encrypted to prevent unauthorized access, both in transit and at rest.&lt;/p&gt;&lt;h3&gt;Automate Backup Processes&lt;/h3&gt;&lt;p&gt;Automating the backup process ensures consistency and reliability. Use scheduling tools like cron jobs or SQL Server Agent to handle backup automation.&lt;/p&gt;&lt;h3&gt;Monitor Backup Success&lt;/h3&gt;&lt;p&gt;Implement monitoring systems that notify you when backups succeed or fail. This helps you act quickly if any issues arise.&lt;/p&gt;&lt;h3&gt;Retention Policies&lt;/h3&gt;&lt;p&gt;Establish policies for how long backups should be retained. This reduces storage costs and helps comply with regulatory requirements for data retention.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Database Backups&lt;/strong&gt;: Implementing full, differential, incremental, and transaction log backups is essential for effective disaster recovery. A robust backup strategy minimizes downtime and data loss.
&lt;strong&gt;Point-in-Time Recovery (PITR)&lt;/strong&gt;: This advanced recovery technique enables you to restore databases to a specific point in time, reducing the risk of data loss from errors or failures.&lt;/p&gt;&lt;p&gt;By combining the right backup strategy with proven recovery methods, your organization can ensure data reliability, availability, and security in case of any data loss event.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3814794276547515741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/database-backup-and-recovery-strategies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3814794276547515741'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3814794276547515741'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/database-backup-and-recovery-strategies.html' title='Database Backup and Recovery: Strategies for Ensuring Data Integrity'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-2973501537180260512</id><published>2024-09-02T17:18:00.000+05:30</published><updated>2024-09-02T17:18:00.772+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Database Normalization: Ensuring Data Integrity and Efficiency</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Database normalization is the process of organizing data to reduce redundancy, eliminate anomalies, and ensure data integrity. This involves breaking a large table into smaller, well-structured tables and defining relationships between them. Normalization is carried out in stages, referred to as&amp;nbsp;&lt;strong&gt;Normal Forms (NF)&lt;/strong&gt;, each of which addresses different types of redundancy and dependency issues. The most common normal forms are&amp;nbsp;&lt;strong&gt;1NF&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;2NF&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;3NF&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;BCNF&lt;/strong&gt;.&lt;/p&gt;&lt;h2&gt;Why Normalize a Database?&lt;/h2&gt;&lt;p&gt;Normalization is critical for:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Eliminating data redundancy&lt;/strong&gt;: Avoid storing the same data multiple times.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Ensuring data integrity&lt;/strong&gt;: Maintain accuracy and consistency.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Preventing anomalies&lt;/strong&gt;: Avoid update, insert, and delete anomalies that could compromise the database.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Stages of Normalization&lt;/h2&gt;&lt;h3&gt;1NF (First Normal Form)&lt;/h3&gt;&lt;p&gt;A relation is in &lt;strong&gt;1NF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Each column contains atomic (indivisible) values.&lt;/li&gt;&lt;li&gt;Each row is unique, often ensured by a primary key.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Violation Example:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;StudentID  | Name    | Subjects
-----------|---------|-----------------------
1          | Alice   | Math, Science
2          | Bob     | English, History
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, the &lt;code&gt;Subjects&lt;/code&gt; column contains multiple values (a list), violating atomicity.&lt;/p&gt;&lt;h4&gt;Corrected to 1NF:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;StudentID  | Name    | Subject
-----------|---------|---------
1          | Alice   | Math
1          | Alice   | Science
2          | Bob     | English
2          | Bob     | History
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Each column now holds atomic values, and the table adheres to 1NF.&lt;/p&gt;&lt;h3&gt;2NF (Second Normal Form)&lt;/h3&gt;&lt;p&gt;A relation is in &lt;strong&gt;2NF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It is already in 1NF.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;No partial dependency&lt;/strong&gt; exists, meaning that every non-key attribute depends on the entire primary key (not just part of it). This applies primarily when the primary key is composite.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Violation Example:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;StudentID  | SubjectID  | TeacherName
-----------|------------|------------
1          | 101        | Mr. Smith
1          | 102        | Ms. Johnson
2          | 103        | Mr. Lee
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this table, &lt;code&gt;TeacherName&lt;/code&gt; depends only on &lt;code&gt;SubjectID&lt;/code&gt;, not on the full composite key &lt;code&gt;(StudentID, SubjectID)&lt;/code&gt;, creating a partial dependency.&lt;/p&gt;&lt;h4&gt;Corrected to 2NF:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;StudentSubjects Table:
StudentID  | SubjectID
-----------|------------
1          | 101
1          | 102
2          | 103
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Subjects Table:
SubjectID  | TeacherName
-----------|------------
101        | Mr. Smith
102        | Ms. Johnson
103        | Mr. Lee
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Now, &lt;code&gt;TeacherName&lt;/code&gt; is dependent solely on &lt;code&gt;SubjectID&lt;/code&gt;, eliminating the partial dependency.&lt;/p&gt;&lt;h3&gt;3NF (Third Normal Form)&lt;/h3&gt;&lt;p&gt;A relation is in &lt;strong&gt;3NF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It is already in 2NF.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;No transitive dependency&lt;/strong&gt; exists, meaning non-key attributes do not depend on other non-key attributes.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Violation Example:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;EmployeeID  | DepartmentID  | DepartmentName
------------|---------------|----------------
1           | D001          | HR
2           | D002          | IT
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Here, &lt;code&gt;DepartmentName&lt;/code&gt; depends on &lt;code&gt;DepartmentID&lt;/code&gt;, which creates a transitive dependency because &lt;code&gt;DepartmentID&lt;/code&gt; itself is not the primary key.&lt;/p&gt;&lt;h4&gt;Corrected to 3NF:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Employees Table:
EmployeeID  | DepartmentID
------------|---------------
1           | D001
2           | D002
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;Departments Table:
DepartmentID  | DepartmentName
--------------|----------------
D001          | HR
D002          | IT
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;Now, the non-key attribute &lt;code&gt;DepartmentName&lt;/code&gt; is removed from the &lt;code&gt;Employees&lt;/code&gt; table, eliminating the transitive dependency.&lt;/p&gt;&lt;h3&gt;BCNF (Boyce-Codd Normal Form)&lt;/h3&gt;&lt;p&gt;A relation is in &lt;strong&gt;BCNF&lt;/strong&gt; if:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It is already in 3NF.&lt;/li&gt;&lt;li&gt;Every determinant (a column that determines another column) is a candidate key. In simpler terms, there are no non-key attributes determining other non-key attributes.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Violation Example:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;TeacherID  | SubjectID  | Classroom
-----------|------------|------------
1          | Math       | 101
1          | Science    | 102
2          | Math       | 101
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this case, &lt;code&gt;TeacherID&lt;/code&gt; determines the &lt;code&gt;Classroom&lt;/code&gt; but is not a candidate key by itself, violating BCNF.&lt;/p&gt;&lt;h4&gt;Corrected to BCNF:&lt;/h4&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;TeacherSubjects Table:
TeacherID  | SubjectID
-----------|------------
1          | Math
1          | Science
2          | Math
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-plaintext&quot;&gt;TeacherClassrooms Table:
TeacherID  | Classroom
-----------|------------
1          | 101
1          | 102
2          | 101
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;By splitting the table, the dependency between &lt;code&gt;TeacherID&lt;/code&gt; and &lt;code&gt;Classroom&lt;/code&gt; is resolved, bringing the table into BCNF.&lt;/p&gt;&lt;h2&gt;Summary of Normal Forms&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;5&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW129489516 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoTableGrid&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW129489516 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW129489516 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 94px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{176}&quot; paraid=&quot;29490376&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Normal Form&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW129489516 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 154px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{185}&quot; paraid=&quot;139097260&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Requirement&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW129489516 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 157px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{194}&quot; paraid=&quot;1534264545&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Example Violation&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW129489516 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{203}&quot; paraid=&quot;1572937274&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Solution&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW129489516 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 94px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{212}&quot; paraid=&quot;387316423&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;1NF&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 154px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{221}&quot; paraid=&quot;579840498&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Eliminate duplicate rows, ensure atomic values in columns&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 157px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{230}&quot; paraid=&quot;2023749861&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Multiple values in a single column&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{239}&quot; paraid=&quot;1367146241&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Break down columns into atomic units&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW129489516 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 94px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{a50b46ed-a229-4954-83df-e5af81a64c20}{248}&quot; paraid=&quot;746934133&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;2NF&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 154px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{2}&quot; paraid=&quot;2095948992&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Be in 1NF, eliminate partial dependencies&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 157px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{11}&quot; paraid=&quot;335048770&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;A column depends on part of a composite key&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{20}&quot; paraid=&quot;744374695&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Create separate tables for attributes depending on part of the key&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW129489516 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 94px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{29}&quot; paraid=&quot;587632568&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;3NF&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 154px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{38}&quot; paraid=&quot;1813211933&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Be in 2NF, eliminate transitive dependencies&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 157px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{47}&quot; paraid=&quot;171926921&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;A column depends on another non-key column&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{56}&quot; paraid=&quot;2038254406&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Separate transitive dependencies into different tables&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW129489516 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 94px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{65}&quot; paraid=&quot;841852198&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;BCNF&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 154px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{74}&quot; paraid=&quot;1120753870&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Be in 3NF, ensure every determinant is a candidate key&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 157px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{83}&quot; paraid=&quot;1165170278&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Non-key column determines another attribute&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW129489516 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 217px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW129489516 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW129489516 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{28d1de1c-aae9-4b7a-935a-a883726e4a8c}{92}&quot; paraid=&quot;2092417140&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW129489516 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Eliminate dependencies by restructuring tables&lt;/span&gt;&lt;span class=&quot;EOP SCXW129489516 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Advantages of Normalization&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Reduced Redundancy&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Normalization eliminates duplicate data by breaking down larger tables into smaller, more manageable ones. This reduces the chance of inconsistencies.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Improved Data Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;By ensuring that data is stored logically and in smaller tables, normalization enhances the accuracy and consistency of the database.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Prevention of Anomalies&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Update Anomalies&lt;/strong&gt;: When redundant data exists, updating one part might leave the others inconsistent. Normalization ensures that data needs to be updated in only one place.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Insert Anomalies&lt;/strong&gt;: Normalization prevents situations where you can’t insert data without inserting unrelated information.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Delete Anomalies&lt;/strong&gt;: Without normalization, deleting a record might result in the loss of valuable related data. Normalization keeps data independent.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Considerations for Normalization&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;While normalization improves data structure and integrity, it can also introduce complexity in query performance, particularly in read-heavy systems. When optimizing for performance, sometimes a balance between normalization and &lt;strong&gt;denormalization&lt;/strong&gt; is necessary. &lt;strong&gt;Denormalization&lt;/strong&gt; reintroduces some redundancy to improve read performance by reducing the need for complex joins.&lt;/p&gt;&lt;h3&gt;When to Denormalize&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Read-heavy systems&lt;/strong&gt;: If your system frequently reads more data than it writes, denormalization might improve query performance.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Data warehouses&lt;/strong&gt;: Denormalization can speed up query processing in analytical databases where complex joins may slow performance.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Database normalization is essential for creating efficient, maintainable, and reliable databases. By breaking down tables and ensuring clear relationships between data, normalization reduces redundancy, prevents anomalies, and improves data integrity. However, while normalization helps keep the database clean and well-structured, it&#39;s important to weigh the trade-off between normalized structure and query performance, especially in read-heavy systems.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/2973501537180260512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/Normalization-1NF-2NF-3NF-BCNF.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/2973501537180260512'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/2973501537180260512'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/Normalization-1NF-2NF-3NF-BCNF.html' title='Database Normalization: Ensuring Data Integrity and Efficiency'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-8535768456312756611</id><published>2024-09-02T16:26:00.001+05:30</published><updated>2024-09-02T16:26:23.534+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Comprehensive Guide to Database Optimizations: Indexing Strategies and Query Optimization</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Optimizing databases ensures efficient performance, faster query execution, and reduced resource usage, which are critical for scaling applications. This guide delves into two core areas of database optimization:&amp;nbsp;&lt;strong&gt;Indexing Strategies&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Query Optimization&lt;/strong&gt;. We will explore how to create and use indexes effectively, write efficient queries, and leverage execution plans for fine-tuning performance.&lt;/p&gt;&lt;h2&gt;Indexing Strategies&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Indexes are crucial for speeding up data retrieval operations by organizing data in a way that makes it easier for the database to locate the required information. However, improper indexing can slow down other operations like inserts and updates.&lt;/p&gt;&lt;h3&gt;1. Types of Indexes&lt;/h3&gt;&lt;h4&gt;Single-Column Index&lt;/h4&gt;&lt;p&gt;A single-column index is created on one column, improving query performance when filtering or sorting by that column.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When queries frequently filter or sort by a specific column.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_customer_name &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customers(name);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Composite Index (Multi-Column Index)&lt;/h4&gt;&lt;p&gt;A composite index is created on multiple columns. The order of columns in a composite index is crucial as it affects which queries can benefit from it.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Queries that filter or sort by more than one column.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; INDEX idx_customer_name_city &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customers(name, city);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;This index improves performance for queries filtering by &lt;code&gt;name&lt;/code&gt;, or by both &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;city&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Unique Index&lt;/h4&gt;&lt;p&gt;A unique index ensures that all values in the indexed column(s) are unique, which is especially useful for columns like email or usernames.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Enforce uniqueness along with optimizing lookups.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;UNIQUE&lt;/span&gt; INDEX idx_email_unique &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; users(email);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Full-Text Index&lt;/h4&gt;&lt;p&gt;Full-text indexes are optimized for text searches, making them ideal for finding keywords within large text fields.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Efficient text searches in fields like descriptions or documents.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt; (in MySQL):&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; FULLTEXT INDEX idx_description &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; products(description);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Clustered Index&lt;/h4&gt;&lt;p&gt;A clustered index sorts and stores the rows of the table based on the indexed columns. Each table can have only one clustered index, and it is often the primary key.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Optimizes performance when the physical order of rows in the table is important.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt; (in SQL Server):&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; CLUSTERED INDEX idx_order_id &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders(order_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Non-Clustered Index&lt;/h4&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A non-clustered index stores pointers to the physical rows in a separate structure. Tables can have multiple non-clustered indexes, which are particularly useful for searching on non-primary key columns.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Optimizes performance on columns that are not part of the primary key.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; NONCLUSTERED INDEX idx_order_date &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders(order_date);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Best Practices for Indexing&lt;/h3&gt;&lt;h4&gt;Index Selective Columns&lt;/h4&gt;&lt;p&gt;Index columns that are frequently used in &lt;code&gt;WHERE&lt;/code&gt;, &lt;code&gt;JOIN&lt;/code&gt;, or &lt;code&gt;ORDER BY&lt;/code&gt; clauses. Avoid indexing columns with low selectivity (e.g., columns with few distinct values like &lt;code&gt;gender&lt;/code&gt;).&lt;/p&gt;&lt;h4&gt;Limit the Number of Indexes&lt;/h4&gt;&lt;p&gt;While indexes improve read performance, they slow down write operations (INSERT, UPDATE, DELETE) because indexes need to be updated. Be cautious not to over-index your tables.&lt;/p&gt;&lt;h4&gt;Use Composite Indexes Wisely&lt;/h4&gt;&lt;p&gt;When creating composite indexes, place the most selective column first. This ensures that the index is effective for queries that filter by just the first column or by multiple columns.&lt;/p&gt;&lt;h4&gt;Index Foreign Keys&lt;/h4&gt;&lt;p&gt;Index foreign key columns to optimize JOIN operations between related tables.&lt;/p&gt;&lt;h4&gt;Avoid Over-Indexing&lt;/h4&gt;&lt;p&gt;Too many indexes can lead to performance degradation. Balance the need for fast read operations with the impact on write performance.&lt;/p&gt;&lt;h2&gt;Query Optimization&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Optimizing queries is crucial for reducing the workload on the database and improving query execution times. The database query optimizer evaluates multiple execution plans and selects the most efficient one based on the query structure.&lt;/p&gt;&lt;h3&gt;1. Write Efficient SQL Queries&lt;/h3&gt;&lt;h4&gt;Avoid SELECT * (Specify Only Needed Columns)&lt;/h4&gt;&lt;p&gt;Selecting all columns (&lt;code&gt;SELECT *&lt;/code&gt;) consumes more resources than necessary. Specify only the columns you need in the result set.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name, email &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; users &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; user_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Use Appropriate Filtering (WHERE Clause)&lt;/h4&gt;&lt;p&gt;Always filter queries to limit the number of rows returned. Avoid full table scans by using indexed columns in the &lt;code&gt;WHERE&lt;/code&gt; clause.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; order_id, order_date &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Avoid Subqueries When Possible (Use JOINs)&lt;/h4&gt;&lt;p&gt;Subqueries, especially correlated subqueries, can be less efficient. Replace them with JOINs where applicable.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Subquery Example (less efficient)&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; id &lt;span class=&quot;hljs-keyword&quot;&gt;IN&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; customer_id &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; order_date &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;2024-01-01&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;JOIN Example (more efficient)&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; c.name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; customers c
&lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; orders o &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; c.id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; o.customer_id
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; o.order_date &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;2024-01-01&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Limit the Number of JOINs&lt;/h4&gt;&lt;p&gt;Queries with many JOINs can be slow. Minimize the number of JOINs by breaking up complex queries or optimizing table design.&lt;/p&gt;&lt;h4&gt;Use Proper Data Types&lt;/h4&gt;&lt;p&gt;Ensure that column data types match the data being stored and compared. Avoid unnecessary data type conversions.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;: If a column is of type INT, avoid comparing it with a VARCHAR value.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. Index-Aware Queries&lt;/h3&gt;&lt;h4&gt;Order By Indexed Columns&lt;/h4&gt;&lt;p&gt;If your query includes an &lt;code&gt;ORDER BY&lt;/code&gt; clause, ensure that the columns being sorted are indexed. This will allow the query to use the index to return results faster.&lt;/p&gt;&lt;h4&gt;Avoid Wildcard Searches with Leading &lt;code&gt;%&lt;/code&gt;&lt;/h4&gt;&lt;p&gt;Queries with wildcards like &lt;code&gt;LIKE &#39;%term%&#39;&lt;/code&gt; prevent the use of indexes, leading to full table scans. Instead, use &lt;code&gt;LIKE &#39;term%&#39;&lt;/code&gt; to leverage indexing.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Better approach&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; products &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; name &lt;span class=&quot;hljs-keyword&quot;&gt;LIKE&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;term%&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. Query Execution Plan&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A query execution plan helps you understand how the database executes a query and can reveal performance bottlenecks. By analyzing the execution plan, you can identify areas for improvement.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to View Execution Plan&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;MySQL&lt;/strong&gt;: Use the &lt;code&gt;EXPLAIN&lt;/code&gt; keyword.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SQL Server&lt;/strong&gt;: Use &lt;code&gt;SET SHOWPLAN_ALL ON;&lt;/code&gt; or query analyzer tools.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt;: Use &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;EXPLAIN &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name, email &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; users &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; user_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This command shows how the query accesses the data, whether it uses indexes, and whether it performs a full table scan.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. Caching and Prepared Statements&lt;/h3&gt;&lt;h4&gt;Query Caching&lt;/h4&gt;&lt;p&gt;Databases like MySQL and PostgreSQL support query caching, which allows frequently executed queries to be cached for faster retrieval on subsequent runs.&lt;/p&gt;&lt;h4&gt;Prepared Statements&lt;/h4&gt;&lt;p&gt;Prepared statements allow the reuse of execution plans, reducing the overhead of repeatedly parsing and compiling SQL statements.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;PREPARE&lt;/span&gt; stmt &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;SELECT name FROM users WHERE user_id = ?&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;General Optimization Tips&lt;/h2&gt;&lt;h3&gt;Use Partitioning&lt;/h3&gt;&lt;p&gt;For very large tables, partitioning the table can improve performance by dividing the data into smaller, manageable segments. Queries can then scan only the relevant partitions, reducing overhead.&lt;/p&gt;&lt;h3&gt;Normalize to Reduce Redundancy&lt;/h3&gt;&lt;p&gt;Normalize your schema to avoid data duplication and improve data integrity. However, be mindful that excessive normalization can lead to performance issues due to too many JOINs.&lt;/p&gt;&lt;h3&gt;Denormalize for Read Performance&lt;/h3&gt;&lt;p&gt;In read-heavy environments, denormalization can improve performance by reducing the need for complex JOINs, though it increases data redundancy.&lt;/p&gt;&lt;h3&gt;Proper Hardware and Scaling&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;As your database grows, consider scaling techniques like sharding, replication, or using read replicas to distribute the load. Proper hardware, including faster storage (e.g., SSDs) and sufficient RAM, also plays a vital role in database performance.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Database optimization is a continuous process that requires balancing the needs for fast read operations, efficient query execution, and minimal resource usage. &lt;strong&gt;Indexing&lt;/strong&gt; is essential for improving data retrieval, while &lt;strong&gt;query optimization&lt;/strong&gt; ensures that the database performs the least amount of work necessary to return the desired results. By following best practices for indexing and query writing, and using tools like execution plans, you can create a robust, efficient, and scalable database system.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/8535768456312756611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/Optimizations-Indexing-Strategies-and-Query-Optimization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/8535768456312756611'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/8535768456312756611'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/Optimizations-Indexing-Strategies-and-Query-Optimization.html' title='Comprehensive Guide to Database Optimizations: Indexing Strategies and Query Optimization'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-4388115199122662905</id><published>2024-09-02T16:13:00.002+05:30</published><updated>2024-09-02T16:13:42.603+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Security and Permissions in SQL: Best Practices and Key Commands</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Security is paramount in any database system. Ensuring that only authorized users can access and manipulate data is critical to maintaining the integrity and confidentiality of information. SQL provides powerful tools for managing users, roles, and permissions. This guide explains essential SQL security commands, including creating users, granting and revoking privileges, altering user properties, and deleting users.&lt;/p&gt;&lt;h2&gt;User Management in SQL&lt;/h2&gt;&lt;h3&gt;CREATE USER&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;CREATE USER&lt;/strong&gt; command is used to add a new user to the database. Each user is identified by a username, a host from which they can connect, and a password.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;username&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;host&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;password&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&#39;username&#39;&lt;/code&gt;: The name of the user.&lt;/li&gt;&lt;li&gt;&lt;code&gt;&#39;host&#39;&lt;/code&gt;: The host or IP address from which the user can connect (use &lt;code&gt;&#39;localhost&#39;&lt;/code&gt; for local connections or &lt;code&gt;&#39;%&#39;&lt;/code&gt; for any host).&lt;/li&gt;&lt;li&gt;&lt;code&gt;&#39;password&#39;&lt;/code&gt;: The password used for authentication.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When a new user needs to interact with the database and requires specific permissions.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;secure_password&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;GRANT&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;GRANT&lt;/strong&gt; command assigns specific privileges to a user or role. This controls what operations the user can perform, such as reading, modifying, or managing data.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; privilege &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; object &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;username&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;host&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;privilege&lt;/code&gt;: The action the user can perform (e.g., SELECT, INSERT, UPDATE, DELETE, ALL PRIVILEGES).&lt;/li&gt;&lt;li&gt;&lt;code&gt;object&lt;/code&gt;: The database object on which the privilege applies (e.g., a table or view).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When you want to grant specific permissions to a user, such as allowing them to read from or write to a table.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.table_name &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Granting All Privileges&lt;/h4&gt;&lt;p&gt;You can grant a user full control over a database or its tables using &lt;code&gt;ALL PRIVILEGES&lt;/code&gt;.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ALL&lt;/span&gt; PRIVILEGES &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;REVOKE&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;REVOKE&lt;/strong&gt; command removes privileges that were previously granted to a user. This is useful for limiting a user&#39;s access after their role or responsibilities change.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;REVOKE&lt;/span&gt; privilege &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; object &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;username&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;host&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When a user no longer needs a specific privilege, such as the ability to modify data.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;REVOKE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.table_name &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Revoking All Privileges&lt;/h4&gt;&lt;p&gt;To revoke all privileges from a user:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;REVOKE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ALL&lt;/span&gt; PRIVILEGES &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;ALTER USER&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;ALTER USER&lt;/strong&gt; command allows you to change a user&#39;s properties, such as their password, authentication method, or account status.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;username&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;host&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;new_password&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When a user’s password needs to be reset or when updating their authentication details.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;new_secure_password&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Locking Accounts&lt;/h4&gt;&lt;p&gt;You can also lock or unlock user accounts to prevent or restore access.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lock an account&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; ACCOUNT LOCK;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unlock an account&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; ACCOUNT UNLOCK;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;DROP USER&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;DROP USER&lt;/strong&gt; command is used to remove a user from the database entirely. Once dropped, the user can no longer connect or interact with the database.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;username&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;host&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: When a user leaves the organization or no longer requires access to the database.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;john_doe&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Best Practices for SQL Security and Permissions&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Principle of Least Privilege&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Always grant users the minimum necessary permissions. By adhering to this principle, you can limit the potential damage in case of a security breach.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:
Grant a user only &lt;code&gt;SELECT&lt;/code&gt; and &lt;code&gt;INSERT&lt;/code&gt; permissions if they only need to view and add data.&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt;, &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.table_name &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;employee&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. &lt;strong&gt;Revoking Unused Privileges&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Regularly audit and revoke privileges that are no longer needed. This minimizes the attack surface and ensures that users do not have more access than required.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:
Revoke a user’s &lt;code&gt;UPDATE&lt;/code&gt; permission if they no longer need to modify data.&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;REVOKE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.table_name &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;employee&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. &lt;strong&gt;Enforce Strong Passwords&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Use strong, unique passwords for database users to prevent unauthorized access. When creating or altering a user, ensure that the password follows best security practices (e.g., at least 12 characters, including letters, numbers, and special characters).&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;alice&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Str0ng!P@ssw0rd&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. &lt;strong&gt;Regularly Change Passwords&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Enforce regular password updates to reduce the risk of compromised credentials.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Example&lt;/strong&gt;:
Use the &lt;code&gt;ALTER USER&lt;/code&gt; command to prompt users to change their passwords regularly:&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;alice&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;new_secure_password&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;5. &lt;strong&gt;Audit and Logging&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Implement auditing and logging of user actions to track changes in permissions and detect unauthorized access attempts. Many database systems offer built-in auditing features or can integrate with external monitoring tools.&lt;/p&gt;&lt;h3&gt;6. &lt;strong&gt;Use Roles for Grouped Permissions&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Rather than assigning permissions to individual users, create roles with predefined permissions and assign users to these roles. This simplifies permission management and ensures consistent privilege levels.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a role&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; ROLE &lt;span class=&quot;hljs-string&quot;&gt;&#39;read_only&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Grant privileges to a role&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; database_name.&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;read_only&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Assign a user to a role&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;read_only&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;alice&#39;&lt;/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;&#39;localhost&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Summary of Key SQL Security Commands&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;table aria-rowcount=&quot;6&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW59716085 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoTableGrid&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack AddInCritiqueBlueLightMode HighContrastShading SCXW59716085 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #47d459; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{77}&quot; paraid=&quot;1703040129&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Command&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack AddInCritiqueBlueLightMode HighContrastShading SCXW59716085 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #47d459; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{86}&quot; paraid=&quot;107689573&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack AddInCritiqueBlueLightMode HighContrastShading SCXW59716085 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #47d459; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: middle; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{95}&quot; paraid=&quot;1370911881&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{104}&quot; paraid=&quot;2043104886&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;CREATE USER&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{113}&quot; paraid=&quot;375367476&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Creates a new user in the database&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{122}&quot; paraid=&quot;1240342570&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;CREATE USER &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;alice&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;password&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{131}&quot; paraid=&quot;1886531305&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;GRANT&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{140}&quot; paraid=&quot;1151370064&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Assigns specific privileges to a user or role&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{149}&quot; paraid=&quot;1819822351&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;GRANT SELECT ON &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;mydb.mytable&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; TO &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;alice&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;@&#39;localhost&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{158}&quot; paraid=&quot;1433855416&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;REVOKE&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{167}&quot; paraid=&quot;543982236&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Removes specific privileges from a user&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{176}&quot; paraid=&quot;1493001849&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;REVOKE INSERT ON &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;mydb.mytable&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; FROM &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;alice&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;@&#39;localhost&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{185}&quot; paraid=&quot;1962886152&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;ALTER USER&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{194}&quot; paraid=&quot;165935373&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Modifies user properties, such as password or account&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{203}&quot; paraid=&quot;222929235&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;ALTER USER &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;alice&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;newpass&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW59716085 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 103px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{212}&quot; paraid=&quot;317259929&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;DROP USER&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 227px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{221}&quot; paraid=&quot;5620710&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Deletes a user from the database&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW59716085 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 242px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW59716085 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{e28d7e9c-a9fa-4268-bbd9-fe941dd47438}{230}&quot; paraid=&quot;748260580&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW59716085 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;DROP USER &#39;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggc3Ryb2tlPSIjMDAwIiBkPSJNMCAzYzEuMjUgMCAxLjI1LTIgMi41LTJTMy43NSAzIDUgMyIvPjxwYXRoIGQ9Ik0wIDBoNXY0SDB6Ii8+PC9nPjwvc3ZnPg==&amp;quot;); background-position: 0px 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;alice&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW59716085 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&#39;@&#39;localhost&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW59716085 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Managing security and permissions in SQL is critical for protecting your database from unauthorized access and ensuring that users only have the rights they need to perform their jobs. By understanding and using commands like &lt;code&gt;CREATE USER&lt;/code&gt;, &lt;code&gt;GRANT&lt;/code&gt;, &lt;code&gt;REVOKE&lt;/code&gt;, &lt;code&gt;ALTER USER&lt;/code&gt;, and &lt;code&gt;DROP USER&lt;/code&gt;, you can control access effectively. Following best practices like enforcing strong passwords, applying the principle of least privilege, and regularly auditing permissions will further strengthen your database security.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/4388115199122662905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/security-and-permissions-in-sql-best.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4388115199122662905'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4388115199122662905'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/security-and-permissions-in-sql-best.html' title='Security and Permissions in SQL: Best Practices and Key Commands'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3682471070285297715</id><published>2024-09-02T16:01:00.000+05:30</published><updated>2024-09-02T16:01:30.675+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Comprehensive Guide to SQL Triggers</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A&amp;nbsp;&lt;strong&gt;Trigger&lt;/strong&gt;&amp;nbsp;in SQL is a special type of stored procedure that automatically executes in response to specific events on a table or view. Triggers play an essential role in maintaining data integrity, enforcing business rules, and automating processes such as logging or auditing changes in a database. This guide covers the types of triggers, their syntax, and use cases with examples.&lt;/p&gt;&lt;h2&gt;Trigger Events&lt;/h2&gt;&lt;p&gt;SQL triggers execute in response to certain events that occur in the database. These events include:&lt;/p&gt;&lt;h3&gt;1. INSERT&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Fires when a new record is inserted into a table.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Automatically updating another table or logging an event whenever a new row is added.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;2. UPDATE&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Fires when an existing record is updated.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Logging changes or validating data before the update takes place.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;3. DELETE&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Fires when a record is deleted from a table.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Enforcing referential integrity by cascading deletions or archiving deleted data.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;4. INSTEAD OF&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: A trigger that can be defined on views to intercept data modification operations (INSERT, UPDATE, DELETE) and provide custom behavior.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Handling complex data modifications on views that are otherwise non-updatable.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Trigger Execution Timing&lt;/h2&gt;&lt;p&gt;Triggers can be executed &lt;strong&gt;before&lt;/strong&gt; or &lt;strong&gt;after&lt;/strong&gt; the event occurs. The timing affects how the trigger interacts with the data.&lt;/p&gt;&lt;h3&gt;BEFORE Trigger&lt;/h3&gt;&lt;p&gt;Executes &lt;strong&gt;before&lt;/strong&gt; the actual action (INSERT, UPDATE, DELETE) takes place.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Validating data or modifying input before it is committed.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;AFTER Trigger&lt;/h3&gt;&lt;p&gt;Executes &lt;strong&gt;after&lt;/strong&gt; the action has been completed.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Logging events or updating another table after the data has been inserted, updated, or deleted.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;SQL Trigger Syntax&lt;/h2&gt;&lt;p&gt;The basic structure for creating a trigger in SQL:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TRIGGER&lt;/span&gt; trigger_name
AFTER &lt;span class=&quot;hljs-operator&quot;&gt;|&lt;/span&gt; BEFORE &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;DELETE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EACH&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;ROW&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-comment&quot;&gt;-- SQL statements to define the trigger’s action&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;Components:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;AFTER | BEFORE&lt;/strong&gt;: Specifies whether the trigger should fire before or after the event.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;INSERT | UPDATE | DELETE&lt;/strong&gt;: Defines the type of event that will activate the trigger.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;FOR EACH ROW&lt;/strong&gt;: Ensures the trigger executes for every affected row in the table.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Trigger Examples&lt;/h2&gt;&lt;h3&gt;Example 1: AFTER INSERT Trigger&lt;/h3&gt;&lt;p&gt;This trigger logs every new order added to the &lt;code&gt;orders&lt;/code&gt; table by inserting a record into the &lt;code&gt;audit_log&lt;/code&gt; table.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TRIGGER&lt;/span&gt; log_order_insert
AFTER &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; orders
&lt;span class=&quot;hljs-keyword&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EACH&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;ROW&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; audit_log (order_id, action, &lt;span class=&quot;hljs-type&quot;&gt;timestamp&lt;/span&gt;)
  &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (NEW.order_id, &lt;span class=&quot;hljs-string&quot;&gt;&#39;INSERT&#39;&lt;/span&gt;, NOW());
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Automatically log every new order for audit purposes. The &lt;code&gt;NEW&lt;/code&gt; keyword refers to the data being inserted into the &lt;code&gt;orders&lt;/code&gt; table.&lt;/p&gt;&lt;h3&gt;Example 2: BEFORE UPDATE Trigger&lt;/h3&gt;&lt;p&gt;This trigger validates that the price of a product cannot be updated to a value less than zero.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TRIGGER&lt;/span&gt; validate_price
BEFORE &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; products
&lt;span class=&quot;hljs-keyword&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EACH&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;ROW&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  IF NEW.price &lt;span class=&quot;hljs-operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;THEN&lt;/span&gt;
    SIGNAL &lt;span class=&quot;hljs-keyword&quot;&gt;SQLSTATE&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;45000&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; MESSAGE_TEXT &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Price cannot be negative&#39;&lt;/span&gt;;
  &lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt; IF;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Ensures that the updated price is not negative by raising an error and stopping the transaction if the validation fails.&lt;/p&gt;&lt;h3&gt;Example 3: AFTER DELETE Trigger&lt;/h3&gt;&lt;p&gt;This trigger archives a customer’s data after they are deleted from the &lt;code&gt;customers&lt;/code&gt; table.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TRIGGER&lt;/span&gt; archive_customer_deletions
AFTER &lt;span class=&quot;hljs-keyword&quot;&gt;DELETE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customers
&lt;span class=&quot;hljs-keyword&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EACH&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;ROW&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; customers_archive (customer_id, name, deleted_at)
  &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (OLD.customer_id, OLD.name, NOW());
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Moves deleted customer data to the &lt;code&gt;customers_archive&lt;/code&gt; table for future reference. The &lt;code&gt;OLD&lt;/code&gt; keyword refers to the data being deleted.&lt;/p&gt;&lt;h3&gt;Example 4: INSTEAD OF Trigger&lt;/h3&gt;&lt;p&gt;This trigger modifies how an &lt;code&gt;UPDATE&lt;/code&gt; on a view is handled, allowing the update of data in the underlying &lt;code&gt;customers&lt;/code&gt; table.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TRIGGER&lt;/span&gt; modify_view_update
INSTEAD &lt;span class=&quot;hljs-keyword&quot;&gt;OF&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; customer_view
&lt;span class=&quot;hljs-keyword&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;EACH&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;ROW&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; customers
  &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; NEW.name, email &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; NEW.email
  &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; NEW.customer_id;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;: Allows updates on a view that includes multiple tables, ensuring that the changes are made directly on the base table.&lt;/p&gt;&lt;h2&gt;Advantages of Triggers&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Automatic Execution&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers execute automatically in response to specific events. This reduces the need for manual intervention, ensuring that actions like logging or validation happen consistently.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Data Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers can enforce complex business rules and data validation checks, ensuring that only valid data is entered or modified in the database.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Auditing and Logging&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers are ideal for maintaining an audit trail of changes to the data. This is essential for systems that require tracking of all data modifications for security or compliance purposes.&lt;/p&gt;&lt;h3&gt;4. &lt;strong&gt;Enforcing Complex Business Logic&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers can enforce complex business logic at the database level, reducing the need for application-level validation.&lt;/p&gt;&lt;h2&gt;Considerations and Caveats&lt;/h2&gt;&lt;p&gt;While triggers offer numerous benefits, there are some potential drawbacks to keep in mind.&lt;/p&gt;&lt;h3&gt;1. &lt;strong&gt;Performance Impact&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers can slow down data modifications, especially if they involve complex logic or interact with other tables. Overusing triggers or chaining multiple triggers can lead to performance degradation.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Complex Debugging&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Since triggers execute automatically, they can sometimes make debugging more difficult, particularly when multiple triggers are involved or when triggers invoke other triggers.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Cascading Effects&lt;/strong&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Triggers that call other triggers can lead to unintended cascading effects. For example, a delete operation could trigger another delete, which triggers yet another delete, causing complex chains of operations.&lt;/p&gt;&lt;h2&gt;Practical Use Cases for Triggers&lt;/h2&gt;&lt;h3&gt;1. &lt;strong&gt;Audit Logging&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers are widely used for maintaining logs of every insert, update, or delete operation performed on a table. This ensures that changes to important data are tracked and can be reviewed later.&lt;/p&gt;&lt;h3&gt;2. &lt;strong&gt;Maintaining Referential Integrity&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;When a parent record is deleted, triggers can enforce referential integrity by ensuring that related records in child tables are also deleted or archived.&lt;/p&gt;&lt;h3&gt;3. &lt;strong&gt;Data Validation&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;BEFORE triggers can be used to validate data before it is inserted or updated in a table, ensuring that only valid data is accepted.&lt;/p&gt;&lt;h3&gt;4. &lt;strong&gt;Automated Calculations&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Triggers can automatically update derived fields or compute values when specific changes are made to the data.&lt;/p&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;What is a trigger in SQL?&lt;/strong&gt;
A trigger is a special stored procedure that automatically executes in response to certain events on a table or view, such as inserts, updates, or deletes.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;How do AFTER and BEFORE triggers differ?&lt;/strong&gt;
AFTER triggers execute after the data modification event, while BEFORE triggers execute before the event, allowing you to modify or validate data before it is saved.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is an INSTEAD OF trigger used for?&lt;/strong&gt;
An INSTEAD OF trigger is used on views to intercept DML operations (INSERT, UPDATE, DELETE) and replace them with custom behavior.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can triggers slow down performance?&lt;/strong&gt;
Yes, overuse of triggers or complex trigger logic can lead to performance issues, especially when multiple triggers are fired in response to an event.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How do NEW and OLD keywords work in triggers?&lt;/strong&gt;
&lt;code&gt;NEW&lt;/code&gt; refers to the new data being inserted or updated, while &lt;code&gt;OLD&lt;/code&gt; refers to the data being deleted or before it is updated.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can triggers invoke other triggers?&lt;/strong&gt;
Yes, triggers can invoke other triggers, which can lead to cascading effects. Care must be taken to avoid complex and unintended execution chains.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Triggers are a powerful feature in SQL that allows you to automate responses to data changes, ensuring that business rules and data integrity are enforced at the database level. With careful use, they can simplify tasks like logging, auditing, and enforcing constraints. However, their potential for performance impact and complex debugging must be considered when designing database systems.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3682471070285297715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/comprehensive-guide-to-sql-triggers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3682471070285297715'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3682471070285297715'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/comprehensive-guide-to-sql-triggers.html' title='Comprehensive Guide to SQL Triggers'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-4298475350507846187</id><published>2024-09-01T15:29:00.002+05:30</published><updated>2024-09-01T15:32:34.204+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Mastering SQL Stored Procedures and User-Defined Functions (UDFs)</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Stored procedures and user-defined functions (UDFs) are essential tools in SQL for encapsulating frequently used SQL logic, enhancing performance, and improving database security. Stored procedures allow you to execute precompiled SQL statements, while UDFs return specific values or tables that can be used within queries. This guide covers the syntax, use cases, and key differences between stored procedures and UDFs.&lt;/p&gt;&lt;h2&gt;What is a Stored Procedure in SQL?&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A &lt;strong&gt;Stored Procedure&lt;/strong&gt; is a precompiled set of SQL statements that can be executed on demand. Stored procedures help in reusing SQL code, improving performance, and enhancing security by allowing users to interact with the database without directly accessing the underlying tables.&lt;/p&gt;&lt;h3&gt;Benefits of Stored Procedures:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: Encapsulate frequently used SQL logic.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Precompiled procedures reduce the execution time.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: Users can execute procedures without having direct access to the underlying data.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;CREATE PROCEDURE&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;CREATE PROCEDURE&lt;/strong&gt; statement is used to define a new stored procedure.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; procedure_name
[ (parameter1 datatype, parameter2 datatype, ...) ]
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-comment&quot;&gt;-- SQL statements&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; GetCustomerBalance
  &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; balance
  &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; accounts
  &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This procedure retrieves the balance of a customer by their ID.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;ALTER PROCEDURE&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;ALTER PROCEDURE&lt;/strong&gt; statement modifies an existing stored procedure.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; procedure_name
[ (parameter1 datatype, parameter2 datatype, ...) ]
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-comment&quot;&gt;-- Modified SQL statements&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; GetCustomerBalance
  &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; balance, account_type
  &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; accounts
  &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This alteration adds &lt;code&gt;account_type&lt;/code&gt; to the result set.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;DROP PROCEDURE&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;DROP PROCEDURE&lt;/strong&gt; statement is used to delete an existing stored procedure.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; procedure_name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;PROCEDURE&lt;/span&gt; GetCustomerBalance;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This command deletes the &lt;code&gt;GetCustomerBalance&lt;/code&gt; procedure from the database.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;EXECUTE PROCEDURE&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;EXECUTE PROCEDURE&lt;/strong&gt; (or simply &lt;strong&gt;EXEC&lt;/strong&gt;) statement runs an existing stored procedure.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;EXEC&lt;/span&gt; procedure_name [ (parameter1, parameter2, ...) ];
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;EXEC&lt;/span&gt; GetCustomerBalance &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;123&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This command executes the &lt;code&gt;GetCustomerBalance&lt;/code&gt; procedure for a customer with an ID of 123.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;User-Defined Functions (UDFs)&lt;/h2&gt;&lt;p&gt;A &lt;strong&gt;User-Defined Function (UDF)&lt;/strong&gt; is a block of code that performs a specific task and returns either a scalar value or a table. Unlike stored procedures, UDFs can be used within SQL queries, such as in a &lt;code&gt;SELECT&lt;/code&gt; or &lt;code&gt;WHERE&lt;/code&gt; clause.&lt;/p&gt;&lt;h3&gt;Types of UDFs:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Scalar UDF&lt;/strong&gt;: Returns a single value.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Table-Valued UDF&lt;/strong&gt;: Returns a set of rows in the form of a table.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Scalar UDF&lt;/h3&gt;&lt;p&gt;A scalar UDF returns a single value (e.g., an integer, a string).&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FUNCTION&lt;/span&gt; function_name
( &lt;span class=&quot;hljs-variable&quot;&gt;@param1&lt;/span&gt; datatype )
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURNS&lt;/span&gt; datatype
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-comment&quot;&gt;-- Logic to return a single value&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;RETURN&lt;/span&gt; (single_value);
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FUNCTION&lt;/span&gt; GetFullName
(
  &lt;span class=&quot;hljs-variable&quot;&gt;@firstName&lt;/span&gt; NVARCHAR(&lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;),
  &lt;span class=&quot;hljs-variable&quot;&gt;@lastName&lt;/span&gt; NVARCHAR(&lt;span class=&quot;hljs-number&quot;&gt;50&lt;/span&gt;)
)
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURNS&lt;/span&gt; NVARCHAR(&lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;
  &lt;span class=&quot;hljs-keyword&quot;&gt;RETURN&lt;/span&gt; (&lt;span class=&quot;hljs-variable&quot;&gt;@firstName&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;@lastName&lt;/span&gt;);
&lt;span class=&quot;hljs-keyword&quot;&gt;END&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This UDF concatenates a first name and last name into a full name.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Table-Valued UDF&lt;/h3&gt;&lt;p&gt;A table-valued UDF returns a result set, similar to a table.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FUNCTION&lt;/span&gt; function_name
( &lt;span class=&quot;hljs-variable&quot;&gt;@param1&lt;/span&gt; datatype )
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURNS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURN&lt;/span&gt;
(
  &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
  &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
  &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;FUNCTION&lt;/span&gt; GetCustomerAccounts
( &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt; &lt;span class=&quot;hljs-type&quot;&gt;INT&lt;/span&gt; )
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURNS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TABLE&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;RETURN&lt;/span&gt;
(
  &lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; account_id, balance
  &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; accounts
  &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; customer_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-variable&quot;&gt;@customerId&lt;/span&gt;
);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This function returns a table of accounts and balances for a given customer.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Key Differences Between Stored Procedures and User-Defined Functions&lt;/h2&gt;&lt;h2&gt;&lt;div class=&quot;OutlineElement Ltr SCXW96478732 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Segoe UI Web&amp;quot;, Arial, Verdana, sans-serif; font-size: 12px; font-weight: 400; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;div class=&quot;TableContainer Ltr SCXW96478732 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; display: flex; justify-content: flex-start; margin: 2px 0px 2px -5px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;table aria-rowcount=&quot;6&quot; border=&quot;0&quot; class=&quot;Table Ltr TableWordWrap SCXW117511614 BCX0&quot; data-tablelook=&quot;1696&quot; data-tablestyle=&quot;MsoTableGrid&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background: transparent; border-collapse: collapse; border-spacing: 0px; color: black; empty-cells: show; font-size: 12px; margin: 0px; overflow: visible; padding: 0px; position: relative; table-layout: fixed; user-select: text; width: 0px;&quot;&gt;&lt;tbody class=&quot;SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;tr aria-rowindex=&quot;1&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstRow FirstCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW117511614 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{74}&quot; paraid=&quot;1973951985&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Feature&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW117511614 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{81}&quot; paraid=&quot;466103368&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Stored Procedure&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;FirstRow LastCol AdvancedProofingBlack ContextualSpellingBlack SpellingErrorBlack SimilarityReviewedBlack SimilarityUnreviewedBlack AddInCritiqueBlack HighContrastShading SCXW117511614 BCX0&quot; data-celllook=&quot;69905&quot; role=&quot;columnheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: #00b050; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{88}&quot; paraid=&quot;1322521121&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;User-Defined Function&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;2&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{95}&quot; paraid=&quot;140516313&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Returns&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{102}&quot; paraid=&quot;1996249026&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can return multiple result sets or no result&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{109}&quot; paraid=&quot;344903550&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Scalar UDF returns a single value, Table UDF returns a table&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;3&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{116}&quot; paraid=&quot;1366680647&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Parameters&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{123}&quot; paraid=&quot;2143928626&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can accept input/output parameters&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{130}&quot; paraid=&quot;1899965721&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Accepts input parameters only&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;4&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{137}&quot; paraid=&quot;746386352&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Usage in Queries&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{144}&quot; paraid=&quot;1335705464&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cannot be called from within a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;statement&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{151}&quot; paraid=&quot;373753971&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can be called from a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;, or&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: Consolas, Consolas_EmbeddedFont, Consolas_MSFontService, monospace; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;JOIN&lt;/span&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;clause&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;5&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{158}&quot; paraid=&quot;937306824&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Modification of Data&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{165}&quot; paraid=&quot;351184462&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can modify data (INSERT, UPDATE, DELETE)&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{172}&quot; paraid=&quot;1527482875&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cannot modify data&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr aria-rowindex=&quot;6&quot; class=&quot;TableRow SCXW117511614 BCX0&quot; role=&quot;row&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; height: 20px; margin: 0px; overflow: visible; padding: 0px; user-select: text;&quot;&gt;&lt;td class=&quot;FirstCol LastRow SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; role=&quot;rowheader&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 106px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{179}&quot; paraid=&quot;1294694641&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: bold; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Transaction Handling&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastRow SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 186px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{186}&quot; paraid=&quot;263049962&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Can manage transactions (COMMIT, ROLLBACK)&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;LastCol LastRow SCXW117511614 BCX0&quot; data-celllook=&quot;4369&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-clip: padding-box; background-color: transparent; border: 2px solid rgb(0, 0, 0); margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text; vertical-align: top; width: 210px;&quot;&gt;&lt;div class=&quot;TableCellContent SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; overflow: visible; padding: 0px 7px; user-select: text;&quot;&gt;&lt;div class=&quot;OutlineElement Ltr SCXW117511614 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW117511614 BCX0&quot; lang=&quot;EN-US&quot; paraeid=&quot;{76fee18c-0aeb-41a6-8d9b-0543e87da804}{193}&quot; paraid=&quot;1091614924&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space-collapse: preserve;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;TextRun SCXW117511614 BCX0&quot; data-contrast=&quot;auto&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: windowtext !important; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variant-position: normal; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;Cannot include transaction management&lt;/span&gt;&lt;span class=&quot;EOP SCXW117511614 BCX0&quot; data-ccp-props=&quot;{&amp;quot;134233117&amp;quot;:false,&amp;quot;134233118&amp;quot;:false,&amp;quot;201341983&amp;quot;:0,&amp;quot;335551550&amp;quot;:0,&amp;quot;335551620&amp;quot;:0,&amp;quot;335559738&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:279}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: &amp;quot;Times New Roman&amp;quot;, &amp;quot;Times New Roman_EmbeddedFont&amp;quot;, &amp;quot;Times New Roman_MSFontService&amp;quot;, serif; font-size: 12pt; line-height: 20.925px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;TableContainer Ltr SCXW96478732 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; display: flex; justify-content: flex-start; margin: 2px 0px 2px -5px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;TableContainer Ltr SCXW96478732 BCX0&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; display: flex; justify-content: flex-start; margin: 2px 0px 2px -5px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;Practical Use Cases of Stored Procedures and UDFs&lt;/h2&gt;&lt;h3&gt;Stored Procedures for Business Logic&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Stored procedures are ideal for encapsulating complex business logic that involves multiple operations like data validation, transaction handling, and batch processing. For example, a stored procedure can be used to transfer funds between accounts by performing multiple &lt;code&gt;UPDATE&lt;/code&gt; statements and ensuring all operations succeed before committing.&lt;/p&gt;&lt;h3&gt;UDFs for Simplified Query Logic&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;User-defined functions are useful for simplifying query logic. For instance, you can use a scalar UDF to calculate tax or discounts and apply the result in multiple queries. Similarly, table-valued UDFs can replace common subqueries, making queries more readable and maintainable.&lt;/p&gt;&lt;h3&gt;Security and Permission Control&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Stored procedures and UDFs help secure databases by allowing users to execute functions and procedures without giving them direct access to tables. This is particularly important in systems where only specific data should be exposed.&lt;/p&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;What is the difference between a stored procedure and a UDF?&lt;/strong&gt;
A stored procedure can perform multiple actions, modify data, and return multiple result sets. UDFs return a single value (scalar) or a table and cannot modify data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can I modify data with a UDF?&lt;/strong&gt;
No, UDFs are read-only functions. They cannot perform &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, or &lt;code&gt;DELETE&lt;/code&gt; operations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How do I call a UDF in SQL?&lt;/strong&gt;
You can call a UDF in a &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;WHERE&lt;/code&gt;, or &lt;code&gt;JOIN&lt;/code&gt; clause. For example:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; GetFullName(first_name, last_name) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;When should I use a stored procedure over a UDF?&lt;/strong&gt;
Use stored procedures when you need to perform actions that modify the database, such as inserting or updating data. Use UDFs when you need to encapsulate logic that returns a value or table for use in queries.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can I use transactions in UDFs?&lt;/strong&gt;
No, UDFs do not support transaction management. Only stored procedures can manage transactions using &lt;code&gt;COMMIT&lt;/code&gt; and &lt;code&gt;ROLLBACK&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can stored procedures return multiple result sets?&lt;/strong&gt;
Yes, stored procedures can return multiple result sets, while UDFs are limited to returning a single value or table.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Both stored procedures and user-defined functions (UDFs) are powerful tools for improving SQL code organization, performance, and security. Stored procedures are best suited for managing complex business logic and data manipulation, while UDFs offer flexibility in queries without modifying the underlying data. Understanding the differences and use cases will help you use them effectively in your database applications.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/4298475350507846187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/09/sql-stored-procedures-and-UDFs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4298475350507846187'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4298475350507846187'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/09/sql-stored-procedures-and-UDFs.html' title='Mastering SQL Stored Procedures and User-Defined Functions (UDFs)'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3026139867206460193</id><published>2024-08-31T18:19:00.001+05:30</published><updated>2024-08-31T18:20:40.510+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Comprehensive Guide to SQL Transactions and ACID Properties</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Transactions are crucial in SQL for maintaining data integrity, consistency, and reliability, especially in environments where multiple users may be accessing or modifying data simultaneously. This guide delves into the key concepts of transactions, including the ACID properties, and explains the use of essential SQL commands such as&amp;nbsp;&lt;code&gt;COMMIT&lt;/code&gt;,&amp;nbsp;&lt;code&gt;ROLLBACK&lt;/code&gt;, and&amp;nbsp;&lt;code&gt;SAVEPOINT&lt;/code&gt;.&lt;/p&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/AVvXsEj7wRVO1Sl1c333nSApBChHAkwjjD18q72jBNcQkp1No7d3R1EVje6nhCsUxTD1s9y-6b0BnHgaLwScbtzaHthZhxqzpODGe7kbpWSdLX-_MakVBQIdYUKe7e615MDucc_MF073gCz0i4Cd99arktOEu61R5XZOAoIfSoVU6Jc8dhV4pW7dqMJfOiHCcQaR/s1792/Designer%20(6).jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;SQL Transactions and ACID Properties&quot; border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1792&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7wRVO1Sl1c333nSApBChHAkwjjD18q72jBNcQkp1No7d3R1EVje6nhCsUxTD1s9y-6b0BnHgaLwScbtzaHthZhxqzpODGe7kbpWSdLX-_MakVBQIdYUKe7e615MDucc_MF073gCz0i4Cd99arktOEu61R5XZOAoIfSoVU6Jc8dhV4pW7dqMJfOiHCcQaR/w640-h366/Designer%20(6).jpeg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;ACID Properties in Transactions&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;ACID properties are the foundation of reliable transaction processing in a database. These properties ensure that each transaction is handled in a way that maintains the integrity of the database even in complex, multi-user scenarios.&lt;/p&gt;&lt;h3&gt;1. Atomicity&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Atomicity ensures that all operations within a transaction are treated as a single, indivisible unit. If any operation in the transaction fails, the entire transaction is rolled back, and no changes are made to the database.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Example&lt;/strong&gt;:
Imagine a transaction transferring money between two bank accounts. If the debit from one account succeeds but the credit to the other fails, the entire transaction is rolled back to prevent data inconsistency.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;;
&lt;span class=&quot;hljs-comment&quot;&gt;-- If any of these updates fail, the transaction will be rolled back.&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;2. Consistency&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Consistency ensures that the database transitions from one valid state to another after the completion of a transaction. All database constraints, triggers, and rules must be satisfied after the transaction is executed.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:
If a transaction violates a foreign key constraint, the database remains in its previous consistent state by rolling back the changes.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;INTO&lt;/span&gt; orders (order_id, customer_id) &lt;span class=&quot;hljs-keyword&quot;&gt;VALUES&lt;/span&gt; (&lt;span class=&quot;hljs-number&quot;&gt;101&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot;&gt;2001&lt;/span&gt;);
&lt;span class=&quot;hljs-comment&quot;&gt;-- Assuming customer_id 2001 does not exist in the customers table, this violates a foreign key constraint.&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ROLLBACK&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;3. Isolation&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Isolation ensures that the operations of one transaction are invisible to other transactions until the transaction is complete. This prevents issues like dirty reads, where one transaction reads uncommitted data from another.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:
If two users are performing transactions simultaneously, neither should see the intermediate state of the other&#39;s transaction.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; products &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; stock &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; stock &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; product_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;101&lt;/span&gt;;
&lt;span class=&quot;hljs-comment&quot;&gt;-- This update is not visible to other transactions until the COMMIT is issued.&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;4. Durability&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Durability guarantees that once a transaction is committed, its changes are permanent and will persist even in the event of a system crash. The database writes the changes to disk or other stable storage before finalizing the transaction.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:
If a system crashes immediately after a transaction commits, the committed changes remain intact when the system restarts.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;
&lt;span class=&quot;hljs-comment&quot;&gt;-- Even if the system crashes after this point, the changes remain permanent.&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h2&gt;Transaction Control in SQL&lt;/h2&gt;&lt;h3&gt;COMMIT&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The &lt;code&gt;COMMIT&lt;/code&gt; statement is used to finalize a transaction, making all changes made during the transaction permanent in the database.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This transaction transfers money between two accounts and commits the changes, ensuring they are saved permanently.&lt;/p&gt;&lt;h3&gt;ROLLBACK&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The &lt;code&gt;ROLLBACK&lt;/code&gt; statement undoes all the changes made during the current transaction, effectively reverting the database to its previous state before the transaction began.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;ROLLBACK&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;If an error occurs during the transaction, the &lt;code&gt;ROLLBACK&lt;/code&gt; ensures that no changes are made to the accounts.&lt;/p&gt;&lt;h3&gt;SAVEPOINT&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: A &lt;code&gt;SAVEPOINT&lt;/code&gt; sets a specific point within a transaction that allows you to roll back part of the transaction without affecting the entire transaction.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;BEGIN&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;SAVEPOINT&lt;/span&gt; transfer_part_1;
&lt;span class=&quot;hljs-keyword&quot;&gt;UPDATE&lt;/span&gt; accounts &lt;span class=&quot;hljs-keyword&quot;&gt;SET&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; balance &lt;span class=&quot;hljs-operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; account_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;2&lt;/span&gt;;
&lt;span class=&quot;hljs-keyword&quot;&gt;SAVEPOINT&lt;/span&gt; transfer_part_2;
&lt;span class=&quot;hljs-comment&quot;&gt;-- If an error occurs, rollback to the first savepoint.&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;ROLLBACK&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;TO&lt;/span&gt; transfer_part_1;
&lt;span class=&quot;hljs-keyword&quot;&gt;COMMIT&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, if something goes wrong after the second update, you can roll back to the first savepoint without undoing the entire transaction.&lt;/p&gt;&lt;h2&gt;Practical Applications of Transaction Control&lt;/h2&gt;&lt;h3&gt;Ensuring Data Integrity in Financial Transactions&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;In financial systems, ensuring atomicity is critical. For instance, when transferring funds between accounts, you must ensure that both debit and credit operations are completed successfully. If either fails, the transaction is rolled back.&lt;/p&gt;&lt;h3&gt;Handling Multi-Step Data Updates&lt;/h3&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;When performing complex updates involving multiple steps, &lt;code&gt;SAVEPOINT&lt;/code&gt; is useful to roll back only part of the transaction. For example, in inventory management systems, you may update stock levels and prices. If updating the stock succeeds but updating prices fails, you can revert only the price update.&lt;/p&gt;&lt;h3&gt;Preventing Data Corruption in Multi-User Environments&lt;/h3&gt;&lt;p&gt;In a multi-user environment, isolation prevents one user&#39;s transaction from interfering with another&#39;s. By controlling the isolation level, you can strike a balance between transaction performance and consistency.&lt;/p&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;What are ACID properties in a database transaction?&lt;/strong&gt;
ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties ensure that transactions are processed reliably in a database system, maintaining data integrity and consistency.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;What is the difference between COMMIT and ROLLBACK?&lt;/strong&gt;
&lt;code&gt;COMMIT&lt;/code&gt; makes all changes made during the transaction permanent, while &lt;code&gt;ROLLBACK&lt;/code&gt; undoes all the changes, reverting the database to its previous state.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;When should I use a SAVEPOINT?&lt;/strong&gt;
A &lt;code&gt;SAVEPOINT&lt;/code&gt; is used when you want to set a checkpoint within a transaction, allowing partial rollbacks without discarding the entire transaction.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How does isolation work in SQL transactions?&lt;/strong&gt;
Isolation ensures that transactions are independent of each other. The isolation level controls the degree to which the operations of one transaction are visible to others before they are committed.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;What happens if a transaction is not committed?&lt;/strong&gt;
If a transaction is not committed, its changes are not made permanent. In most cases, those changes are lost if the transaction is rolled back or the session ends.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How does durability work in a transaction?&lt;/strong&gt;
Durability ensures that once a transaction is committed, its changes are stored permanently, even if the system crashes immediately after the commit.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Mastering SQL transactions and understanding ACID properties is crucial for ensuring data integrity and reliability in any database system. By using transaction control commands like &lt;code&gt;COMMIT&lt;/code&gt;, &lt;code&gt;ROLLBACK&lt;/code&gt;, and &lt;code&gt;SAVEPOINT&lt;/code&gt;, you can manage complex operations while maintaining a consistent and reliable database environment.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3026139867206460193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/08/SQL-Transactions-and-ACID-Properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3026139867206460193'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3026139867206460193'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/08/SQL-Transactions-and-ACID-Properties.html' title='Comprehensive Guide to SQL Transactions and ACID Properties'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7wRVO1Sl1c333nSApBChHAkwjjD18q72jBNcQkp1No7d3R1EVje6nhCsUxTD1s9y-6b0BnHgaLwScbtzaHthZhxqzpODGe7kbpWSdLX-_MakVBQIdYUKe7e615MDucc_MF073gCz0i4Cd99arktOEu61R5XZOAoIfSoVU6Jc8dhV4pW7dqMJfOiHCcQaR/s72-w640-h366-c/Designer%20(6).jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-3252204762534887463</id><published>2024-08-11T20:08:00.003+05:30</published><updated>2024-08-11T20:14:30.463+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Mastering SQL Views: Creation, Modification, and Deletion</title><content type='html'>&lt;h2&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;SQL views are powerful tools in database management that allow you to simplify complex queries, abstract database schemas, and enhance data security. By creating views, you can encapsulate logic and expose only necessary data to users, making it easier to manage and interact with large databases. This article will guide you through the process of creating, modifying, and dropping views in SQL, complete with examples and best practices.&lt;/p&gt;&lt;br /&gt;&lt;br /&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/AVvXsEjE68voia8Fpnw_UK_ayuGVoR53cLqnQOZetpApTFDzbqM0obQauDgnwsN9B2qof6ywhmOJhD3rlcBghES0UdMEQ5SetcT9xG6bazCwyP2CVltGNTTjn7mVZ9KaTgqMEvXaKOXJv2U2lArXtssonkDhyphenhypheni4vr0BJINoEQOA5vY4TfQQMDLJ_OjW1YF7hi92F/s2688/Firefly%20SQL%2071045.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;SQL View&quot; border=&quot;0&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2688&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE68voia8Fpnw_UK_ayuGVoR53cLqnQOZetpApTFDzbqM0obQauDgnwsN9B2qof6ywhmOJhD3rlcBghES0UdMEQ5SetcT9xG6bazCwyP2CVltGNTTjn7mVZ9KaTgqMEvXaKOXJv2U2lArXtssonkDhyphenhypheni4vr0BJINoEQOA5vY4TfQQMDLJ_OjW1YF7hi92F/w640-h366/Firefly%20SQL%2071045.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;&lt;strong&gt;What is a SQL View?&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A SQL view is a virtual table that is generated from a SELECT query. Unlike a physical table, a view does not store data; it simply provides a way to present and interact with data that is retrieved from one or more tables. Views can be used to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Simplify complex queries by breaking them into manageable parts.&lt;/li&gt;&lt;li&gt;Abstract and hide the underlying database schema.&lt;/li&gt;&lt;li&gt;Enhance security by restricting access to specific data.&lt;/li&gt;&lt;li&gt;Present data in a particular format or structure.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;Creating Views in SQL&lt;/strong&gt;&lt;/h2&gt;&lt;h3&gt;&lt;strong&gt;Understanding the Purpose of Views&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Views are essential in scenarios where you need to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Present aggregated or calculated data.&lt;/li&gt;&lt;li&gt;Combine data from multiple tables.&lt;/li&gt;&lt;li&gt;Implement data security by limiting user access to specific columns or rows.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;strong&gt;Syntax for Creating Views&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;To create a view, use the &lt;code&gt;CREATE VIEW&lt;/code&gt; statement, followed by the view name and the SELECT query that defines the data the view will present.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; view_name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; column1, column2, ...
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;&lt;strong&gt;Example: Creating a Basic View&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Let’s create a view that displays employee details for those in the Sales department.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; EmployeeView &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; EmployeeID, FirstName, LastName, Department
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; Employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; Department &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Sales&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, &lt;code&gt;EmployeeView&lt;/code&gt; will display the &lt;code&gt;EmployeeID&lt;/code&gt;, &lt;code&gt;FirstName&lt;/code&gt;, &lt;code&gt;LastName&lt;/code&gt;, and &lt;code&gt;Department&lt;/code&gt; columns for employees who work in the Sales department.&lt;/p&gt;&lt;h3&gt;&lt;strong&gt;Complex View Creation&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;You can create more complex views that involve joins, subqueries, and aggregations. Here’s an example of a view that joins two tables:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; SalesSummary &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e.EmployeeID, e.FirstName, &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(o.OrderTotal) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; TotalSales
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; Employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; Orders o &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.EmployeeID &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; o.EmployeeID
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; e.EmployeeID, e.FirstName;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This view, &lt;code&gt;SalesSummary&lt;/code&gt;, shows each employee’s total sales by joining the &lt;code&gt;Employees&lt;/code&gt; and &lt;code&gt;Orders&lt;/code&gt; tables.&lt;/p&gt;&lt;h2&gt;&lt;strong&gt;Modifying Views in SQL&lt;/strong&gt;&lt;/h2&gt;&lt;h3&gt;&lt;strong&gt;Why Modify a View?&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;You may need to modify a view to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Add or remove columns.&lt;/li&gt;&lt;li&gt;Change the logic of the query.&lt;/li&gt;&lt;li&gt;Adjust to changes in the underlying tables.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;strong&gt;Syntax for Modifying Views&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;ALTER VIEW&lt;/code&gt; statement is used to modify an existing view. However, in many SQL implementations, you typically drop the view and recreate it with the necessary changes.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; view_name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; column1, column2, ...
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;&lt;strong&gt;Example: Modifying a View&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Suppose we want to add the &lt;code&gt;Salary&lt;/code&gt; column to the existing &lt;code&gt;EmployeeView&lt;/code&gt;.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; EmployeeView &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; EmployeeID, FirstName, LastName, Department, Salary
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; Employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; Department &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Sales&#39;&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This modification allows &lt;code&gt;EmployeeView&lt;/code&gt; to include the &lt;code&gt;Salary&lt;/code&gt; column, providing more detailed information about each employee in the Sales department.&lt;/p&gt;&lt;h3&gt;&lt;strong&gt;Best Practices for Modifying Views&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Always ensure that the modification aligns with the underlying table structures.&lt;/li&gt;&lt;li&gt;Test the modified view in a development environment before applying it to production.&lt;/li&gt;&lt;li&gt;Keep a backup of the original view definition in case you need to revert changes.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;Dropping Views in SQL&lt;/strong&gt;&lt;/h2&gt;&lt;h3&gt;&lt;strong&gt;Why Drop a View?&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;Dropping a view may be necessary when:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The view is no longer needed.&lt;/li&gt;&lt;li&gt;The underlying table structures have changed significantly.&lt;/li&gt;&lt;li&gt;Performance optimizations require restructuring how data is queried.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;strong&gt;Syntax for Dropping Views&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;To delete a view, use the &lt;code&gt;DROP VIEW&lt;/code&gt; statement.&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; view_name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3&gt;&lt;strong&gt;Example: Dropping a View&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;If &lt;code&gt;EmployeeView&lt;/code&gt; is no longer required, you can drop it using the following command:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;VIEW&lt;/span&gt; EmployeeView;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This statement removes &lt;code&gt;EmployeeView&lt;/code&gt; from the database.&lt;/p&gt;&lt;h3&gt;&lt;strong&gt;Precautions Before Dropping a View&lt;/strong&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ensure that no critical application or query relies on the view.&lt;/li&gt;&lt;li&gt;Consider renaming the view temporarily to check for dependencies.&lt;/li&gt;&lt;li&gt;Document the reason for dropping the view for future reference.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;Benefits of Using Views&lt;/strong&gt;&lt;/h2&gt;&lt;p&gt;Views offer several advantages, including:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Simplification&lt;/strong&gt;: Views can encapsulate complex joins and calculations, presenting a simplified interface to users.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: By restricting columns and rows, views can limit user access to sensitive data.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: Once created, views can be reused across multiple queries, reducing code duplication.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Maintainability&lt;/strong&gt;: Views can abstract changes in the underlying schema, so updates to the database structure don’t necessarily affect end-user queries.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;When to Use Views?&lt;/strong&gt;&lt;/h2&gt;&lt;p&gt;Consider using views when:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;You need to present data in a specific format or with specific filters.&lt;/li&gt;&lt;li&gt;You want to provide a simplified interface to complex data structures.&lt;/li&gt;&lt;li&gt;Security requirements demand restricted access to certain data.&lt;/li&gt;&lt;li&gt;You are implementing a reporting system that requires frequent aggregation and summarization of data.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;Performance Considerations&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;While views can simplify and secure data access, they can also introduce performance overhead, especially if the view involves complex joins or aggregations. Here are some tips to optimize view performance:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Avoid using views on top of other views, as this can lead to poor performance.&lt;/li&gt;&lt;li&gt;Use indexed views if the SQL implementation supports them, which can improve query performance.&lt;/li&gt;&lt;li&gt;Regularly monitor and analyze the performance of queries that use views, and refactor them if necessary.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;Common Use Cases for SQL Views&lt;/strong&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Reporting&lt;/strong&gt;: Creating views that aggregate and format data for reports.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: Restricting access to sensitive data by exposing only certain columns or rows.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Data Abstraction&lt;/strong&gt;: Hiding the complexity of underlying table structures from end users.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Data Transformation&lt;/strong&gt;: Providing a transformed or calculated version of the data without altering the original tables.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;&lt;strong&gt;FAQs&lt;/strong&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;What are the limitations of using views in SQL?&lt;/strong&gt;
Views cannot contain certain types of subqueries, and in some SQL implementations, they cannot be updated directly. Additionally, performance can suffer if views are overly complex or layered on top of each other.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can a view be indexed?&lt;/strong&gt;
Yes, in some SQL implementations, you can create indexed views (also known as materialized views), which store the result set of the view in the database and can significantly improve performance.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Is it possible to update data through a view?&lt;/strong&gt;
Yes, but with limitations. For a view to be updatable, it generally needs to be a simple view that directly references columns from a single table without any complex joins or calculations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How do views impact database security?&lt;/strong&gt;
Views can enhance security by limiting access to specific columns or rows. However, they should be used as part of a broader security strategy, including permissions and roles.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can a view be created from multiple tables?&lt;/strong&gt;
Yes, a view can pull data from multiple tables by using joins in the SELECT query. This is commonly done to present a unified view of related data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What happens if the underlying table of a view is deleted?&lt;/strong&gt;
If the underlying table of a view is deleted, the view will become invalid, and attempts to query it will result in an error. It&#39;s important to update or drop views that reference deleted tables.&lt;/p&gt;&lt;h2&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;SQL views are indispensable tools for database administrators and developers. They simplify complex queries, enhance data security, and provide a flexible way to present and interact with data. By mastering the creation, modification, and deletion of views, you can streamline your database management and improve the performance and security of your applications.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/3252204762534887463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/08/mastering-sql-views-creation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3252204762534887463'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/3252204762534887463'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/08/mastering-sql-views-creation.html' title='Mastering SQL Views: Creation, Modification, and Deletion'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE68voia8Fpnw_UK_ayuGVoR53cLqnQOZetpApTFDzbqM0obQauDgnwsN9B2qof6ywhmOJhD3rlcBghES0UdMEQ5SetcT9xG6bazCwyP2CVltGNTTjn7mVZ9KaTgqMEvXaKOXJv2U2lArXtssonkDhyphenhypheni4vr0BJINoEQOA5vY4TfQQMDLJ_OjW1YF7hi92F/s72-w640-h366-c/Firefly%20SQL%2071045.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-7971935335530634584</id><published>2024-07-29T21:12:00.000+05:30</published><updated>2024-07-29T21:12:03.684+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Mastering SQL Subqueries for Enhanced Data Retrieval</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Subqueries, also known as inner or nested queries, are a powerful feature in SQL. They enable you to perform complex data retrieval tasks by embedding one query within another. This article explores the various ways subqueries can be used, including filtering data, aggregating data, joining tables, and using correlated subqueries.&lt;/p&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/AVvXsEglcZEp49iJnYpB-gXxQNKIqkknLVznnyEw8ZxKfGNCZveFiHm7TPAHvmVwgDZf0xK5QN9XZ2UsnMMpCOkF7VnOWYHlJnCsHaK95PcFXMBkI4UyJuP5Bg8psPt2yom1d0bQF5sLP5BvuECjJ2r3RxHFPTXWva026BLR-XtRfw_cS6EoHaD44ukPzeecZMvO/s1792/Designer%20(9).jpeg&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;1024&quot; data-original-width=&quot;1792&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglcZEp49iJnYpB-gXxQNKIqkknLVznnyEw8ZxKfGNCZveFiHm7TPAHvmVwgDZf0xK5QN9XZ2UsnMMpCOkF7VnOWYHlJnCsHaK95PcFXMBkI4UyJuP5Bg8psPt2yom1d0bQF5sLP5BvuECjJ2r3RxHFPTXWva026BLR-XtRfw_cS6EoHaD44ukPzeecZMvO/w640-h366/Designer%20(9).jpeg&quot; title=&quot;SQL Subquries&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Understanding Subqueries in SQL&lt;/h2&gt;&lt;p&gt;Subqueries can be embedded within the main query to enhance SQL functionality. These subqueries can be placed in the &lt;code&gt;WHERE&lt;/code&gt;, &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;FROM&lt;/code&gt;, or &lt;code&gt;HAVING&lt;/code&gt; clauses.&lt;/p&gt;&lt;h3&gt;Subqueries Used In&lt;/h3&gt;&lt;h4&gt;1. Filtering Data&lt;/h4&gt;&lt;p&gt;Subqueries are commonly used in the &lt;code&gt;WHERE&lt;/code&gt; clause to filter data based on conditions derived from another query.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name, salary&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; id &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; departments &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_name &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;Sales&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the subquery finds the &lt;code&gt;id&lt;/code&gt; of the department named &#39;Sales&#39;, and the main query retrieves employees who belong to that department.&lt;/p&gt;&lt;h4&gt;2. Aggregating Data&lt;/h4&gt;&lt;p&gt;Subqueries can provide values for aggregate functions, allowing for more complex calculations and aggregations.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; department_id, salary&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; salary &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query selects employees whose salary is above the average salary of all employees.&lt;/p&gt;&lt;h4&gt;3. Joining Tables&lt;/h4&gt;&lt;p&gt;Subqueries can replace joins, especially when only a single value or a specific set of values is needed from another table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e.name, e.salary&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-keyword&quot;&gt;IN&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; d.id &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; departments d &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; d.location &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;New York&#39;&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the subquery retrieves the IDs of departments located in New York, and the main query selects employees working in those departments.&lt;/p&gt;&lt;h2&gt;Correlated Subqueries&lt;/h2&gt;&lt;p&gt;A correlated subquery is a subquery that references columns from the outer query. It is evaluated once for each row processed by the outer query, making it powerful for row-by-row processing.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e1.name, e1.salary&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e1
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e1.salary &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(e2.salary) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e2 &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e1.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; e2.department_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query selects employees whose salary is above the average salary within their respective departments.&lt;/p&gt;&lt;h2&gt;Practical Uses of Subqueries&lt;/h2&gt;&lt;h3&gt;Filtering Data with Subqueries&lt;/h3&gt;&lt;p&gt;Filtering data based on a subquery helps narrow down results dynamically.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name, salary&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; salary &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves employees with salaries above the average salary in department 10.&lt;/p&gt;&lt;h3&gt;Aggregating Data with Subqueries&lt;/h3&gt;&lt;p&gt;Subqueries can be used to calculate aggregates that are used in further queries.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; department_id, (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;COUNT&lt;/span&gt;(&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; d.id) &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; employee_count&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; departments d;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query counts the number of employees in each department and includes the count in the result set.&lt;/p&gt;&lt;h3&gt;Joining Tables with Subqueries&lt;/h3&gt;&lt;p&gt;Subqueries can act as derived tables or inline views in the &lt;code&gt;FROM&lt;/code&gt; clause.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e.name, d.department_name&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; id, department_name &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; departments &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; location &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-string&quot;&gt;&#39;New York&#39;&lt;/span&gt;) d
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; d.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query joins the employees table with a derived table containing departments located in New York.&lt;/p&gt;&lt;h3&gt;Using Correlated Subqueries&lt;/h3&gt;&lt;p&gt;Correlated subqueries are useful for row-by-row processing within the outer query.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; name&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e1
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; salary &lt;span class=&quot;hljs-operator&quot;&gt;&amp;gt;&lt;/span&gt; (&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary) &lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e2 &lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e1.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; e2.department_id);
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves names of employees whose salary is above the average salary within their department.&lt;/p&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;What is a subquery in SQL?&lt;/strong&gt;
A subquery is a query nested inside another query. It can be used to retrieve data that will be used in the main query.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How does a correlated subquery differ from a regular subquery?&lt;/strong&gt;
A correlated subquery references columns from the outer query and is evaluated once for each row processed by the outer query, while a regular subquery is evaluated once and its result is used in the main query.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can subqueries be used in the SELECT clause?&lt;/strong&gt;
Yes, subqueries can be used in the SELECT clause to provide values for columns in the result set.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What are some common uses of subqueries?&lt;/strong&gt;
Subqueries are commonly used for filtering data, aggregating data, joining tables, and performing row-by-row processing with correlated subqueries.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How can subqueries improve SQL queries?&lt;/strong&gt;
Subqueries can simplify complex SQL queries by breaking them down into smaller, more manageable parts and by providing dynamic filtering and aggregation capabilities.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Are there performance considerations when using subqueries?&lt;/strong&gt;
Yes, subqueries can sometimes lead to performance issues, especially correlated subqueries, which are evaluated multiple times. Optimizing and using appropriate indexes can help mitigate performance problems.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Understanding and effectively using subqueries in SQL can significantly enhance your ability to retrieve and manipulate data. Whether filtering, aggregating, joining tables, or using correlated subqueries, these powerful tools enable more sophisticated and efficient queries.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/7971935335530634584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/07/mastering-sql-subqueries-for-enhanced.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/7971935335530634584'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/7971935335530634584'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/07/mastering-sql-subqueries-for-enhanced.html' title='Mastering SQL Subqueries for Enhanced Data Retrieval'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglcZEp49iJnYpB-gXxQNKIqkknLVznnyEw8ZxKfGNCZveFiHm7TPAHvmVwgDZf0xK5QN9XZ2UsnMMpCOkF7VnOWYHlJnCsHaK95PcFXMBkI4UyJuP5Bg8psPt2yom1d0bQF5sLP5BvuECjJ2r3RxHFPTXWva026BLR-XtRfw_cS6EoHaD44ukPzeecZMvO/s72-w640-h366-c/Designer%20(9).jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-4163202284882817637</id><published>2024-07-27T01:08:00.003+05:30</published><updated>2024-07-27T01:08:49.399+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Mastering Data Aggregation Functions in SQL</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Data aggregation functions in SQL are essential tools for summarizing and analyzing data. They perform calculations on multiple rows of a table&#39;s column and return a single value, providing insights into the dataset. This article explores the key aggregation functions: SUM, AVG, COUNT, MIN, and MAX, along with their syntax and practical examples.&lt;/p&gt;&lt;div&gt;&lt;br /&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/AVvXsEjIEM0rqo2nyxLwcm_L95IEelUnMD8WDNFl4FNmNphJSRn4CcIxFK3eFku3mPcLyhMWx29_8Yvqn6waQamDiNEBeXAy7l6VDnMRFRgq5KYYtN_YX9mrX1ZW98djgURoVeA1nP95iqJiV5S30etp_DDW9ado_MCoUGnFL7br6GjjNjHGmzpwaRZBJcktj3QQ/s2688/Firefly%20SQL%201282.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;SQL Aggregation&quot; border=&quot;0&quot; data-original-height=&quot;1536&quot; data-original-width=&quot;2688&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIEM0rqo2nyxLwcm_L95IEelUnMD8WDNFl4FNmNphJSRn4CcIxFK3eFku3mPcLyhMWx29_8Yvqn6waQamDiNEBeXAy7l6VDnMRFRgq5KYYtN_YX9mrX1ZW98djgURoVeA1nP95iqJiV5S30etp_DDW9ado_MCoUGnFL7br6GjjNjHGmzpwaRZBJcktj3QQ/w640-h366/Firefly%20SQL%201282.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;Key Aggregation Functions in SQL&lt;/h2&gt;&lt;h3&gt;SUM&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The SUM function returns the total sum of a numeric column.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(column_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(salary)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the query calculates the total salary of employees in department 10.&lt;/p&gt;&lt;h3&gt;AVG&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The AVG function returns the average value of a numeric column.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(column_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query calculates the average salary of employees in department 10.&lt;/p&gt;&lt;h3&gt;COUNT&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The COUNT function returns the number of rows that match a specified condition.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;COUNT&lt;/span&gt;(column_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;COUNT&lt;/span&gt;(&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query counts the number of employees in department 10.&lt;/p&gt;&lt;h3&gt;MIN&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The MIN function returns the smallest value in a set of values.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;MIN&lt;/span&gt;(column_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;MIN&lt;/span&gt;(salary)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query finds the minimum salary among employees in department 10.&lt;/p&gt;&lt;h3&gt;MAX&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: The MAX function returns the largest value in a set of values.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;MAX&lt;/span&gt;(column_name)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;condition&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot;&gt;MAX&lt;/span&gt;(salary)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;10&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query finds the maximum salary among employees in department 10.&lt;/p&gt;&lt;h2&gt;Combining Aggregation Functions with GROUP BY&lt;/h2&gt;&lt;p&gt;Aggregation functions are often used with the GROUP BY clause to group the result set by one or more columns. This combination allows for detailed analysis by categories or groups.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; column1, AGG_FUNC(column2)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table_name
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; column1;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; department_id, &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(salary), &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(salary), &lt;span class=&quot;hljs-built_in&quot;&gt;COUNT&lt;/span&gt;(&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt;), &lt;span class=&quot;hljs-built_in&quot;&gt;MIN&lt;/span&gt;(salary), &lt;span class=&quot;hljs-built_in&quot;&gt;MAX&lt;/span&gt;(salary)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; department_id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the query groups employees by department and calculates the sum, average, count, minimum, and maximum salary for each department.&lt;/p&gt;&lt;h2&gt;Practical Examples of Data Aggregation&lt;/h2&gt;&lt;h3&gt;Total Sales by Product&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; product_id, &lt;span class=&quot;hljs-built_in&quot;&gt;SUM&lt;/span&gt;(sales_amount)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; sales
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; product_id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query calculates the total sales amount for each product.&lt;/p&gt;&lt;h3&gt;Average Age by Department&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; department_id, &lt;span class=&quot;hljs-built_in&quot;&gt;AVG&lt;/span&gt;(age)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; department_id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query calculates the average age of employees in each department.&lt;/p&gt;&lt;h3&gt;Count of Orders by Customer&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; customer_id, &lt;span class=&quot;hljs-built_in&quot;&gt;COUNT&lt;/span&gt;(&lt;span class=&quot;hljs-operator&quot;&gt;*&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; customer_id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query counts the number of orders placed by each customer.&lt;/p&gt;&lt;h3&gt;Minimum and Maximum Order Amount by Region&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; region, &lt;span class=&quot;hljs-built_in&quot;&gt;MIN&lt;/span&gt;(order_amount), &lt;span class=&quot;hljs-built_in&quot;&gt;MAX&lt;/span&gt;(order_amount)
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; orders
&lt;span class=&quot;hljs-keyword&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; region;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query finds the minimum and maximum order amounts in each region.&lt;/p&gt;&lt;h2&gt;Best Practices for Using Aggregation Functions&lt;/h2&gt;&lt;h3&gt;Ensure Data Accuracy&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Validate Data&lt;/strong&gt;: Ensure the data used in aggregation functions is accurate and consistent.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Handle NULL Values&lt;/strong&gt;: Use functions like COALESCE to handle NULL values in your data to avoid skewed results.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Optimize Performance&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use Indexes&lt;/strong&gt;: Indexes can significantly improve the performance of queries using aggregation functions.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Filter Data&lt;/strong&gt;: Apply filters using the WHERE clause to limit the dataset and improve query efficiency.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Understand Grouping Logic&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Group by Relevant Columns&lt;/strong&gt;: Ensure the GROUP BY clause includes the correct columns for meaningful aggregation.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Avoid Unnecessary Grouping&lt;/strong&gt;: Grouping by columns that do not impact the analysis can lead to unnecessary complexity.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;What is the SUM function in SQL?&lt;/strong&gt;
The SUM function calculates the total sum of a numeric column, providing the aggregate total.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How does the AVG function work in SQL?&lt;/strong&gt;
The AVG function calculates the average value of a numeric column, giving the mean value.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is the purpose of the COUNT function?&lt;/strong&gt;
The COUNT function counts the number of rows that match a specified condition or the total number of rows in a table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;When should I use the MIN function?&lt;/strong&gt;
Use the MIN function to find the smallest value in a set of values, such as the lowest salary in a department.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How is the MAX function different from MIN?&lt;/strong&gt;
The MAX function returns the largest value in a set of values, while the MIN function returns the smallest value.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can I combine multiple aggregation functions in a single query?&lt;/strong&gt;
Yes, you can combine multiple aggregation functions in a single query, often using the GROUP BY clause to group results by specific columns.&lt;/p&gt;&lt;h2 style=&quot;text-align: justify;&quot;&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Mastering SQL aggregation functions like SUM, AVG, COUNT, MIN, and MAX is essential for summarizing and analyzing data effectively. By understanding their syntax and practical applications, you can perform comprehensive data analysis and make informed decisions based on your data.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/4163202284882817637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/07/mastering-data-aggregation-functions-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4163202284882817637'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/4163202284882817637'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/07/mastering-data-aggregation-functions-in-sql.html' title='Mastering Data Aggregation Functions in SQL'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIEM0rqo2nyxLwcm_L95IEelUnMD8WDNFl4FNmNphJSRn4CcIxFK3eFku3mPcLyhMWx29_8Yvqn6waQamDiNEBeXAy7l6VDnMRFRgq5KYYtN_YX9mrX1ZW98djgURoVeA1nP95iqJiV5S30etp_DDW9ado_MCoUGnFL7br6GjjNjHGmzpwaRZBJcktj3QQ/s72-w640-h366-c/Firefly%20SQL%201282.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7332461235075335417.post-449222423320895625</id><published>2024-07-27T00:49:00.000+05:30</published><updated>2024-07-27T00:49:26.534+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql queries"/><title type='text'>Comprehensive Guide to SQL Joins and Relationships</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Understanding the different types of SQL joins and relationships is crucial for effective database management. Joins allow you to combine data from multiple tables based on related columns, facilitating comprehensive data retrieval and manipulation. This article explores the various SQL join types, their definitions, syntax, and examples to help you utilize them effectively.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;/p&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/AVvXsEjzeNer7UE-CB1WwWX71Zyc7vPCAgrvS6JSfm9NUhJQ5mwdPnyI0V2sYwVcNcsp44_6X26lMaMZJ42B2k8Ri_gWt4V99Cac5BI2WaBcFu0zFD6LUNO7IMn4aVgCHditJE1LAK-SBp4kiHuHv7R3_8jQru8OzVlNc3LFKgVAzMRIOX2plfNq-pcwpKd6O8-W/s1024/pikaso_texttoimage_SQL-Joins-and-Relationships-INNER-JOIN-LEFT-JOIN-R.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;SQL Joins&quot; border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzeNer7UE-CB1WwWX71Zyc7vPCAgrvS6JSfm9NUhJQ5mwdPnyI0V2sYwVcNcsp44_6X26lMaMZJ42B2k8Ri_gWt4V99Cac5BI2WaBcFu0zFD6LUNO7IMn4aVgCHditJE1LAK-SBp4kiHuHv7R3_8jQru8OzVlNc3LFKgVAzMRIOX2plfNq-pcwpKd6O8-W/w640-h640/pikaso_texttoimage_SQL-Joins-and-Relationships-INNER-JOIN-LEFT-JOIN-R.jpeg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Types of SQL Joins&lt;/h2&gt;&lt;h3&gt;INNER JOIN&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Returns records that have matching values in both tables.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table1
&lt;span class=&quot;hljs-keyword&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; table2
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; table1.common_column &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; table2.common_column;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; employees.name, departments.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; employees.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; departments.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the query retrieves only those employees who have a matching department entry in the departments table.&lt;/p&gt;&lt;h3&gt;LEFT JOIN (or LEFT OUTER JOIN)&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Returns all records from the left table (table1) and the matched records from the right table (table2). If no match is found, NULL values are returned for columns from the right table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table1
&lt;span class=&quot;hljs-keyword&quot;&gt;LEFT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; table2
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; table1.common_column &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; table2.common_column;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; employees.name, departments.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;LEFT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; employees.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; departments.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves all employees, including those who do not have a corresponding department entry. For such employees, department details will be NULL.&lt;/p&gt;&lt;h3&gt;RIGHT JOIN (or RIGHT OUTER JOIN)&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Returns all records from the right table (table2) and the matched records from the left table (table1). If no match is found, NULL values are returned for columns from the left table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table1
&lt;span class=&quot;hljs-keyword&quot;&gt;RIGHT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; table2
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; table1.common_column &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; table2.common_column;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; employees.name, departments.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;RIGHT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; employees.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; departments.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;In this example, the query retrieves all departments, including those that do not have any employees. For such departments, employee details will be NULL.&lt;/p&gt;&lt;h3&gt;FULL OUTER JOIN&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Returns all records when there is a match in either left (table1) or right (table2) table. Records not matching in both tables will have NULLs.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table1
&lt;span class=&quot;hljs-keyword&quot;&gt;FULL&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;OUTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; table2
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; table1.common_column &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; table2.common_column;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; employees.name, departments.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;FULL&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;OUTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; employees.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; departments.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves all employees and departments, matching them when possible and filling NULLs where no match is found.&lt;/p&gt;&lt;h3&gt;Self-Joins&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Joins a table with itself to combine rows with other rows of the same table. This is useful for hierarchical or graph-like data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; a.columns, b.columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;table&lt;/span&gt; a, &lt;span class=&quot;hljs-keyword&quot;&gt;table&lt;/span&gt; b
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; a.common_column &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; b.common_column;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e1.name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; employee_name, e2.name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; manager_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e1
&lt;span class=&quot;hljs-keyword&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; employees e2
&lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e1.manager_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; e2.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves employees and their managers from the same employees table.&lt;/p&gt;&lt;h3&gt;Cross Joins&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;: Returns the Cartesian product of the two tables, i.e., it combines all rows of table1 with all rows of table2.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; columns
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; table1
&lt;span class=&quot;hljs-keyword&quot;&gt;CROSS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; table2;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; employees.name, departments.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees
&lt;span class=&quot;hljs-keyword&quot;&gt;CROSS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query pairs each employee with every department, producing a Cartesian product.&lt;/p&gt;&lt;h2&gt;Practical Examples of Joins&lt;/h2&gt;&lt;h3&gt;Combining INNER JOIN and LEFT JOIN&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e.name, d.department_name, p.project_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;LEFT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments d &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; d.id
&lt;span class=&quot;hljs-keyword&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; projects p &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.project_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; p.id;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves employee names, their departments, and project names. It includes all employees and their associated projects, showing department names when available.&lt;/p&gt;&lt;h3&gt;Using FULL OUTER JOIN with Filtering&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; e.name, d.department_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees e
&lt;span class=&quot;hljs-keyword&quot;&gt;FULL&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;OUTER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; departments d &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; d.id
&lt;span class=&quot;hljs-keyword&quot;&gt;WHERE&lt;/span&gt; e.department_id &lt;span class=&quot;hljs-keyword&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;NULL&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;OR&lt;/span&gt; d.id &lt;span class=&quot;hljs-keyword&quot;&gt;IS&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;NULL&lt;/span&gt;;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query retrieves all employees and departments that do not have matching entries in the other table, highlighting discrepancies in the data.&lt;/p&gt;&lt;h3&gt;Self-Join Example for Hierarchical Data&lt;/h3&gt;&lt;pre&gt;&lt;div class=&quot;dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium&quot;&gt;&lt;div class=&quot;flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;overflow-y-auto p-4&quot; dir=&quot;ltr&quot;&gt;&lt;code class=&quot;!whitespace-pre hljs language-sql&quot;&gt;&lt;span class=&quot;hljs-keyword&quot;&gt;SELECT&lt;/span&gt; a.name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; employee_name, b.name &lt;span class=&quot;hljs-keyword&quot;&gt;AS&lt;/span&gt; manager_name
&lt;span class=&quot;hljs-keyword&quot;&gt;FROM&lt;/span&gt; employees a
&lt;span class=&quot;hljs-keyword&quot;&gt;LEFT&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;JOIN&lt;/span&gt; employees b &lt;span class=&quot;hljs-keyword&quot;&gt;ON&lt;/span&gt; a.manager_id &lt;span class=&quot;hljs-operator&quot;&gt;=&lt;/span&gt; b.id
&lt;span class=&quot;hljs-keyword&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot;&gt;BY&lt;/span&gt; b.name;
&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;This query lists employees alongside their managers, ordered by the manager&#39;s name.&lt;/p&gt;&lt;h2&gt;FAQs&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;What is an INNER JOIN in SQL?&lt;/strong&gt;
An INNER JOIN returns records that have matching values in both tables involved in the join.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How does a LEFT JOIN differ from a RIGHT JOIN?&lt;/strong&gt;
A LEFT JOIN returns all records from the left table and the matched records from the right table, filling NULLs for unmatched rows. A RIGHT JOIN does the opposite, returning all records from the right table and the matched records from the left table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;When should I use a FULL OUTER JOIN?&lt;/strong&gt;
Use a FULL OUTER JOIN when you need to retrieve all records from both tables, regardless of whether they have matching entries in the other table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is the purpose of a self-join?&lt;/strong&gt;
A self-join is used to join a table with itself, often for hierarchical data representation or to find relationships between rows within the same table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is the result of a CROSS JOIN?&lt;/strong&gt;
A CROSS JOIN returns the Cartesian product of the two tables, combining all rows of the first table with all rows of the second table.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;How do SQL joins help in database management?&lt;/strong&gt;
SQL joins allow you to combine data from multiple tables based on related columns, enabling comprehensive and flexible data retrieval and manipulation.&lt;/p&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Mastering SQL joins is essential for effective database management. By understanding and utilizing INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, self-joins, and cross joins, you can create robust and efficient queries that provide valuable insights from your data.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.csinfo360.com/feeds/449222423320895625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.csinfo360.com/2024/07/comprehensive-guide-to-sql-joins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/449222423320895625'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/7332461235075335417/posts/default/449222423320895625'/><link rel='alternate' type='text/html' href='https://www.csinfo360.com/2024/07/comprehensive-guide-to-sql-joins.html' title='Comprehensive Guide to SQL Joins and Relationships'/><author><name>SOURAV KUMAR PATRA</name><uri>http://www.blogger.com/profile/09214825307564790148</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzeNer7UE-CB1WwWX71Zyc7vPCAgrvS6JSfm9NUhJQ5mwdPnyI0V2sYwVcNcsp44_6X26lMaMZJ42B2k8Ri_gWt4V99Cac5BI2WaBcFu0zFD6LUNO7IMn4aVgCHditJE1LAK-SBp4kiHuHv7R3_8jQru8OzVlNc3LFKgVAzMRIOX2plfNq-pcwpKd6O8-W/s72-w640-h640-c/pikaso_texttoimage_SQL-Joins-and-Relationships-INNER-JOIN-LEFT-JOIN-R.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>