From 71097bb430723c1e7c728bc473e5ed02e2d1eaf0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:06:43 +0100 Subject: [PATCH] chore: sync content to repo (#9695) Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com> --- .../sql/content/abs@6vYFb_D1N_-tLWZftL-Az.md | 2 +- .../sql/content/acid@igg34gLPl3HYVAmRNFGcV.md | 2 +- ...dvanced-functions@vTMd0bqz4eTgLnhfgY61h.md | 9 +--- ...aggregate-queries@LX9nzJ4uqznHN4SksoDvr.md | 9 +--- .../alter-table@WjXlO42WL9saDS7RIGapt.md | 2 +- .../sql/content/avg@Wou6YXLYUgomvcELh851L.md | 2 +- .../basic-sql-syntax@JDDG4KfhtIlw1rkNCzUli.md | 4 +- .../content/begin@7sTW1vwUhCFOMXYjScVEt.md | 2 +- .../sql/content/case@W2ePJHdfEiEJ3ZKoRQKt_.md | 2 +- .../content/ceiling@BAqJQvcguhIhzyII5LRH6.md | 2 +- .../content/check@Q0h9Wfnl_W9ThOkv7Q17A.md | 4 +- .../content/coalesce@k7lZe4QRt9q4InUImFmvx.md | 2 +- .../content/column@wmtt-3auWLdQWuVdwZLPd.md | 4 +- .../content/commit@3cMECz5QPVDOFrk5duObs.md | 6 +-- ...table-expressions@tedQynR0xicVKhuR1oahw.md | 4 +- .../content/concat@5inpEqafeVCfqsURHzQQg.md | 4 +- ...elated-subqueries@JZqS3Xapw6mfSPVgFW7av.md | 2 +- .../content/count@9aHYrOQDkA84tlxcVK5aD.md | 2 +- .../create-table@epEpBxRosLhuAuKwp823r.md | 2 +- .../creating-views@PcsGK4VBh0zNQIPZvNES4.md | 2 +- .../cross-join@7ow6tiSSCnTpv_GYQU017.md | 6 +-- .../data-constraints@qBios3sZVhcJMpXmj9f7B.md | 2 +- ...tion-language-ddl@xPOeXK1EPBNG56vgfG-VV.md | 2 +- ...tegrity--security@R1ktDJpXOz0PTllAcBrdu.md | 6 +-- ...grity-constraints@mBQ3Z8GlFcpIena3IB7D_.md | 6 +-- ...tion-language-dml@WMSXi-eez_hHGDM8kUdWz.md | 2 +- .../data-types@tBzMDfCMh6MIagNaxCzin.md | 2 +- .../sql/content/date@Ivqo2wa-_NhGU3vGd0pUI.md | 2 +- .../content/dateadd@1E1WdWOyqxbbdiIbw26dZ.md | 2 +- .../content/datepart@BJ4fQvagTO0B5UtXblyx8.md | 2 +- ...ty-best-practices@vhBZqqmUcEon6-Vwvla4q.md | 46 ++----------------- .../content/delete@ddtVaA4Ls6qRj-7OtTSIH.md | 6 +-- .../content/delete@zWnvuHJLHr03PWkrW1wZZ.md | 6 +-- .../dense_rank@QM0ltgPu8lLLYc2MsTLj-.md | 6 +-- .../drop-table@YzJ6QmY2arMfRzMAPaI0T.md | 8 ++-- .../dropping-views@MIOuWWcCjLAmgzog2DBC3.md | 2 +- .../dynamic-sql@z5Sf0VU14ZCQ80kL1qOqc.md | 6 +-- .../content/floor@o2SH4iQn1Ap2yDZ7cVYLO.md | 6 +-- .../foreign-key@DHz6sRLYhFeCbAcNJS8hm.md | 5 +- .../sql/content/from@N1Racr3ZpU320gS545We8.md | 8 ++-- .../full-outer-join@aS5zCyJRA779yHF0G2pje.md | 2 +- .../grant-and-revoke@03qMopxzjx_-dZbYw9b7J.md | 2 +- .../content/group-by@14TKE6KhrH1yFtHcSZSXq.md | 2 +- .../content/group-by@Zw8IHfCCMSxmVjx5Ho5ff.md | 2 +- .../content/having@HhICJpCK5__b-itUoEBES.md | 8 +--- .../content/having@ytwCkSMTiTuemE0KVfAfy.md | 8 +--- .../content/indexes@LcljR70T-OnzSrJJDqOWf.md | 2 +- .../inner-join@aaua13CkTxLOYXr8cAgPm.md | 10 +--- .../content/insert@-Hew0y53ziZK3epQnGA0O.md | 4 +- .../content/insert@mPj6BiK5FKKkIQ9WsWEo6.md | 6 +-- .../join-queries@8V6yw7kLaow-VVcv_K_pL.md | 6 +-- .../content/joins@4UQQYbjzwVxZOAxBuXKQS.md | 12 ++--- .../sql/content/lag@BcXdxY6bld5c0YNFSKkh-.md | 2 +- .../sql/content/lead@aJJjaGunRrwyh9MjQfJt-.md | 2 +- .../learn-the-basics@nhUKKWyBH80nyKfGT8ErC.md | 17 ++----- .../left-join@X9cJJ8zLZCF2cOoqxwFfY.md | 4 +- .../content/length@RH8DLiQpDUWqw3U1522q5.md | 2 +- .../content/lower@knTG6pAq2mYP24WMa29xI.md | 2 +- .../managing-indexes@NtxGd6Vx-REBclry7lZuE.md | 2 +- .../sql/content/max@YqDJq3fPxUZlwsdq0kJg7.md | 2 +- .../sql/content/min@bFEYMlqPZtTUYtDQxqHzT.md | 2 +- .../sql/content/mod@OUw--8zEq6lk5-6oySVHe.md | 2 +- .../modifying-views@3eE-l-P93nOXoWfLr8PSW.md | 8 +--- ...nested-subqueries@xkPJ2MYiXmzC4yqQWyB_7.md | 6 +-- .../content/not-null@M4M_-vjM9GNy0NmXZneDA.md | 8 ++-- .../content/nullif@KI6vngoYcHsnpIk8ErhhS.md | 2 +- .../operators@ffwniprGJHZzJ7t3lQcXz.md | 2 +- .../optimizing-joins@C0dhS6uLf4TUSfvcWyXhv.md | 2 +- .../content/order-by@NfCiSPrL4upMssukcw3Kh.md | 2 +- ...ance-optimization@4rqCPpTb0dAgpheBKshRG.md | 4 +- ...npivot-operations@nwFaz9i-1s0WVrVaFsoqb.md | 6 +-- .../primary-key@Jlwmyq6CUQeDAlL4dazOP.md | 2 +- ...alysis-techniques@C6P69YiFdS-ioPXMNfX07.md | 4 +- ...uery-optimization@Ps9Yv2s-bKvEegGAbPsiA.md | 8 ++-- .../sql/content/rank@cucCPw3KfetAP2OMFUs0X.md | 2 +- ...s-and-limitations@fNTb9y3zs1HPYclAmu_Wv.md | 28 +---------- ...recursive-queries@TjgwabhEtaSoYMLNr6q9l.md | 4 +- .../content/replace@VNbb3YPc0FtrROylRns8h.md | 2 +- .../right-join@shpgZkh1CLqUwjOaRtAFy.md | 4 +- .../content/rollback@xbD67KVlt3UhHpKh8HLx8.md | 6 +-- .../content/round@9DntFiZV1AyaRPhYP5q6u.md | 2 +- .../sql/content/row@aLDl75i8gtLRA2Ud-fMmQ.md | 2 +- .../row_number@zW27ZHdLwQY-85iqbBKQZ.md | 4 +- .../savepoint@pJtYvXUo81aZfPuRjIbMq.md | 2 +- .../content/scalar@eXQ-TrTlqL5p2AdGnozkL.md | 6 +-- .../content/select@i8u8E_sne6XiKJo2FXDog.md | 8 +--- .../content/select@rmqXH29n1oXtZ8tvmcRFn.md | 9 ++-- ...ective-projection@w53CSY53nAAN0ux-XeJ4c.md | 2 +- .../self-join@6qG0AVYd6Y1B8LOSDoMX9.md | 6 +-- .../sql-keywords@6yoo7qC6X2jYDIjd3HIm7.md | 2 +- ...s-nosql-databases@gx4KaFqKgJX9n9_ZGMqlZ.md | 2 +- ...edures--functions@w7FNjdwqjY7X69aJqqBy4.md | 2 +- .../subqueries@86iZ8s8EdhSuYwgwAM_EO.md | 2 +- .../substring@PnG_5D6q66NAKxXVOwA6N.md | 6 +-- .../sql/content/sum@w4T3jFb0ilf1KNw-AvRXG.md | 2 +- .../content/table@R9WDMRd-3wxsKH97-sT3n.md | 2 +- .../sql/content/time@88KlrMqSza9_YaD7Dv61p.md | 3 +- .../timestamp@7hEqkoxkdAWmakGZsMJx-.md | 6 +-- ...-isolation-levels@ujeq8EIFcrqkBjoFizsJM.md | 2 +- .../transactions@OdaBXz2XBAVLsQ-m7xtAM.md | 4 +- .../truncate-table@K5vhqTJrdPK08Txv8zaEj.md | 6 +-- .../content/unique@5yGo8i7eplxtXOD_qfzOs.md | 6 +-- .../content/update@KJJ6PYjTnr_3yU2mNPL9v.md | 6 +-- .../content/update@eu9dJFi6gBPMBdy08Y5Bb.md | 6 +-- .../content/upper@Othfo7NvTVzfyL906PLM1.md | 4 +- .../using-indexes@9wOgP0i9G4HSeZGn2Gm7r.md | 2 +- .../content/views@2tyezwOIxV6O84N-Q3Awh.md | 14 ++---- ...ational-databases@R9DQNc0AyAQ2HLpP4HOk6.md | 16 ++----- .../content/where@WhYAy6f7Euk3E49-ot644.md | 12 ++--- .../window-functions@tBvXLLp5FKeSSN35Kj1X4.md | 6 +-- 110 files changed, 194 insertions(+), 358 deletions(-) diff --git a/src/data/roadmaps/sql/content/abs@6vYFb_D1N_-tLWZftL-Az.md b/src/data/roadmaps/sql/content/abs@6vYFb_D1N_-tLWZftL-Az.md index 603fb18e6..081d9a8b6 100644 --- a/src/data/roadmaps/sql/content/abs@6vYFb_D1N_-tLWZftL-Az.md +++ b/src/data/roadmaps/sql/content/abs@6vYFb_D1N_-tLWZftL-Az.md @@ -2,7 +2,7 @@ The `ABS()` function in SQL returns the absolute value of a given numeric expression, meaning it converts any negative number to its positive equivalent while leaving positive numbers unchanged. This function is useful when you need to ensure that the result of a calculation or a value stored in a database column is non-negative, such as when calculating distances, differences, or other metrics where only positive values make sense. For example, `SELECT ABS(-5)` would return `5`. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to compute an absolute value in SQL](https://www.airops.com/sql-guide/how-to-compute-an-absolute-value-in-sql) - [@article@ABS](https://www.w3schools.com/sql/func_sqlserver_abs.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/acid@igg34gLPl3HYVAmRNFGcV.md b/src/data/roadmaps/sql/content/acid@igg34gLPl3HYVAmRNFGcV.md index 520a9e70d..eafe744f2 100644 --- a/src/data/roadmaps/sql/content/acid@igg34gLPl3HYVAmRNFGcV.md +++ b/src/data/roadmaps/sql/content/acid@igg34gLPl3HYVAmRNFGcV.md @@ -6,4 +6,4 @@ Visit the following resources to learn more: - [@article@What is ACID Compliant Database?](https://retool.com/blog/whats-an-acid-compliant-database/) - [@article@What is ACID Compliance?: Atomicity, Consistency, Isolation](https://fauna.com/blog/what-is-acid-compliance-atomicity-consistency-isolation) -- [@video@ACID Explained: Atomic, Consistent, Isolated & Durable](https://www.youtube.com/watch?v=yaQ5YMWkxq4) +- [@video@ACID Explained: Atomic, Consistent, Isolated & Durable](https://www.youtube.com/watch?v=yaQ5YMWkxq4) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/advanced-functions@vTMd0bqz4eTgLnhfgY61h.md b/src/data/roadmaps/sql/content/advanced-functions@vTMd0bqz4eTgLnhfgY61h.md index 76470429d..fff580f75 100644 --- a/src/data/roadmaps/sql/content/advanced-functions@vTMd0bqz4eTgLnhfgY61h.md +++ b/src/data/roadmaps/sql/content/advanced-functions@vTMd0bqz4eTgLnhfgY61h.md @@ -1,8 +1,3 @@ -# Advanced SQL Functions +# Advanced Functions -Advanced SQL functions enable more sophisticated data manipulation and analysis within databases, offering powerful tools for complex queries. Key areas include: - -- **String Functions**: Manipulate text data using functions like `CONCAT`, `SUBSTRING`, and `REPLACE` to combine, extract, or modify strings. -- **Date & Time**: Manage temporal data with functions like `DATEADD`, `DATEDIFF`, and `FORMAT`, allowing for calculations and formatting of dates and times. -- **Numeric Functions**: Perform advanced calculations using functions such as `ROUND`, `FLOOR`, and `CEIL`, providing precision in numerical data processing. -- **Conditional**: Implement logic within queries using functions like `CASE`, `COALESCE`, and `NULLIF` to control data flow and handle conditional scenarios. \ No newline at end of file +Advanced functions in SQL go beyond the basic operations like selecting and filtering data. These functions allow you to perform complex calculations, manipulate strings, work with dates, and analyze data in more sophisticated ways. They help you derive insights, transform data, and create more meaningful reports from your database. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/aggregate-queries@LX9nzJ4uqznHN4SksoDvr.md b/src/data/roadmaps/sql/content/aggregate-queries@LX9nzJ4uqznHN4SksoDvr.md index e7e289fe6..ea1a6129a 100644 --- a/src/data/roadmaps/sql/content/aggregate-queries@LX9nzJ4uqznHN4SksoDvr.md +++ b/src/data/roadmaps/sql/content/aggregate-queries@LX9nzJ4uqznHN4SksoDvr.md @@ -1,10 +1,3 @@ # Aggregate Queries -Aggregate queries in SQL are used to perform calculations on multiple rows of data, returning a single summary value or grouped results. These queries typically involve the use of aggregate functions, such as: - - • COUNT(): Returns the number of rows that match a specific condition. - • SUM(): Calculates the total sum of a numeric column. - • AVG(): Computes the average value of a numeric column. - • MIN() and MAX(): Find the smallest and largest values in a column, respectively. - • GROUP BY: Used to group rows that share a common value in specified columns, allowing aggregate functions to be applied to each group. - • HAVING: Filters the results of a GROUP BY clause based on a specified condition, similar to WHERE but for groups. \ No newline at end of file +Aggregate queries in SQL are used to calculate summary values from multiple rows of a table, reducing the data to a single row based on a specific calculation. These calculations provide insights like totals, averages, and counts. Commonly used aggregate functions include `COUNT()` to count rows, `SUM()` to add values, `AVG()` to calculate the average, `MIN()` to find the minimum value, and `MAX()` to find the maximum value within a group of rows. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/alter-table@WjXlO42WL9saDS7RIGapt.md b/src/data/roadmaps/sql/content/alter-table@WjXlO42WL9saDS7RIGapt.md index d92bed2fd..11c967ed7 100644 --- a/src/data/roadmaps/sql/content/alter-table@WjXlO42WL9saDS7RIGapt.md +++ b/src/data/roadmaps/sql/content/alter-table@WjXlO42WL9saDS7RIGapt.md @@ -2,7 +2,7 @@ The `ALTER TABLE` statement in SQL is used to modify the structure of an existing table. This includes adding, dropping, or modifying columns, changing the data type of a column, setting default values, and adding or dropping primary or foreign keys. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@ALTER TABLE Statement](https://www.techonthenet.com/sql/tables/alter_table.php) - [@article@ALTER TABLE - PostgreSQL](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-alter-table/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/avg@Wou6YXLYUgomvcELh851L.md b/src/data/roadmaps/sql/content/avg@Wou6YXLYUgomvcELh851L.md index 5fd7009b8..96254e46a 100644 --- a/src/data/roadmaps/sql/content/avg@Wou6YXLYUgomvcELh851L.md +++ b/src/data/roadmaps/sql/content/avg@Wou6YXLYUgomvcELh851L.md @@ -2,7 +2,7 @@ The `AVG()` function in SQL is an aggregate function that calculates the average value of a numeric column. It returns the sum of all the values in the column, divided by the count of those values. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@AVG](https://www.sqlshack.com/sql-avg-function-introduction-and-examples/) - [@article@SQL AVG() Function](https://www.w3schools.com/sql/sql_avg.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/basic-sql-syntax@JDDG4KfhtIlw1rkNCzUli.md b/src/data/roadmaps/sql/content/basic-sql-syntax@JDDG4KfhtIlw1rkNCzUli.md index 36af8f2d8..8777fb4da 100644 --- a/src/data/roadmaps/sql/content/basic-sql-syntax@JDDG4KfhtIlw1rkNCzUli.md +++ b/src/data/roadmaps/sql/content/basic-sql-syntax@JDDG4KfhtIlw1rkNCzUli.md @@ -2,7 +2,7 @@ Basic SQL syntax consists of straightforward commands that allow users to interact with a relational database. The core commands include `SELECT` for querying data, `INSERT INTO` for adding new records, `UPDATE` for modifying existing data, and `DELETE` for removing records. Queries can be filtered using `WHERE`, sorted with `ORDER BY`, and data from multiple tables can be combined using `JOIN`. These commands form the foundation of SQL, enabling efficient data manipulation and retrieval within a database. -Learn more about SQL from the following resources: +Visit the following resources to learn more: - [@article@SQL Tutorial - Mode](https://mode.com/sql-tutorial/) -- [@article@SQL Tutorial](https://www.sqltutorial.org/) +- [@article@SQL Tutorial](https://www.sqltutorial.org/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/begin@7sTW1vwUhCFOMXYjScVEt.md b/src/data/roadmaps/sql/content/begin@7sTW1vwUhCFOMXYjScVEt.md index 3477e6d79..1655c4236 100644 --- a/src/data/roadmaps/sql/content/begin@7sTW1vwUhCFOMXYjScVEt.md +++ b/src/data/roadmaps/sql/content/begin@7sTW1vwUhCFOMXYjScVEt.md @@ -2,7 +2,7 @@ `BEGIN` is used in SQL to start a transaction, which is a sequence of one or more SQL operations that are executed as a single unit. A transaction ensures that all operations within it are completed successfully before any changes are committed to the database. If any part of the transaction fails, the `ROLLBACK` command can be used to undo all changes made during the transaction, maintaining the integrity of the database. Once all operations are successfully completed, the `COMMIT` command is used to save the changes. Transactions are crucial for maintaining data consistency and handling errors effectively. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@BEGIN...END Statement](https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/BABFBJAB.htm) - [@article@SQL 'BEGIN' & 'END' Statements](https://reintech.io/blog/understanding-sql-begin-end-statements-guide) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/case@W2ePJHdfEiEJ3ZKoRQKt_.md b/src/data/roadmaps/sql/content/case@W2ePJHdfEiEJ3ZKoRQKt_.md index 4cccdbe2f..3de6284f8 100644 --- a/src/data/roadmaps/sql/content/case@W2ePJHdfEiEJ3ZKoRQKt_.md +++ b/src/data/roadmaps/sql/content/case@W2ePJHdfEiEJ3ZKoRQKt_.md @@ -2,6 +2,6 @@ The CASE statement in SQL is used to create conditional logic within a query, allowing you to perform different actions based on specific conditions. It operates like an if-else statement, returning different values depending on the outcome of each condition. The syntax typically involves specifying one or more WHEN conditions, followed by the result for each condition, and an optional ELSE clause for a default outcome if none of the conditions are met. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL CASE - Intermediate SQL](https://mode.com/sql-tutorial/sql-case) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/ceiling@BAqJQvcguhIhzyII5LRH6.md b/src/data/roadmaps/sql/content/ceiling@BAqJQvcguhIhzyII5LRH6.md index f8fe35fe3..a5f9bbee2 100644 --- a/src/data/roadmaps/sql/content/ceiling@BAqJQvcguhIhzyII5LRH6.md +++ b/src/data/roadmaps/sql/content/ceiling@BAqJQvcguhIhzyII5LRH6.md @@ -2,6 +2,6 @@ The `CEILING()` function in SQL returns the smallest integer greater than or equal to a given numeric value. It's useful when you need to round up a number to the nearest whole number, regardless of whether the number is already an integer or a decimal. For example, `CEILING(4.2)` would return `5`, and `CEILING(-4.7)` would return `-4`. This function is commonly used in scenarios where rounding up is necessary, such as calculating the number of pages needed to display a certain number of items when each page has a fixed capacity. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL CEILING](https://www.w3schools.com/sql/func_sqlserver_ceiling.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/check@Q0h9Wfnl_W9ThOkv7Q17A.md b/src/data/roadmaps/sql/content/check@Q0h9Wfnl_W9ThOkv7Q17A.md index 9cd020ab0..f258be3eb 100644 --- a/src/data/roadmaps/sql/content/check@Q0h9Wfnl_W9ThOkv7Q17A.md +++ b/src/data/roadmaps/sql/content/check@Q0h9Wfnl_W9ThOkv7Q17A.md @@ -2,6 +2,6 @@ A `CHECK` constraint in SQL is used to enforce data integrity by specifying a condition that must be true for each row in a table. It allows you to define custom rules or restrictions on the values that can be inserted or updated in one or more columns. `CHECK` constraints help maintain data quality by preventing invalid or inconsistent data from being added to the database, ensuring that only data meeting specified criteria is accepted. -Learn more from the following resources: +Visit the following resources to learn more: -- [@video@CHECK Constraint](https://www.youtube.com/watch?v=EeG2boJCXbc) +- [@video@CHECK Constraint](https://www.youtube.com/watch?v=EeG2boJCXbc) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/coalesce@k7lZe4QRt9q4InUImFmvx.md b/src/data/roadmaps/sql/content/coalesce@k7lZe4QRt9q4InUImFmvx.md index be5fb2207..86fb61833 100644 --- a/src/data/roadmaps/sql/content/coalesce@k7lZe4QRt9q4InUImFmvx.md +++ b/src/data/roadmaps/sql/content/coalesce@k7lZe4QRt9q4InUImFmvx.md @@ -2,7 +2,7 @@ `COALESCE` is an SQL function that returns the first non-null value in a list of expressions. It's commonly used to handle null values or provide default values in queries. `COALESCE` evaluates its arguments in order and returns the first non-null result, making it useful for data cleaning, report generation, and simplifying complex conditional logic in SQL statements. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to use the COALESCE function in SQL](https://learnsql.com/blog/coalesce-function-sql/) - [@article@COALESCE - PostgreSQL](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-coalesce/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/column@wmtt-3auWLdQWuVdwZLPd.md b/src/data/roadmaps/sql/content/column@wmtt-3auWLdQWuVdwZLPd.md index b3e362861..fff82c425 100644 --- a/src/data/roadmaps/sql/content/column@wmtt-3auWLdQWuVdwZLPd.md +++ b/src/data/roadmaps/sql/content/column@wmtt-3auWLdQWuVdwZLPd.md @@ -1,7 +1,7 @@ # Column -In SQL, columns are used to categorize the data in a table. A column serves as a structure that stores a specific type of data (ints, str, bool, etc.) in a table. Each column in a table is designed with a type, which configures the data that it can hold. Using the right column types and size can help to maintain data integrity and optimize performance. +In SQL, columns are used to categorize the data in a table. A column serves as a structure that stores a specific type of data (ints, str, bool, etc.) in a table. Each column in a table is designed with a type, which configures the data that it can hold. Using the right column types and size can help to maintain data integrity and optimize performance. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Column Types - PostgreSQL](https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-data-types/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/commit@3cMECz5QPVDOFrk5duObs.md b/src/data/roadmaps/sql/content/commit@3cMECz5QPVDOFrk5duObs.md index ab4f680e2..2f7dd6822 100644 --- a/src/data/roadmaps/sql/content/commit@3cMECz5QPVDOFrk5duObs.md +++ b/src/data/roadmaps/sql/content/commit@3cMECz5QPVDOFrk5duObs.md @@ -1,9 +1,7 @@ # COMMIT -The SQL COMMIT command is used to save all the modifications made by the current transaction to the database. A COMMIT command ends the current transaction and makes permanent all changes performed in the transaction. It is a way of ending your transaction and saving your changes to the database. +COMMIT is an SQL command that saves all changes made during a transaction to the database. Until a COMMIT command is issued, all modifications within a transaction are only temporary and visible to the current session. Once COMMIT is executed, the changes become permanent and visible to other users and sessions. This ensures data consistency and durability. -After the SQL COMMIT statement is executed, it can not be rolled back, which means you can't undo the operations. COMMIT command is used when the user is satisfied with the changes made in the transaction, and these changes can now be made permanent in the database. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL COMMIT and ROLLBACK](https://www.digitalocean.com/community/tutorials/sql-commit-sql-rollback) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/common-table-expressions@tedQynR0xicVKhuR1oahw.md b/src/data/roadmaps/sql/content/common-table-expressions@tedQynR0xicVKhuR1oahw.md index ae4d301c2..22457249e 100644 --- a/src/data/roadmaps/sql/content/common-table-expressions@tedQynR0xicVKhuR1oahw.md +++ b/src/data/roadmaps/sql/content/common-table-expressions@tedQynR0xicVKhuR1oahw.md @@ -2,7 +2,7 @@ Common Table Expressions (CTEs) in SQL are named temporary result sets that exist within the scope of a single `SELECT`, `INSERT`, `UPDATE`, `DELETE`, or `MERGE` statement. Defined using the `WITH` clause, CTEs act like virtual tables that can be referenced multiple times within a query. They improve query readability, simplify complex queries by breaking them into manageable parts, and allow for recursive queries. CTEs are particularly useful for hierarchical or graph-like data structures and can enhance query performance in some database systems. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Common Table Expressions (CTEs)](https://hightouch.com/sql-dictionary/sql-common-table-expression-cte) -- [@article@What is a Common Table Expression?](https://learnsql.com/blog/what-is-common-table-expression/) +- [@article@What is a Common Table Expression?](https://learnsql.com/blog/what-is-common-table-expression/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/concat@5inpEqafeVCfqsURHzQQg.md b/src/data/roadmaps/sql/content/concat@5inpEqafeVCfqsURHzQQg.md index d720a0a6d..f4f25ca2c 100644 --- a/src/data/roadmaps/sql/content/concat@5inpEqafeVCfqsURHzQQg.md +++ b/src/data/roadmaps/sql/content/concat@5inpEqafeVCfqsURHzQQg.md @@ -2,6 +2,6 @@ `CONCAT` is an SQL function used to combine two or more strings into a single string. It takes multiple input strings as arguments and returns a new string that is the concatenation of all the input strings in the order they were provided. `CONCAT` is commonly used in `SELECT` statements to merge data from multiple columns, create custom output formats, or generate dynamic SQL statements. -Learn more from the following resources: +Visit the following resources to learn more: -- [@article@An overview of the CONCAT function in SQL](https://www.sqlshack.com/an-overview-of-the-concat-function-in-sql-with-examples/) +- [@article@An overview of the CONCAT function in SQL](https://www.sqlshack.com/an-overview-of-the-concat-function-in-sql-with-examples/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/correlated-subqueries@JZqS3Xapw6mfSPVgFW7av.md b/src/data/roadmaps/sql/content/correlated-subqueries@JZqS3Xapw6mfSPVgFW7av.md index 2038a9075..d7d998500 100644 --- a/src/data/roadmaps/sql/content/correlated-subqueries@JZqS3Xapw6mfSPVgFW7av.md +++ b/src/data/roadmaps/sql/content/correlated-subqueries@JZqS3Xapw6mfSPVgFW7av.md @@ -2,7 +2,7 @@ In SQL, a correlated subquery is a subquery that uses values from the outer query in its `WHERE` clause. The correlated subquery is evaluated once for each row processed by the outer query. It exists because it depends on the outer query and it cannot execute independently of the outer query because the subquery is correlated with the outer query as it uses its column in its `WHERE` clause. -Learn more from the following resources: +Visit the following resources to learn more: - [@official@Correlated Subqueries](https://dev.mysql.com/doc/refman/8.4/en/correlated-subqueries.html) - [@video@Intro To Subqueries](https://www.youtube.com/watch?v=TUxadt94L0M) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/count@9aHYrOQDkA84tlxcVK5aD.md b/src/data/roadmaps/sql/content/count@9aHYrOQDkA84tlxcVK5aD.md index 787e283e7..013bd3eb6 100644 --- a/src/data/roadmaps/sql/content/count@9aHYrOQDkA84tlxcVK5aD.md +++ b/src/data/roadmaps/sql/content/count@9aHYrOQDkA84tlxcVK5aD.md @@ -2,6 +2,6 @@ `COUNT` is an SQL aggregate function that returns the number of rows that match the specified criteria. It can be used to count all rows in a table, non-null values in a specific column, or rows that meet certain conditions when combined with a `WHERE` clause. `COUNT` is often used in data analysis, reporting, and performance optimization queries to determine the size of datasets or the frequency of particular values. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@COUNT SQL Function](https://www.datacamp.com/tutorial/count-sql-function) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/create-table@epEpBxRosLhuAuKwp823r.md b/src/data/roadmaps/sql/content/create-table@epEpBxRosLhuAuKwp823r.md index 92754a8f6..5982a8e4e 100644 --- a/src/data/roadmaps/sql/content/create-table@epEpBxRosLhuAuKwp823r.md +++ b/src/data/roadmaps/sql/content/create-table@epEpBxRosLhuAuKwp823r.md @@ -2,7 +2,7 @@ `CREATE TABLE` is an SQL statement used to define and create a new table in a database. It specifies the table name, column names, data types, and optional constraints such as primary keys, foreign keys, and default values. This statement establishes the structure of the table, defining how data will be stored and organized within it. `CREATE TABLE` is a fundamental command in database management, essential for setting up the schema of a database and preparing it to store data. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@CREATE TABLE](https://www.tutorialspoint.com/sql/sql-create-table.htm) - [@article@SQL CREATE TABLE](https://www.programiz.com/sql/create-table) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/creating-views@PcsGK4VBh0zNQIPZvNES4.md b/src/data/roadmaps/sql/content/creating-views@PcsGK4VBh0zNQIPZvNES4.md index c0bd413a6..ea980c83a 100644 --- a/src/data/roadmaps/sql/content/creating-views@PcsGK4VBh0zNQIPZvNES4.md +++ b/src/data/roadmaps/sql/content/creating-views@PcsGK4VBh0zNQIPZvNES4.md @@ -2,7 +2,7 @@ Creating views in SQL involves using the `CREATE VIEW` statement to define a virtual table based on the result of a `SELECT` query. Views don't store data themselves but provide a way to present data from one or more tables in a specific format. They can simplify complex queries, enhance data security by restricting access to underlying tables, and provide a consistent interface for querying frequently used data combinations. Views can be queried like regular tables and are often used to encapsulate business logic or present data in a more user-friendly manner. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to create a view in SQL](https://www.sqlshack.com/how-to-create-a-view-in-sql-server/) - [@video@SQL Views in 4 minutes](https://www.youtube.com/watch?v=vLLkNI-vkV8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/cross-join@7ow6tiSSCnTpv_GYQU017.md b/src/data/roadmaps/sql/content/cross-join@7ow6tiSSCnTpv_GYQU017.md index f4019b1c5..eab0a4cfb 100644 --- a/src/data/roadmaps/sql/content/cross-join@7ow6tiSSCnTpv_GYQU017.md +++ b/src/data/roadmaps/sql/content/cross-join@7ow6tiSSCnTpv_GYQU017.md @@ -1,9 +1,7 @@ # Cross Join -The cross join in SQL is used to combine every row of the first table with every row of the second table. It's also known as the Cartesian product of the two tables. The most important aspect of performing a cross join is that it does not require any condition to join. +A Cross Join produces a result set that is the number of rows in the first table multiplied by the number of rows in the second table. If a WHERE clause is used in conjunction with a CROSS JOIN, it functions like an INNER JOIN. However, using an INNER JOIN is generally preferred to using a CROSS JOIN with a WHERE clause for readability and performance reasons. It essentially creates all possible combinations of rows from the tables involved. -The issue with cross join is it returns the Cartesian product of the two tables, which can result in large numbers of rows and heavy resource usage. It's hence critical to use them wisely and only when necessary. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL CROSS JOIN With Examples](https://www.sqlshack.com/sql-cross-join-with-examples/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-constraints@qBios3sZVhcJMpXmj9f7B.md b/src/data/roadmaps/sql/content/data-constraints@qBios3sZVhcJMpXmj9f7B.md index c2425750e..66dc35f31 100644 --- a/src/data/roadmaps/sql/content/data-constraints@qBios3sZVhcJMpXmj9f7B.md +++ b/src/data/roadmaps/sql/content/data-constraints@qBios3sZVhcJMpXmj9f7B.md @@ -2,6 +2,6 @@ Data constraints in SQL are rules applied to columns or tables to enforce data integrity and consistency. They include primary key, foreign key, unique, check, and not null constraints. These constraints define limitations on the data that can be inserted, updated, or deleted in a database, ensuring that the data meets specific criteria and maintains relationships between tables. By implementing data constraints, database designers can prevent invalid data entry, maintain referential integrity, and enforce business rules directly at the database level. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Constraints](https://www.programiz.com/sql/constraints) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-definition-language-ddl@xPOeXK1EPBNG56vgfG-VV.md b/src/data/roadmaps/sql/content/data-definition-language-ddl@xPOeXK1EPBNG56vgfG-VV.md index 226f3a9f8..5764264de 100644 --- a/src/data/roadmaps/sql/content/data-definition-language-ddl@xPOeXK1EPBNG56vgfG-VV.md +++ b/src/data/roadmaps/sql/content/data-definition-language-ddl@xPOeXK1EPBNG56vgfG-VV.md @@ -2,7 +2,7 @@ Data Definition Language (DDL) is a subset of SQL used to define and manage the structure of database objects. DDL commands include `CREATE`, `ALTER`, `DROP`, and `TRUNCATE`, which are used to create, modify, delete, and empty database structures such as tables, indexes, views, and schemas. These commands allow database administrators and developers to define the database schema, set up relationships between tables, and manage the overall structure of the database. DDL statements typically result in immediate changes to the database structure and can affect existing data. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Data Definition Language (DDL)](https://docs.getdbt.com/terms/ddl) - [@article@The Definitive Guide on Data Definition Language](https://www.dbvis.com/thetable/sql-ddl-the-definitive-guide-on-data-definition-language/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-integrity--security@R1ktDJpXOz0PTllAcBrdu.md b/src/data/roadmaps/sql/content/data-integrity--security@R1ktDJpXOz0PTllAcBrdu.md index 6a346732a..7e0b3f21e 100644 --- a/src/data/roadmaps/sql/content/data-integrity--security@R1ktDJpXOz0PTllAcBrdu.md +++ b/src/data/roadmaps/sql/content/data-integrity--security@R1ktDJpXOz0PTllAcBrdu.md @@ -1,5 +1,3 @@ -# Data Integrity and Security +# Data Integrity & Security -Data integrity and security in SQL encompass measures and techniques to ensure data accuracy, consistency, and protection within a database. This includes implementing constraints (like primary keys and foreign keys), using transactions to maintain data consistency, setting up user authentication and authorization, encrypting sensitive data, and regularly backing up the database. - -SQL provides various tools and commands to enforce data integrity rules, control access to data, and protect against unauthorized access or data corruption, ensuring the reliability and confidentiality of stored information. \ No newline at end of file +Data integrity ensures that the information stored in a database is accurate, consistent, and reliable over its entire lifecycle. Data security involves protecting the database from unauthorized access, modification, or deletion. These two concepts are essential for maintaining the trust and value of any database system, safeguarding against corruption, breaches, and ensuring data is used appropriately. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-integrity-constraints@mBQ3Z8GlFcpIena3IB7D_.md b/src/data/roadmaps/sql/content/data-integrity-constraints@mBQ3Z8GlFcpIena3IB7D_.md index b37a2aebd..93d7bc2a6 100644 --- a/src/data/roadmaps/sql/content/data-integrity-constraints@mBQ3Z8GlFcpIena3IB7D_.md +++ b/src/data/roadmaps/sql/content/data-integrity-constraints@mBQ3Z8GlFcpIena3IB7D_.md @@ -1,10 +1,8 @@ # Data Integrity Constraints -SQL constraints are used to specify rules for the data in a table. They ensure the accuracy and reliability of the data within the table. If there is any violation between the constraint and the action, the action is aborted by the constraint. +Data integrity constraints are rules you set up in a database to make sure the data is accurate and reliable. These rules prevent bad data from being entered into tables. Think of them as checks and balances that maintain the quality of your information by enforcing specific criteria like uniqueness, valid ranges, or required values. -Constraints are classified into two types: column level and table level. Column level constraints apply to individual columns whereas table level constraints apply to the entire table. Each constraint has its own purpose and usage, utilizing them effectively helps maintain the accuracy and integrity of the data. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Integrity Constraints in SQL: A Guide With Examples](https://www.datacamp.com/tutorial/integrity-constraints-sql) - [@article@Integrity Constraints](https://dataheadhunters.com/academy/integrity-constraints-ensuring-accuracy-and-consistency-in-your-data/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-manipulation-language-dml@WMSXi-eez_hHGDM8kUdWz.md b/src/data/roadmaps/sql/content/data-manipulation-language-dml@WMSXi-eez_hHGDM8kUdWz.md index 5fdccb563..f4a1ed3ea 100644 --- a/src/data/roadmaps/sql/content/data-manipulation-language-dml@WMSXi-eez_hHGDM8kUdWz.md +++ b/src/data/roadmaps/sql/content/data-manipulation-language-dml@WMSXi-eez_hHGDM8kUdWz.md @@ -6,4 +6,4 @@ Visit the following resources to learn more: - [@article@What is DML?](https://satoricyber.com/glossary/dml-data-manipulation-language) - [@article@What is DML?(Wiki)](https://en.wikipedia.org/wiki/Data_manipulation_language) -- [@article@Difference Between DMS & DML](https://appmaster.io/blog/difference-between-ddl-and-dml) +- [@article@Difference Between DMS & DML](https://appmaster.io/blog/difference-between-ddl-and-dml) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/data-types@tBzMDfCMh6MIagNaxCzin.md b/src/data/roadmaps/sql/content/data-types@tBzMDfCMh6MIagNaxCzin.md index 9a2d35199..69bbd0b54 100644 --- a/src/data/roadmaps/sql/content/data-types@tBzMDfCMh6MIagNaxCzin.md +++ b/src/data/roadmaps/sql/content/data-types@tBzMDfCMh6MIagNaxCzin.md @@ -2,7 +2,7 @@ SQL data types define the kind of values that can be stored in a column and determine how the data is stored, processed, and retrieved. Common data types include numeric types (`INTEGER`, `DECIMAL`), character types (`CHAR`, `VARCHAR`), date and time types (`DATE`, `TIMESTAMP`), binary types (`BLOB`), and boolean types. Each database management system may have its own specific set of data types with slight variations. Choosing the appropriate data type for each column is crucial for optimizing storage, ensuring data integrity, and improving query performance. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Data Types](https://www.digitalocean.com/community/tutorials/sql-data-types) - [@video@MySQL 101 - Data Types](https://www.youtube.com/watch?v=vAiBa69YCnk) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/date@Ivqo2wa-_NhGU3vGd0pUI.md b/src/data/roadmaps/sql/content/date@Ivqo2wa-_NhGU3vGd0pUI.md index fde8035a7..412ed87f3 100644 --- a/src/data/roadmaps/sql/content/date@Ivqo2wa-_NhGU3vGd0pUI.md +++ b/src/data/roadmaps/sql/content/date@Ivqo2wa-_NhGU3vGd0pUI.md @@ -2,6 +2,6 @@ The DATE data type in SQL is used to store calendar dates (typically in the format YYYY-MM-DD). It represents a specific day without any time information. DATE columns are commonly used for storing birthdates, event dates, or any other data that requires only day-level precision. SQL provides various functions to manipulate and format DATE values, allowing for date arithmetic, extraction of date components, and comparison between dates. The exact range of valid dates may vary depending on the specific database management system being used. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@Working with Dates](https://www.youtube.com/watch?v=XyZ9HwXoR7o) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/dateadd@1E1WdWOyqxbbdiIbw26dZ.md b/src/data/roadmaps/sql/content/dateadd@1E1WdWOyqxbbdiIbw26dZ.md index 47963cd2d..6db8a2aef 100644 --- a/src/data/roadmaps/sql/content/dateadd@1E1WdWOyqxbbdiIbw26dZ.md +++ b/src/data/roadmaps/sql/content/dateadd@1E1WdWOyqxbbdiIbw26dZ.md @@ -2,7 +2,7 @@ `DATEADD` is an SQL function used to add or subtract a specified time interval to a date or datetime value. It typically takes three arguments: the interval type (e.g., day, month, year), the number of intervals to add or subtract, and the date to modify. This function is useful for date calculations, such as finding future or past dates, calculating durations, or generating date ranges. The exact syntax and name of this function may vary slightly between different database management systems (e.g., `DATEADD` in SQL Server, `DATE_ADD` in MySQL). -Learn more from the following resources: +Visit the following resources to learn more: - [@article@DATEADD](https://www.mssqltips.com/sqlservertutorial/9380/sql-dateadd-function/) - [@video@DATEADD Function](https://www.youtube.com/watch?v=DYCWOzzOycU) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/datepart@BJ4fQvagTO0B5UtXblyx8.md b/src/data/roadmaps/sql/content/datepart@BJ4fQvagTO0B5UtXblyx8.md index 58c8e07da..9693db390 100644 --- a/src/data/roadmaps/sql/content/datepart@BJ4fQvagTO0B5UtXblyx8.md +++ b/src/data/roadmaps/sql/content/datepart@BJ4fQvagTO0B5UtXblyx8.md @@ -2,6 +2,6 @@ `DATEPART` is a useful function in SQL that allows you to extract a specific part of a date or time field. You can use it to get the year, quarter, month, day of the year, day, week, weekday, hour, minute, second, or millisecond from any date or time expression. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL DATEPART](https://hightouch.com/sql-dictionary/sql-datepart) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/db-security-best-practices@vhBZqqmUcEon6-Vwvla4q.md b/src/data/roadmaps/sql/content/db-security-best-practices@vhBZqqmUcEon6-Vwvla4q.md index 7f745fa33..d28bb64f8 100644 --- a/src/data/roadmaps/sql/content/db-security-best-practices@vhBZqqmUcEon6-Vwvla4q.md +++ b/src/data/roadmaps/sql/content/db-security-best-practices@vhBZqqmUcEon6-Vwvla4q.md @@ -1,47 +1,7 @@ -# Database Security Best Practices +# DB Security Best Practices -Database security is key in ensuring sensitive information is kept intact and isn't exposed to a malicious or accidental breach. Here are some best practices related to SQL security: +Database security best practices are a collection of methods used to protect sensitive data from unauthorized access, modification, or deletion. They involve implementing access controls based on the least privilege principle, routinely updating systems, using strong passwords, limiting remote access, avoiding the admin account for everyday tasks, encrypting communication, performing regular backups, monitoring and auditing database operations, performing vulnerability scanning, and guarding against SQL injection attacks by using parameterized queries or prepared statements. -## 1. Least Privilege Principle - -This principle states that a user should have the minimum levels of access necessary and nothing more. For large systems, this could require a good deal of planning. - -## 2. Regular Updates - -Always keep SQL Server patched and updated to gain the benefit of the most recent security updates. - -## 3. Complex and Secure Passwords - -Passwords should be complex and frequently changed. Alongside the use of `GRANT` and `REVOKE`, this is the front line of defense. - -## 4. Limiting Remote Access - -If remote connections to the SQL server are not necessary, it is best to disable it. - -## 5. Avoid Using SQL Server Admin Account - -You should avoid using the SQL Server admin account for regular database operations to limit security risk. - -## 6. Encrypt Communication - -To protect against data sniffing, all communication between SQL Server and applications should be encrypted. - -## 7. Database Backups - -Regular database backups are crucial for data integrity if there happens to be a data loss. - -## 8. Monitoring and Auditing - -Regularly monitor and audit your database operations to keep track of who does what in your database. - -## 9. Regular Vulnerability Scanning - -Use a vulnerability scanner to assess the security posture of your SQL. - -## 10. SQL Injection - -SQL injection can be reduced by using parameterized queries or prepared statements. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@What is database security?](https://azure.microsoft.com/en-us/resources/cloud-computing-dictionary/what-is-database-security) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/delete@ddtVaA4Ls6qRj-7OtTSIH.md b/src/data/roadmaps/sql/content/delete@ddtVaA4Ls6qRj-7OtTSIH.md index 46d82be1e..2f92b2540 100644 --- a/src/data/roadmaps/sql/content/delete@ddtVaA4Ls6qRj-7OtTSIH.md +++ b/src/data/roadmaps/sql/content/delete@ddtVaA4Ls6qRj-7OtTSIH.md @@ -1,7 +1,7 @@ -# Delete +# DELETE Statement -DELETE is an SQL statement used to remove one or more rows from a table. It allows you to specify which rows to delete using a WHERE clause, or delete all rows if no condition is provided. DELETE is part of the Data Manipulation Language (DML) and is used for data maintenance, removing outdated or incorrect information, or implementing business logic that requires data removal. When used without a WHERE clause, it empties the entire table while preserving its structure, unlike the TRUNCATE command. +The DELETE statement removes rows from a table. You specify which table to remove data from and can use a WHERE clause to filter which rows should be deleted based on specific conditions. If no WHERE clause is provided, all rows in the table will be deleted. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@DELETE](https://www.w3schools.com/sql/sql_delete.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/delete@zWnvuHJLHr03PWkrW1wZZ.md b/src/data/roadmaps/sql/content/delete@zWnvuHJLHr03PWkrW1wZZ.md index e233b06b8..42ef38858 100644 --- a/src/data/roadmaps/sql/content/delete@zWnvuHJLHr03PWkrW1wZZ.md +++ b/src/data/roadmaps/sql/content/delete@zWnvuHJLHr03PWkrW1wZZ.md @@ -1,7 +1,7 @@ -# DELETE +# DELETE Statement in SQL -DELETE is an SQL statement used to remove one or more rows from a table. It allows you to specify which rows to delete using a WHERE clause, or delete all rows if no condition is provided. DELETE is part of the Data Manipulation Language (DML) and is used for data maintenance, removing outdated or incorrect information, or implementing business logic that requires data removal. When used without a WHERE clause, it empties the entire table while preserving its structure, unlike the TRUNCATE command. +The `DELETE` statement in SQL removes existing records from a table. You specify which table to affect and can optionally include a `WHERE` clause to specify conditions for which rows should be deleted. If no `WHERE` clause is provided, all rows in the table will be deleted. It modifies the data within the database by removing entire rows based on the given criteria. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@DELETE](https://www.w3schools.com/sql/sql_delete.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/dense_rank@QM0ltgPu8lLLYc2MsTLj-.md b/src/data/roadmaps/sql/content/dense_rank@QM0ltgPu8lLLYc2MsTLj-.md index 113962b48..4be41f7d1 100644 --- a/src/data/roadmaps/sql/content/dense_rank@QM0ltgPu8lLLYc2MsTLj-.md +++ b/src/data/roadmaps/sql/content/dense_rank@QM0ltgPu8lLLYc2MsTLj-.md @@ -1,10 +1,8 @@ # dense_rank -`DENSE_RANK` is a window function in SQL that assigns a rank to each row within a window partition, with no gaps in the ranking numbers. +`dense_rank` is a window function that assigns a rank to each row within a partition of a result set, based on the order of rows. Unlike the `rank` function, `dense_rank` assigns consecutive ranks without gaps, even when there are ties in the ordering criteria. This means that if two or more rows have the same value for the ordering column(s), they will receive the same rank, and the next rank assigned will be the next consecutive integer, without skipping any numbers. -Unlike the `RANK` function, `DENSE_RANK` does not skip any rank (positions in the order). If you have, for example, 1st, 2nd, and 2nd, the next rank listed would be 3rd when using `DENSE_RANK`, whereas it would be 4th using the `RANK` function. The `DENSE_RANK` function operates on a set of rows, called a window, and in that window, values are compared to each other. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL DENSE_RANK](https://www.sqltutorial.org/sql-window-functions/sql-dense_rank/) - [@article@Breaking Down DENSE_RANK](https://www.kdnuggets.com/breaking-down-denserank-a-step-by-step-guide-for-sql-enthusiasts) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/drop-table@YzJ6QmY2arMfRzMAPaI0T.md b/src/data/roadmaps/sql/content/drop-table@YzJ6QmY2arMfRzMAPaI0T.md index c80f066d8..475217524 100644 --- a/src/data/roadmaps/sql/content/drop-table@YzJ6QmY2arMfRzMAPaI0T.md +++ b/src/data/roadmaps/sql/content/drop-table@YzJ6QmY2arMfRzMAPaI0T.md @@ -1,9 +1,7 @@ # Drop Table -The `DROP TABLE` statement is a Data Definition Language (DDL) operation that is used to **completely remove** a table from the database. This operation deletes the table structure along with **all the data in** it, effectively removing the table from the database system. +The `DROP TABLE` statement removes a table and its data entirely from a database. It's a permanent operation; once a table is dropped, its structure and all the data it contained are lost unless you have a backup. This command should be used with caution, as it can have significant consequences for your database. -When you execute the `DROP TABLE` statement, it eliminates both the table and its data, as well as any associated indexes, constraints, and triggers. Unlike the `TRUNCATE TABLE` statement, which only removes data but keeps the table structure, `DROP TABLE` removes everything associated with the table. +Visit the following resources to learn more: -Learn more from the following resources: - -- [@article@Drop a Table](https://www.coginiti.co/tutorials/beginner/drop-a-table/) +- [@article@Drop a Table](https://www.coginiti.co/tutorials/beginner/drop-a-table/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/dropping-views@MIOuWWcCjLAmgzog2DBC3.md b/src/data/roadmaps/sql/content/dropping-views@MIOuWWcCjLAmgzog2DBC3.md index 336b6d4a9..dd49252c0 100644 --- a/src/data/roadmaps/sql/content/dropping-views@MIOuWWcCjLAmgzog2DBC3.md +++ b/src/data/roadmaps/sql/content/dropping-views@MIOuWWcCjLAmgzog2DBC3.md @@ -2,7 +2,7 @@ Dropping views in SQL involves using the `DROP VIEW` statement to remove an existing view from the database. This operation permanently deletes the view definition, but it doesn't affect the underlying tables from which the view was created. Dropping a view is typically done when the view is no longer needed, needs to be replaced with a different definition, or as part of database maintenance. It's important to note that dropping a view can impact other database objects or applications that depend on it, so caution should be exercised when performing this operation. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@DROP VIEW](https://study.com/academy/lesson/sql-drop-view-tutorial-overview.html) - [@article@DROP or DELETE a View](https://www.tutorialspoint.com/sql/sql-drop-view.htm) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/dynamic-sql@z5Sf0VU14ZCQ80kL1qOqc.md b/src/data/roadmaps/sql/content/dynamic-sql@z5Sf0VU14ZCQ80kL1qOqc.md index 3c4bcc674..a2ccf85eb 100644 --- a/src/data/roadmaps/sql/content/dynamic-sql@z5Sf0VU14ZCQ80kL1qOqc.md +++ b/src/data/roadmaps/sql/content/dynamic-sql@z5Sf0VU14ZCQ80kL1qOqc.md @@ -1,10 +1,8 @@ # Dynamic SQL -Dynamic SQL is a programming method that allows you to build SQL statements dynamically at runtime. It allows you to create more flexible and adaptable applications because you can manipulate the SQL statements on the fly, in response to inputs or changing conditions. +Dynamic SQL refers to the ability to construct and execute SQL statements programmatically during runtime. Instead of writing static SQL queries directly into your code, you can build SQL strings based on varying conditions, user inputs, or other dynamic factors. This allows for more flexible and adaptable database interactions, enabling you to generate queries tailored to specific situations that cannot be known in advance. -Consider an application where a user can choose multiple search conditions from a range of choices. You might not know how many conditions the user will choose, or what they'll be until runtime. With static SQL, you would have to include a large number of potential search conditions in your WHERE clause. With dynamic SQL, you can build the search string based on the user's actual choices. Note that while the use of Dynamic SQL offers greater flexibility, it also comes with potential security risks such as SQL Injection, and should be used judiciously. Always validate and sanitize inputs when building dynamic queries. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Dynamic SQL in SQL Server](https://www.sqlshack.com/dynamic-sql-in-sql-server/) - [@video@Dynamic SQL](https://www.youtube.com/watch?v=01LZMCotcpY) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/floor@o2SH4iQn1Ap2yDZ7cVYLO.md b/src/data/roadmaps/sql/content/floor@o2SH4iQn1Ap2yDZ7cVYLO.md index 682c7a557..d43a4b203 100644 --- a/src/data/roadmaps/sql/content/floor@o2SH4iQn1Ap2yDZ7cVYLO.md +++ b/src/data/roadmaps/sql/content/floor@o2SH4iQn1Ap2yDZ7cVYLO.md @@ -1,9 +1,7 @@ # FLOOR -The SQL `FLOOR` function is used to round down any specific decimal or numeric value to its nearest whole integer. The returned number will be less than or equal to the number given as an argument. +FLOOR is a numeric function that returns the largest integer value that is less than or equal to a given number. Effectively, it rounds a number *down* to the nearest whole number. For instance, FLOOR(7.9) would return 7, and FLOOR(-7.1) would return -8. -One important aspect to note is that the `FLOOR` function's argument must be a number and it always returns an integer. - -Learn more from the following resources: +Visit the following resources to learn more: - [@video@How to Round in SQL](https://www.youtube.com/watch?v=AUXw2JRwCFY) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/foreign-key@DHz6sRLYhFeCbAcNJS8hm.md b/src/data/roadmaps/sql/content/foreign-key@DHz6sRLYhFeCbAcNJS8hm.md index 731f40437..d79f5c375 100644 --- a/src/data/roadmaps/sql/content/foreign-key@DHz6sRLYhFeCbAcNJS8hm.md +++ b/src/data/roadmaps/sql/content/foreign-key@DHz6sRLYhFeCbAcNJS8hm.md @@ -2,8 +2,7 @@ A foreign key in SQL is a column or group of columns in one table that refers to the primary key of another table. It establishes a link between two tables, enforcing referential integrity and maintaining relationships between related data. Foreign keys ensure that values in the referencing table correspond to valid values in the referenced table, preventing orphaned records and maintaining data consistency across tables. They are crucial for implementing relational database designs and supporting complex queries that join multiple tables. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@What is a foreign key?](https://www.cockroachlabs.com/blog/what-is-a-foreign-key/) -- [@video@Foreign Keys are easy (kind of)](https://www.youtube.com/watch?v=rFssfx37UJw) - +- [@video@Foreign Keys are easy (kind of)](https://www.youtube.com/watch?v=rFssfx37UJw) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/from@N1Racr3ZpU320gS545We8.md b/src/data/roadmaps/sql/content/from@N1Racr3ZpU320gS545We8.md index 544fc2bfe..61e3a6b1b 100644 --- a/src/data/roadmaps/sql/content/from@N1Racr3ZpU320gS545We8.md +++ b/src/data/roadmaps/sql/content/from@N1Racr3ZpU320gS545We8.md @@ -1,9 +1,7 @@ -# FROM +# FROM Clause in SELECT Statements -The `FROM` clause in SQL specifies the tables from which the retrieval should be made. It is an integral part of `SELECT` statements and variants of `SELECT` like `SELECT INTO` and `SELECT WHERE`. `FROM` can be used to join tables as well. +The `FROM` clause in SQL specifies the table or tables from which you're retrieving data. It tells the database which dataset to look at when executing your query. Without a `FROM` clause, the database doesn't know where the data is coming from, and the `SELECT` statement wouldn't be able to produce any results. Essentially, it's the foundation upon which you build your data retrieval process. -Typically, `FROM` is followed by space delimited list of tables in which the SELECT operation is to be executed. If you need to pull data from multiple tables, you would separate each table with a comma. - -Learn more from the following resources: +Visit the following resources to learn more: - [@video@How to write basic SQL](https://www.youtube.com/watch?v=YfTDBA45PHk) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/full-outer-join@aS5zCyJRA779yHF0G2pje.md b/src/data/roadmaps/sql/content/full-outer-join@aS5zCyJRA779yHF0G2pje.md index 8cbf92f4b..62e13fc96 100644 --- a/src/data/roadmaps/sql/content/full-outer-join@aS5zCyJRA779yHF0G2pje.md +++ b/src/data/roadmaps/sql/content/full-outer-join@aS5zCyJRA779yHF0G2pje.md @@ -2,6 +2,6 @@ A `FULL OUTER JOIN` in SQL combines the results of both `LEFT` and `RIGHT OUTER JOIN`s. It returns all rows from both tables, matching records where the join condition is met and including unmatched rows from both tables with `NULL` values in place of missing data. This join type is useful when you need to see all data from both tables, regardless of whether there are matching rows, and is particularly valuable for identifying missing relationships or performing data reconciliation between two tables. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL FULL OUTER JOIN](https://www.youtube.com/watch?v=XpBkXo3DCEg) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/grant-and-revoke@03qMopxzjx_-dZbYw9b7J.md b/src/data/roadmaps/sql/content/grant-and-revoke@03qMopxzjx_-dZbYw9b7J.md index 194ab697e..b0d6021dd 100644 --- a/src/data/roadmaps/sql/content/grant-and-revoke@03qMopxzjx_-dZbYw9b7J.md +++ b/src/data/roadmaps/sql/content/grant-and-revoke@03qMopxzjx_-dZbYw9b7J.md @@ -2,7 +2,7 @@ `GRANT` and `REVOKE` are SQL commands used to manage user permissions in a database. `GRANT` is used to give specific privileges (such as `SELECT`, `INSERT`, `UPDATE`, `DELETE`) on database objects to users or roles, while `REVOKE` is used to remove these privileges. These commands are essential for implementing database security, controlling access to sensitive data, and ensuring that users have appropriate permissions for their roles. By using `GRANT` and `REVOKE`, database administrators can fine-tune access control, adhering to the principle of least privilege in database management. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@GRANT](https://www.ibm.com/docs/en/qmf/12.2.0?topic=privileges-sql-grant-statement) - [@article@REVOKE](https://www.ibm.com/docs/en/qmf/12.2.0?topic=privileges-sql-revoke-statement) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/group-by@14TKE6KhrH1yFtHcSZSXq.md b/src/data/roadmaps/sql/content/group-by@14TKE6KhrH1yFtHcSZSXq.md index 572d7a788..a5c23715f 100644 --- a/src/data/roadmaps/sql/content/group-by@14TKE6KhrH1yFtHcSZSXq.md +++ b/src/data/roadmaps/sql/content/group-by@14TKE6KhrH1yFtHcSZSXq.md @@ -2,7 +2,7 @@ `GROUP BY` is an SQL clause used in `SELECT` statements to arrange identical data into groups. It's typically used with aggregate functions (like `COUNT`, `SUM`, `AVG`) to perform calculations on each group of rows. `GROUP BY` collects data across multiple records and groups the results by one or more columns, allowing for analysis of data at a higher level of granularity. This clause is fundamental for generating summary reports, performing data analysis, and creating meaningful aggregations of data in relational databases. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL GROUP BY](https://www.programiz.com/sql/group-by) - [@video@Advanced Aggregate Functions in SQL](https://www.youtube.com/watch?v=nNrgRVIzeHg) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/group-by@Zw8IHfCCMSxmVjx5Ho5ff.md b/src/data/roadmaps/sql/content/group-by@Zw8IHfCCMSxmVjx5Ho5ff.md index 572d7a788..a5c23715f 100644 --- a/src/data/roadmaps/sql/content/group-by@Zw8IHfCCMSxmVjx5Ho5ff.md +++ b/src/data/roadmaps/sql/content/group-by@Zw8IHfCCMSxmVjx5Ho5ff.md @@ -2,7 +2,7 @@ `GROUP BY` is an SQL clause used in `SELECT` statements to arrange identical data into groups. It's typically used with aggregate functions (like `COUNT`, `SUM`, `AVG`) to perform calculations on each group of rows. `GROUP BY` collects data across multiple records and groups the results by one or more columns, allowing for analysis of data at a higher level of granularity. This clause is fundamental for generating summary reports, performing data analysis, and creating meaningful aggregations of data in relational databases. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL GROUP BY](https://www.programiz.com/sql/group-by) - [@video@Advanced Aggregate Functions in SQL](https://www.youtube.com/watch?v=nNrgRVIzeHg) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/having@HhICJpCK5__b-itUoEBES.md b/src/data/roadmaps/sql/content/having@HhICJpCK5__b-itUoEBES.md index 4c68d6f9f..2f51e17dd 100644 --- a/src/data/roadmaps/sql/content/having@HhICJpCK5__b-itUoEBES.md +++ b/src/data/roadmaps/sql/content/having@HhICJpCK5__b-itUoEBES.md @@ -1,12 +1,8 @@ # HAVING -The `HAVING` clause is used in combination with the `GROUP BY` clause to filter the results of `GROUP BY`. It is used to mention conditions on the group functions, like `SUM`, `COUNT`, `AVG`, `MAX` or `MIN`. +The `HAVING` clause in SQL is used to filter the results of aggregate functions. It's similar to the `WHERE` clause, but operates on grouped rows produced by the `GROUP BY` clause. Essentially, `HAVING` allows you to specify conditions that groups must meet to be included in the final result set after aggregation has taken place. -It's important to note that where `WHERE` clause introduces conditions on individual rows, `HAVING` introduces conditions on groups created by the `GROUP BY` clause. - -Also note, `HAVING` applies to summarized group records, whereas `WHERE` applies to individual records. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL HAVING Clause](https://www.programiz.com/sql/having) - [@video@HAVING Clause](https://www.youtube.com/watch?v=tYBOMw7Ob8E) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/having@ytwCkSMTiTuemE0KVfAfy.md b/src/data/roadmaps/sql/content/having@ytwCkSMTiTuemE0KVfAfy.md index 4c68d6f9f..3aed175cb 100644 --- a/src/data/roadmaps/sql/content/having@ytwCkSMTiTuemE0KVfAfy.md +++ b/src/data/roadmaps/sql/content/having@ytwCkSMTiTuemE0KVfAfy.md @@ -1,12 +1,8 @@ # HAVING -The `HAVING` clause is used in combination with the `GROUP BY` clause to filter the results of `GROUP BY`. It is used to mention conditions on the group functions, like `SUM`, `COUNT`, `AVG`, `MAX` or `MIN`. +HAVING is a clause in SQL that filters the results of a `GROUP BY` query. It's like a `WHERE` clause, but it operates on groups rather than individual rows. You use `HAVING` to specify conditions that the group must meet to be included in the final result set. -It's important to note that where `WHERE` clause introduces conditions on individual rows, `HAVING` introduces conditions on groups created by the `GROUP BY` clause. - -Also note, `HAVING` applies to summarized group records, whereas `WHERE` applies to individual records. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL HAVING Clause](https://www.programiz.com/sql/having) - [@video@HAVING Clause](https://www.youtube.com/watch?v=tYBOMw7Ob8E) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/indexes@LcljR70T-OnzSrJJDqOWf.md b/src/data/roadmaps/sql/content/indexes@LcljR70T-OnzSrJJDqOWf.md index 873987eeb..484b6fbce 100644 --- a/src/data/roadmaps/sql/content/indexes@LcljR70T-OnzSrJJDqOWf.md +++ b/src/data/roadmaps/sql/content/indexes@LcljR70T-OnzSrJJDqOWf.md @@ -2,6 +2,6 @@ Indexes in SQL are database objects that improve the speed of data retrieval operations on database tables. They work similarly to book indexes, providing a quick lookup mechanism for finding rows with specific column values. Indexes create a separate data structure that allows the database engine to locate data without scanning the entire table. While they speed up `SELECT` queries, indexes can slow down `INSERT`, `UPDATE`, and `DELETE` operations because the index structure must be updated. Proper index design is crucial for optimizing database performance, especially for large tables or frequently queried columns. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL Indexing Best Practices](https://www.youtube.com/watch?v=BIlFTFrEFOI) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/inner-join@aaua13CkTxLOYXr8cAgPm.md b/src/data/roadmaps/sql/content/inner-join@aaua13CkTxLOYXr8cAgPm.md index d099aee62..c7b874c20 100644 --- a/src/data/roadmaps/sql/content/inner-join@aaua13CkTxLOYXr8cAgPm.md +++ b/src/data/roadmaps/sql/content/inner-join@aaua13CkTxLOYXr8cAgPm.md @@ -1,13 +1,7 @@ # INNER JOIN -An `INNER JOIN` in SQL is a type of join that returns the records with matching values in both tables. This operation compares each row of the first table with each row of the second table to find all pairs of rows that satisfy the join predicate. +INNER JOINs combine rows from two or more tables based on a related column. They return only the rows where there is a match in the specified columns of all tables involved in the join. If there's no matching value in the joined columns, that row is excluded from the result set. -Few things to consider in case of `INNER JOIN`: - -- It is a default join in SQL. If you mention `JOIN` in your query without specifying the type, SQL considers it as an `INNER JOIN`. -- It returns only the matching rows from both the tables. -- If there is no match, the returned is an empty result. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL INNER JOIN Clause](https://www.programiz.com/sql/inner-join) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/insert@-Hew0y53ziZK3epQnGA0O.md b/src/data/roadmaps/sql/content/insert@-Hew0y53ziZK3epQnGA0O.md index 016677277..7ab9972f1 100644 --- a/src/data/roadmaps/sql/content/insert@-Hew0y53ziZK3epQnGA0O.md +++ b/src/data/roadmaps/sql/content/insert@-Hew0y53ziZK3epQnGA0O.md @@ -1,7 +1,7 @@ # INSERT -The "INSERT" statement is used to add new rows of data to a table in a database. There are two main forms of the INSERT command: `INSERT INTO` which, if columns are not named, expects a full set of columns, and `INSERT INTO table_name (column1, column2, ...)` where only named columns will be filled with data. +INSERT is a SQL command used to add new rows of data into a table. It specifies which table to add the data to and provides the values for each column in the new row. You can insert a single row at a time or multiple rows with a single statement. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL INSERT Statement](https://www.youtube.com/watch?v=Yp1MKeIG-M4) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/insert@mPj6BiK5FKKkIQ9WsWEo6.md b/src/data/roadmaps/sql/content/insert@mPj6BiK5FKKkIQ9WsWEo6.md index e7c8157f5..37d60cd7a 100644 --- a/src/data/roadmaps/sql/content/insert@mPj6BiK5FKKkIQ9WsWEo6.md +++ b/src/data/roadmaps/sql/content/insert@mPj6BiK5FKKkIQ9WsWEo6.md @@ -1,7 +1,7 @@ -# Insert +# INSERT Statement -The "INSERT" statement is used to add new rows of data to a table in a database. There are two main forms of the INSERT command: `INSERT INTO` which, if columns are not named, expects a full set of columns, and `INSERT INTO table_name (column1, column2, ...)` where only named columns will be filled with data. +The INSERT statement in SQL is used to add new rows of data into a table. It specifies the table to which you want to add data, and the values you want to insert into each column of that table. You can insert a single row at a time or multiple rows in a single statement. It's a fundamental command for populating your database tables with information. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL INSERT Statement](https://www.youtube.com/watch?v=Yp1MKeIG-M4) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/join-queries@8V6yw7kLaow-VVcv_K_pL.md b/src/data/roadmaps/sql/content/join-queries@8V6yw7kLaow-VVcv_K_pL.md index 3df5fe45f..c48fabdc6 100644 --- a/src/data/roadmaps/sql/content/join-queries@8V6yw7kLaow-VVcv_K_pL.md +++ b/src/data/roadmaps/sql/content/join-queries@8V6yw7kLaow-VVcv_K_pL.md @@ -1,8 +1,8 @@ -# SQL JOIN Queries +# JOIN Queries -SQL `JOIN` queries combine rows from two or more tables based on a related column between them. There are several types of JOINs, including INNER JOIN (returns matching rows), `LEFT JOIN` (returns all rows from the left table and matching rows from the right), `RIGHT JOIN` (opposite of `LEFT JOIN`), and `FULL JOIN` (returns all rows when there's a match in either table). `JOIN`s are fundamental for working with relational databases, allowing users to retrieve data from multiple tables in a single query, establish relationships between tables, and perform complex data analysis across related datasets. +JOIN queries are used to combine rows from two or more tables based on a related column between them. This allows you to retrieve data from multiple tables in a single query, forming a more comprehensive dataset than you could get from a single table alone. Different types of joins, like INNER, LEFT, RIGHT, and FULL OUTER, determine how rows are included in the result based on whether matching values exist in the related columns. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@7 SQL JOIN Examples With Detailed Explanations](https://learnsql.com/blog/sql-join-examples-with-explanations/) - [@video@Joins are easy](https://www.youtube.com/watch?v=G3lJAxg1cy8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/joins@4UQQYbjzwVxZOAxBuXKQS.md b/src/data/roadmaps/sql/content/joins@4UQQYbjzwVxZOAxBuXKQS.md index fab9ac63a..4350db2dd 100644 --- a/src/data/roadmaps/sql/content/joins@4UQQYbjzwVxZOAxBuXKQS.md +++ b/src/data/roadmaps/sql/content/joins@4UQQYbjzwVxZOAxBuXKQS.md @@ -1,14 +1,8 @@ # JOINs -SQL `JOINs` are clauses used to combine rows from two or more tables based on a related column between them. They allow retrieval of data from multiple tables in a single query, enabling complex data analysis and reporting. The main types of `JOINs` include: -- `INNER JOIN` (returns matching rows from both tables) -- `LEFT JOIN` (returns all rows from the left table and matching rows from the right) -- `RIGHT JOIN` (opposite of `LEFT JOIN`) -- `FULL JOIN` (returns all rows when there's a match in either table) +SQL JOINs let you combine data from two or more tables based on a related column between them. Think of it as linking information together to get a more complete view. The four most commonly used are: `INNER JOIN`, which returns rows only when there is a match in both tables; `LEFT JOIN`, which returns all rows from the left table and the matched rows from the right table (or NULL if there's no match); `RIGHT JOIN`, which returns all rows from the right table and the matched rows from the left table (or NULL if there's no match); and `FULL OUTER JOIN`, which returns all rows when there is a match in one of the tables. - `JOINs` are fundamental to relational database operations, facilitating data integration and exploration across related datasets. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL JOINs Cheat Sheet](https://www.datacamp.com/cheat-sheet/sql-joins-cheat-sheet) -- [@video@SQL JOINs Tutorial for beginners](https://www.youtube.com/watch?v=0OQJDd3QqQM) +- [@video@SQL JOINs Tutorial for beginners](https://www.youtube.com/watch?v=0OQJDd3QqQM) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/lag@BcXdxY6bld5c0YNFSKkh-.md b/src/data/roadmaps/sql/content/lag@BcXdxY6bld5c0YNFSKkh-.md index 7f7f6ec64..c902d2a6b 100644 --- a/src/data/roadmaps/sql/content/lag@BcXdxY6bld5c0YNFSKkh-.md +++ b/src/data/roadmaps/sql/content/lag@BcXdxY6bld5c0YNFSKkh-.md @@ -2,7 +2,7 @@ `LAG` is a window function in SQL that provides access to a row at a specified offset prior to the current row within a partition. It allows you to compare the current row's values with previous rows' values without using self-joins. LAG is particularly useful for calculating running differences, identifying trends, or comparing sequential data points in time-series analysis. The function takes the column to offset, the number of rows to offset (default is 1), and an optional default value to return when the offset goes beyond the partition's boundary. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Understanding the LAG function in SQL](https://www.datacamp.com/tutorial/sql-lag) - [@video@LAG and LEAD functions](https://www.youtube.com/watch?v=j2u52RQ0qlw) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/lead@aJJjaGunRrwyh9MjQfJt-.md b/src/data/roadmaps/sql/content/lead@aJJjaGunRrwyh9MjQfJt-.md index 418943c2a..ccbcd348d 100644 --- a/src/data/roadmaps/sql/content/lead@aJJjaGunRrwyh9MjQfJt-.md +++ b/src/data/roadmaps/sql/content/lead@aJJjaGunRrwyh9MjQfJt-.md @@ -2,7 +2,7 @@ `LEAD` is a window function in SQL that provides access to a row at a specified offset after the current row within a partition. It's the counterpart to the `LAG` function, allowing you to look ahead in your dataset rather than behind. `LEAD` is useful for comparing current values with future values, calculating forward-looking metrics, or analyzing trends in sequential data. Like `LAG`, it takes arguments for the column to offset, the number of rows to look ahead (default is 1), and an optional default value when the offset exceeds the partition's boundary. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL LEAD](https://www.codecademy.com/resources/docs/sql/window-functions/lead) - [@video@LAG and LEAD Window Functions in SQL](https://www.youtube.com/watch?v=nHEEyX_yDvo) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/learn-the-basics@nhUKKWyBH80nyKfGT8ErC.md b/src/data/roadmaps/sql/content/learn-the-basics@nhUKKWyBH80nyKfGT8ErC.md index 6f663b6d1..7cb8d0003 100644 --- a/src/data/roadmaps/sql/content/learn-the-basics@nhUKKWyBH80nyKfGT8ErC.md +++ b/src/data/roadmaps/sql/content/learn-the-basics@nhUKKWyBH80nyKfGT8ErC.md @@ -1,17 +1,8 @@ -# Introduction +# Learn the Basics -SQL, which stands for Structured Query Language, is a programming language that is used to communicate with and manage databases. SQL is a standard language for manipulating data held in relational database management systems (RDBMS), or for stream processing in a relational data stream management system (RDSMS). It was first developed in the 1970s by IBM. +SQL (Structured Query Language) is a programming language used to manage and manipulate data stored in relational database management systems (RDBMS). It allows you to retrieve, insert, update, and delete data, as well as define database schemas and control access to data. The basic understanding of SQL is foundational to interact with almost any database. -SQL consists of several components, each serving their own unique purpose in database communication: - -- **Queries:** This is the component that allows you to retrieve data from a database. The SELECT statement is most commonly used for this purpose. -- **Data Definition Language (DDL):** It lets you create, alter, or delete databases and their related objects like tables, views, etc. Commands include CREATE, ALTER, DROP, and TRUNCATE. -- **Data Manipulation Language (DML):** It lets you manage data within database objects. These commands include SELECT, INSERT, UPDATE, and DELETE. -- **Data Control Language (DCL):** It includes commands like GRANT and REVOKE, which primarily deal with rights, permissions and other control-level management tasks for the database system. - -SQL databases come in a number of forms, such as Oracle Database, Microsoft SQL Server, and MySQL. Despite their many differences, all SQL databases utilise the same language commands - SQL. - -Learn more about SQL from the following resources: +Visit the following resources to learn more: - [@article@SQL Tutorial - Mode](https://mode.com/sql-tutorial/) -- [@article@SQL Tutorial](https://www.sqltutorial.org/) +- [@article@SQL Tutorial](https://www.sqltutorial.org/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/left-join@X9cJJ8zLZCF2cOoqxwFfY.md b/src/data/roadmaps/sql/content/left-join@X9cJJ8zLZCF2cOoqxwFfY.md index 1b707418f..c96482ab9 100644 --- a/src/data/roadmaps/sql/content/left-join@X9cJJ8zLZCF2cOoqxwFfY.md +++ b/src/data/roadmaps/sql/content/left-join@X9cJJ8zLZCF2cOoqxwFfY.md @@ -1,7 +1,7 @@ # LEFT JOIN -A `LEFT JOIN` in SQL returns all rows from the left (first) table and the matching rows from the right (second) table. If there's no match in the right table, `NULL` values are returned for those columns. This join type is useful when you want to see all records from one table, regardless of whether they have corresponding entries in another table. `LEFT JOIN`s are commonly used for finding missing relationships, creating reports that include all primary records, or when working with data where not all entries have corresponding matches in related tables. +A LEFT JOIN returns all rows from the left table (the table listed before the `LEFT JOIN` keyword) and the matching rows from the right table (the table listed after the `LEFT JOIN` keyword). If there is no match in the right table for a row in the left table, the result will contain `NULL` values for the columns from the right table. Effectively, it ensures all rows from the left table are included in the result set, regardless of whether there's a corresponding row in the right table. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL LEFT JOIN - SQL Tutorial](https://www.youtube.com/watch?v=giKwmtsz1U8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/length@RH8DLiQpDUWqw3U1522q5.md b/src/data/roadmaps/sql/content/length@RH8DLiQpDUWqw3U1522q5.md index 821bb497a..a8dd96590 100644 --- a/src/data/roadmaps/sql/content/length@RH8DLiQpDUWqw3U1522q5.md +++ b/src/data/roadmaps/sql/content/length@RH8DLiQpDUWqw3U1522q5.md @@ -2,7 +2,7 @@ The `LENGTH` function in SQL returns the number of characters in a string. It's used to measure the size of text data, which can be helpful for data validation, formatting, or analysis. In some database systems, `LENGTH` may count characters differently for multi-byte character sets. Most SQL dialects support `LENGTH`, but some may use alternative names like LEN (in SQL Server) or `CHAR_LENGTH`. This function is particularly useful for enforcing character limits, splitting strings, or identifying anomalies in string data. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to Check the Length of a String in SQL](https://learnsql.com/cookbook/how-to-check-the-length-of-a-string-in-sql/) - [@article@MySQL Length Function](https://www.w3schools.com/sql/func_mysql_length.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/lower@knTG6pAq2mYP24WMa29xI.md b/src/data/roadmaps/sql/content/lower@knTG6pAq2mYP24WMa29xI.md index 24e2d05d2..9fbdf4f01 100644 --- a/src/data/roadmaps/sql/content/lower@knTG6pAq2mYP24WMa29xI.md +++ b/src/data/roadmaps/sql/content/lower@knTG6pAq2mYP24WMa29xI.md @@ -2,7 +2,7 @@ The `LOWER` function in SQL converts all characters in a specified string to lowercase. It's a string manipulation function that takes a single argument (the input string) and returns the same string with all alphabetic characters converted to their lowercase equivalents. `LOWER` is useful for standardizing data, making case-insensitive comparisons, or formatting output. It doesn't affect non-alphabetic characters or numbers in the string. `LOWER` is commonly used in data cleaning, search operations, and ensuring consistent data representation across different systems. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to change text to lowercase in SQL](https://learnsql.com/cookbook/how-to-change-text-to-lowercase-in-sql/) - [@article@LOWER Function](https://www.w3schools.com/sql/func_sqlserver_lower.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/managing-indexes@NtxGd6Vx-REBclry7lZuE.md b/src/data/roadmaps/sql/content/managing-indexes@NtxGd6Vx-REBclry7lZuE.md index 8f8a69613..e77c0a3c9 100644 --- a/src/data/roadmaps/sql/content/managing-indexes@NtxGd6Vx-REBclry7lZuE.md +++ b/src/data/roadmaps/sql/content/managing-indexes@NtxGd6Vx-REBclry7lZuE.md @@ -2,7 +2,7 @@ Managing indexes in SQL involves creating, modifying, and dropping indexes to optimize database performance. This process includes identifying columns that benefit from indexing (frequently queried or used in JOIN conditions), creating appropriate index types (e.g., single-column, composite, unique), and regularly analyzing index usage and effectiveness. Database administrators must balance the improved query performance that indexes provide against the overhead they introduce for data modification operations. Proper index management also includes periodic maintenance tasks like rebuilding or reorganizing indexes to maintain their efficiency as data changes over time. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Server Indexes](https://www.sqlservercentral.com/articles/introduction-to-indexes) - [@article@Optimize index maintenance](https://learn.microsoft.com/en-us/sql/relational-databases/indexes/reorganize-and-rebuild-indexes?view=sql-server-ver16) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/max@YqDJq3fPxUZlwsdq0kJg7.md b/src/data/roadmaps/sql/content/max@YqDJq3fPxUZlwsdq0kJg7.md index 90b11dfd8..b88645934 100644 --- a/src/data/roadmaps/sql/content/max@YqDJq3fPxUZlwsdq0kJg7.md +++ b/src/data/roadmaps/sql/content/max@YqDJq3fPxUZlwsdq0kJg7.md @@ -2,7 +2,7 @@ `MAX` is an aggregate function in SQL that returns the highest value in a set of values. It can be used with numeric, date, or string data types, selecting the maximum value from a specified column. `MAX` is often used in combination with `GROUP BY` to find the highest value within each group. This function is useful for various data analysis tasks, such as finding the highest salary, the most recent date, or the alphabetically last name in a dataset. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@MAX](https://www.techonthenet.com/sql/max.php) - [@video@Basic Aggregate Functions](https://www.youtube.com/watch?v=jcoJuc5e3RE) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/min@bFEYMlqPZtTUYtDQxqHzT.md b/src/data/roadmaps/sql/content/min@bFEYMlqPZtTUYtDQxqHzT.md index 7423831ca..bb0f9e32c 100644 --- a/src/data/roadmaps/sql/content/min@bFEYMlqPZtTUYtDQxqHzT.md +++ b/src/data/roadmaps/sql/content/min@bFEYMlqPZtTUYtDQxqHzT.md @@ -2,7 +2,7 @@ `MIN` is an aggregate function in SQL that returns the lowest value in a set of values. It works with numeric, date, or string data types, selecting the minimum value from a specified column. Often used in conjunction with `GROUP BY`, `MIN` can find the smallest value within each group. This function is useful for various data analysis tasks, such as identifying the lowest price, earliest date, or alphabetically first name in a dataset. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL MAX & MIN](https://www.programiz.com/sql/min-and-max) - [@video@COUNT, SUM, AVG, MIN, MAX (SQL) - Aggregating Data](https://www.youtube.com/watch?v=muwEdPsx534) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/mod@OUw--8zEq6lk5-6oySVHe.md b/src/data/roadmaps/sql/content/mod@OUw--8zEq6lk5-6oySVHe.md index d0fce6a88..103dadad9 100644 --- a/src/data/roadmaps/sql/content/mod@OUw--8zEq6lk5-6oySVHe.md +++ b/src/data/roadmaps/sql/content/mod@OUw--8zEq6lk5-6oySVHe.md @@ -2,6 +2,6 @@ The `MOD` function in SQL calculates the remainder when one number is divided by another. It takes two arguments: the dividend and the divisor. `MOD` returns the remainder of the division operation, which is useful for various mathematical operations, including checking for odd/even numbers, implementing cyclic behaviors, or distributing data evenly. The syntax and exact behavior may vary slightly between different database systems, with some using the % operator instead of the `MOD` keyword. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@MOD Function in SQL](https://www.youtube.com/watch?v=f1Rqf7CwjE0) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/modifying-views@3eE-l-P93nOXoWfLr8PSW.md b/src/data/roadmaps/sql/content/modifying-views@3eE-l-P93nOXoWfLr8PSW.md index f2ff91616..3dd25e394 100644 --- a/src/data/roadmaps/sql/content/modifying-views@3eE-l-P93nOXoWfLr8PSW.md +++ b/src/data/roadmaps/sql/content/modifying-views@3eE-l-P93nOXoWfLr8PSW.md @@ -1,12 +1,8 @@ # Modifying Views -In SQL, you can modify a `VIEW` in two ways: +Modifying views in SQL allows you to alter the structure or definition of an existing view without having to drop and recreate it. This can involve changing the columns included in the view, updating the underlying tables or conditions used in the view's query, or renaming the view. Using `ALTER VIEW` simplifies maintenance and allows for adjustments to views as database requirements evolve. -- Using `CREATE` OR `REPLACE VIEW`: This command helps you modify a VIEW but keeps the VIEW name intact. This is beneficial when you want to change the definition of the `VIEW` but do not want to change the VIEW name. - -- Using the `DROP VIEW` and then `CREATE VIEW`: In this method, you first remove the `VIEW` using the `DROP VIEW` command and then recreate the view using the new definition with the `CREATE VIEW` command. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Modify Views in SQL Server](https://www.sqlshack.com/create-view-sql-modifying-views-in-sql-server/) - [@video@SQL VIEWs in 4 Minutes](https://www.youtube.com/watch?v=vLLkNI-vkV8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/nested-subqueries@xkPJ2MYiXmzC4yqQWyB_7.md b/src/data/roadmaps/sql/content/nested-subqueries@xkPJ2MYiXmzC4yqQWyB_7.md index ebf70b900..0bbe1ca68 100644 --- a/src/data/roadmaps/sql/content/nested-subqueries@xkPJ2MYiXmzC4yqQWyB_7.md +++ b/src/data/roadmaps/sql/content/nested-subqueries@xkPJ2MYiXmzC4yqQWyB_7.md @@ -1,10 +1,8 @@ # Nested Subqueries -In SQL, a subquery is a query that is nested inside a main query. If a subquery is nested inside another subquery, it is called a nested subquery. They can be used in SELECT, INSERT, UPDATE, or DELETE statements or inside another subquery. +Nested subqueries are queries embedded within another SQL query. Think of it as a query inside a query, where the inner query's result is used by the outer query. This allows you to perform more complex data retrieval and filtering operations by breaking down a larger problem into smaller, more manageable steps. Essentially, the outer query depends on the result returned by the inner query to complete its own operation. -Nested subqueries can get complicated quickly, but they are essential for performing complex database tasks. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Nested Subqueries](https://www.studysmarter.co.uk/explanations/computer-science/databases/nested-subqueries-in-sql/) - [@video@MySQL Subqueries](https://www.youtube.com/watch?v=i5acg3Hvu6g) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/not-null@M4M_-vjM9GNy0NmXZneDA.md b/src/data/roadmaps/sql/content/not-null@M4M_-vjM9GNy0NmXZneDA.md index 3a654fde6..9299444ee 100644 --- a/src/data/roadmaps/sql/content/not-null@M4M_-vjM9GNy0NmXZneDA.md +++ b/src/data/roadmaps/sql/content/not-null@M4M_-vjM9GNy0NmXZneDA.md @@ -1,10 +1,8 @@ -# NOT NULL +# NOT NULL Constraint -The `NOT NULL` constraint in SQL ensures that a column cannot have a NULL value. Thus, every row/record must contain a value for that column. It is a way to enforce certain fields to be mandatory while inserting records or updating records in a table. +The NOT NULL constraint in SQL ensures that a column does not accept null values. When a column is defined with this constraint, every row in the table must have a value for that specific column. Attempting to insert or update a row with a null value in a NOT NULL column will result in an error, maintaining data integrity by preventing missing or undefined entries. -For instance, if you're designing a table for employee data, you might want to ensure that the employee's `id` and `name` are always provided. In this case, you'd use the `NOT NULL` constraint. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL IS NULL and IS NOT NULL](https://www.programiz.com/sql/is-null-not-null) - [@video@NOT NULL Constraint](https://www.youtube.com/watch?v=unzHhq82mKU) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/nullif@KI6vngoYcHsnpIk8ErhhS.md b/src/data/roadmaps/sql/content/nullif@KI6vngoYcHsnpIk8ErhhS.md index 7fba3bf7e..aeeaeb134 100644 --- a/src/data/roadmaps/sql/content/nullif@KI6vngoYcHsnpIk8ErhhS.md +++ b/src/data/roadmaps/sql/content/nullif@KI6vngoYcHsnpIk8ErhhS.md @@ -2,6 +2,6 @@ `NULLIF` is an SQL function that compares two expressions and returns NULL if they are equal, otherwise it returns the first expression. It's particularly useful for avoiding division by zero errors or for treating specific values as `NULL` in calculations or comparisons. `NULLIF` takes two arguments and is often used in combination with aggregate functions or in `CASE` statements to handle special cases in data processing or reporting. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@What is NULLIF in SQL?](https://www.youtube.com/watch?v=Jaw53T__RRY) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/operators@ffwniprGJHZzJ7t3lQcXz.md b/src/data/roadmaps/sql/content/operators@ffwniprGJHZzJ7t3lQcXz.md index 5ebf210d9..0c3ea3aa6 100644 --- a/src/data/roadmaps/sql/content/operators@ffwniprGJHZzJ7t3lQcXz.md +++ b/src/data/roadmaps/sql/content/operators@ffwniprGJHZzJ7t3lQcXz.md @@ -2,6 +2,6 @@ SQL operators are symbols or keywords used to perform operations on data within a database. They are essential for constructing queries that filter, compare, and manipulate data. Common types of operators include arithmetic operators (e.g., `+`, `-`, `*`, `/`), which perform mathematical calculations; comparison operators (e.g., `=`, `!=`, `<`, `>`), used to compare values; logical operators (e.g., `AND`, `OR`, `NOT`), which combine multiple conditions in a query; and set operators (e.g., `UNION`, `INTERSECT`, `EXCEPT`), which combine results from multiple queries. These operators enable precise control over data retrieval and modification. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Operators: 6 Different Types](https://dataengineeracademy.com/blog/sql-operators-6-different-types-code-examples/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/optimizing-joins@C0dhS6uLf4TUSfvcWyXhv.md b/src/data/roadmaps/sql/content/optimizing-joins@C0dhS6uLf4TUSfvcWyXhv.md index 76a608c85..32d58609b 100644 --- a/src/data/roadmaps/sql/content/optimizing-joins@C0dhS6uLf4TUSfvcWyXhv.md +++ b/src/data/roadmaps/sql/content/optimizing-joins@C0dhS6uLf4TUSfvcWyXhv.md @@ -2,7 +2,7 @@ Optimizing joins in SQL involves techniques to improve the performance of queries that combine data from multiple tables. Key strategies include using appropriate join types (e.g., `INNER JOIN` for matching rows only, `LEFT JOIN` for all rows from one table), indexing the columns used in join conditions to speed up lookups, and minimizing the data processed by filtering results with `WHERE` clauses before the join. Additionally, reducing the number of joins, avoiding unnecessary columns in the `SELECT` statement, and ensuring that the join conditions are based on indexed and selective columns can significantly enhance query efficiency. Proper join order and using database-specific optimization hints are also important for performance tuning. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to Optimize a SQL Query with Multiple Joins](https://dezbor.com/blog/optimize-sql-query-with-multiple-joins) - [@video@Secret to optimizing SQL queries](https://www.youtube.com/watch?v=BHwzDmr6d7s) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/order-by@NfCiSPrL4upMssukcw3Kh.md b/src/data/roadmaps/sql/content/order-by@NfCiSPrL4upMssukcw3Kh.md index 3199506b2..fbb6ef696 100644 --- a/src/data/roadmaps/sql/content/order-by@NfCiSPrL4upMssukcw3Kh.md +++ b/src/data/roadmaps/sql/content/order-by@NfCiSPrL4upMssukcw3Kh.md @@ -2,6 +2,6 @@ The `ORDER BY` clause in SQL is used to sort the result set of a query by one or more columns. By default, the sorting is in ascending order, but you can specify descending order using the `DESC` keyword. The clause can sort by numeric, date, or text values, and multiple columns can be sorted by listing them in the `ORDER BY` clause, each with its own sorting direction. This clause is crucial for organizing data in a meaningful sequence, such as ordering by a timestamp to show the most recent records first, or alphabetically by name. -Learn more from the following resources: +Visit the following resources to learn more: - [@video@SQL ORDER BY Sorting Clause](https://www.youtube.com/watch?v=h_HHTNjAgS8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/performance-optimization@4rqCPpTb0dAgpheBKshRG.md b/src/data/roadmaps/sql/content/performance-optimization@4rqCPpTb0dAgpheBKshRG.md index eb185222f..4ec00238d 100644 --- a/src/data/roadmaps/sql/content/performance-optimization@4rqCPpTb0dAgpheBKshRG.md +++ b/src/data/roadmaps/sql/content/performance-optimization@4rqCPpTb0dAgpheBKshRG.md @@ -1,8 +1,8 @@ # Performance Optimization -Performance optimization in SQL involves a set of practices aimed at improving the efficiency and speed of database queries and overall system performance. Key strategies include indexing critical columns to speed up data retrieval, optimizing query structure by simplifying or refactoring complex queries, and using techniques like query caching to reduce redundant database calls. Other practices include reducing the use of resource-intensive operations like `JOINs` and `GROUP BY`, selecting only necessary columns (`SELECT *` should be avoided), and leveraging database-specific features such as partitioning, query hints, and execution plan analysis. Regularly monitoring and analyzing query performance, along with maintaining database health through routine tasks like updating statistics and managing indexes, are also vital to sustaining high performance. +Performance optimization in SQL focuses on making your queries run faster and more efficiently. This involves techniques like using indexes to speed up data retrieval, rewriting queries for better performance, and understanding how the database engine executes your SQL code. It's about ensuring your database can handle large amounts of data and complex queries without slowing down. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Performance Tuning SQL Queries](https://mode.com/sql-tutorial/sql-performance-tuning) - [@article@SQL performance tuning](https://stackify.com/performance-tuning-in-sql-server-find-slow-queries/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/pivot--unpivot-operations@nwFaz9i-1s0WVrVaFsoqb.md b/src/data/roadmaps/sql/content/pivot--unpivot-operations@nwFaz9i-1s0WVrVaFsoqb.md index f230f617b..c86ea8fb4 100644 --- a/src/data/roadmaps/sql/content/pivot--unpivot-operations@nwFaz9i-1s0WVrVaFsoqb.md +++ b/src/data/roadmaps/sql/content/pivot--unpivot-operations@nwFaz9i-1s0WVrVaFsoqb.md @@ -1,8 +1,8 @@ -# Pivot and Unpivot Operations +# Pivot / Unpivot Operations -Pivot and Unpivot operations in SQL are used to transform and reorganize data, making it easier to analyze in different formats. The `PIVOT` operation converts rows into columns, allowing you to summarize data and present it in a more readable, table-like format. For example, it can take sales data by month and convert the months into individual columns. Conversely, the `UNPIVOT` operation does the opposite—it converts columns back into rows, which is useful for normalizing data that was previously pivoted or to prepare data for certain types of analysis. These operations are particularly useful in reporting and data visualization scenarios, where different perspectives on the same data set are required. +Pivot and unpivot operations transform the structure of data within a table. Pivoting rotates rows into columns, aggregating data based on common values. Conversely, unpivoting transforms columns into rows, often expanding a table's length while reducing its width. These operations are useful for reshaping data for reporting or analysis. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL PIVOT](https://builtin.com/articles/sql-pivot) - [@article@SQL UNPIVOT](https://duckdb.org/docs/sql/statements/unpivot.html) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/primary-key@Jlwmyq6CUQeDAlL4dazOP.md b/src/data/roadmaps/sql/content/primary-key@Jlwmyq6CUQeDAlL4dazOP.md index 59fe79e0c..45364e1db 100644 --- a/src/data/roadmaps/sql/content/primary-key@Jlwmyq6CUQeDAlL4dazOP.md +++ b/src/data/roadmaps/sql/content/primary-key@Jlwmyq6CUQeDAlL4dazOP.md @@ -2,6 +2,6 @@ A primary key in SQL is a unique identifier for each record in a database table. It ensures that each row in the table is uniquely identifiable, meaning no two rows can have the same primary key value. A primary key is composed of one or more columns, and it must contain unique values without any `NULL` entries. The primary key enforces entity integrity by preventing duplicate records and ensuring that each record can be precisely located and referenced, often through foreign key relationships in other tables. Using a primary key is fundamental for establishing relationships between tables and maintaining the integrity of the data model. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Primary Key](https://www.tutorialspoint.com/sql/sql-primary-key.htm) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/query-analysis-techniques@C6P69YiFdS-ioPXMNfX07.md b/src/data/roadmaps/sql/content/query-analysis-techniques@C6P69YiFdS-ioPXMNfX07.md index 58fc6ebb8..8fa6766f0 100644 --- a/src/data/roadmaps/sql/content/query-analysis-techniques@C6P69YiFdS-ioPXMNfX07.md +++ b/src/data/roadmaps/sql/content/query-analysis-techniques@C6P69YiFdS-ioPXMNfX07.md @@ -1,8 +1,8 @@ # Query Analysis Techniques -Query analysis techniques in SQL involve examining and optimizing queries to improve performance and efficiency. Key techniques include using `EXPLAIN` or `EXPLAIN PLAN` commands to understand the query execution plan, which reveals how the database processes the query, including join methods, index usage, and data retrieval strategies. Analyzing `execution plans` helps identify bottlenecks such as full table scans or inefficient joins. Other techniques include `profiling queries` to measure execution time, `examining indexes` to ensure they are effectively supporting query operations, and `refactoring queries` by breaking down complex queries into simpler, more efficient components. Additionally, monitoring `database performance metrics` like CPU, memory usage, and disk I/O can provide insights into how queries impact overall system performance. Regularly applying these techniques allows for the identification and resolution of performance issues, leading to faster and more efficient database operations. +Understanding how SQL queries are executed is essential for performance tuning. Tools like `EXPLAIN` or `EXPLAIN PLAN` allow you to dissect the execution plan the database uses for a specific query. This plan reveals the order in which tables are accessed, the types of indexes used (or not used), and the estimated cost of each operation, enabling you to identify bottlenecks and optimize the query for faster execution. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@EXPLAIN](https://docs.snowflake.com/en/sql-reference/sql/explain) - [@article@EXPLAIN PLAN](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/EXPLAIN-PLAN.html) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/query-optimization@Ps9Yv2s-bKvEegGAbPsiA.md b/src/data/roadmaps/sql/content/query-optimization@Ps9Yv2s-bKvEegGAbPsiA.md index 51f3043f9..3b4f0307a 100644 --- a/src/data/roadmaps/sql/content/query-optimization@Ps9Yv2s-bKvEegGAbPsiA.md +++ b/src/data/roadmaps/sql/content/query-optimization@Ps9Yv2s-bKvEegGAbPsiA.md @@ -1,8 +1,8 @@ # Query Optimization -Query optimization in SQL involves refining queries to enhance their execution speed and reduce resource consumption. Key strategies include indexing columns used in `WHERE`, `JOIN`, and `ORDER BY` clauses to accelerate data retrieval, minimizing data processed by limiting the number of columns selected and filtering rows early in the query. Using appropriate join types and arranging joins in the most efficient order are crucial. Avoiding inefficient patterns like `SELECT *`, replacing subqueries with joins or common table expressions (CTEs), and leveraging query hints or execution plan analysis can also improve performance. Regularly updating statistics and ensuring that queries are structured to take advantage of database-specific optimizations are essential practices for maintaining optimal performance. +Query optimization is the process of selecting the most efficient way to execute a SQL query. It involves the database management system (DBMS) analyzing different possible execution plans for a query and choosing the one that will return the results fastest, using the least amount of resources. This analysis considers factors like the data volume, index usage, and system resources to find the optimal path. -Learn more from the following resources: +Visit the following resources to learn more: -- [@video@SQL Query Optimization](https://www.youtube.com/watch?v=GA8SaXDLdsY) -- [@article@12 Ways to Optimize SQL Queries](https://www.developernation.net/blog/12-ways-to-optimize-sql-queries-in-database-management/) \ No newline at end of file +- [@article@12 Ways to Optimize SQL Queries](https://www.developernation.net/blog/12-ways-to-optimize-sql-queries-in-database-management/) +- [@video@SQL Query Optimization](https://www.youtube.com/watch?v=GA8SaXDLdsY) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/rank@cucCPw3KfetAP2OMFUs0X.md b/src/data/roadmaps/sql/content/rank@cucCPw3KfetAP2OMFUs0X.md index 30a03870e..ad2d683ac 100644 --- a/src/data/roadmaps/sql/content/rank@cucCPw3KfetAP2OMFUs0X.md +++ b/src/data/roadmaps/sql/content/rank@cucCPw3KfetAP2OMFUs0X.md @@ -2,7 +2,7 @@ The `RANK` function in SQL is a window function that assigns a rank to each row within a partition of a result set, based on the order specified by the `ORDER BY` clause. Unlike the `ROW_NUMBER` function, `RANK` allows for the possibility of ties—rows with equal values in the ordering column(s) receive the same rank, and the next rank is skipped accordingly. For example, if two rows share the same rank of 1, the next rank will be 3. This function is useful for scenarios where you need to identify relative positions within groups, such as ranking employees by salary within each department. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Overview of SQL RANK Functions](https://www.sqlshack.com/overview-of-sql-rank-functions/) - [@video@RANK, DENSE_RANK, ROW_NUMBER SQL Analytical Functions Simplified](https://www.youtube.com/watch?v=xMWEVFC4FOk) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/rdbms-benefits-and-limitations@fNTb9y3zs1HPYclAmu_Wv.md b/src/data/roadmaps/sql/content/rdbms-benefits-and-limitations@fNTb9y3zs1HPYclAmu_Wv.md index 4385a4009..35826403d 100644 --- a/src/data/roadmaps/sql/content/rdbms-benefits-and-limitations@fNTb9y3zs1HPYclAmu_Wv.md +++ b/src/data/roadmaps/sql/content/rdbms-benefits-and-limitations@fNTb9y3zs1HPYclAmu_Wv.md @@ -1,31 +1,7 @@ # RDBMS Benefits and Limitations -Here are some of the benefits of using an RDBMS: +Relational Database Management Systems (RDBMS) organize data into tables with rows and columns, establishing relationships between these tables using keys. This structured approach offers benefits like data integrity through constraints and ACID properties (Atomicity, Consistency, Isolation, Durability), ensuring reliable transactions. However, RDBMS can face limitations regarding scalability, especially with massive datasets, and may not be the optimal choice for handling unstructured or semi-structured data due to their rigid schema. -- **Structured Data**: RDBMS allows data storage in a structured way, using rows and columns in tables. This makes it easy to manipulate the data using SQL (Structured Query Language), ensuring efficient and flexible usage. - -- **ACID Properties**: ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties ensure reliable and safe data manipulation in a RDBMS, making it suitable for mission-critical applications. - -- **Normalization**: RDBMS supports data normalization, a process that organizes data in a way that reduces data redundancy and improves data integrity. - -- **Scalability**: RDBMSs generally provide good scalability options, allowing for the addition of more storage or computational resources as the data and workload grow. - -- **Data Integrity**: RDBMS provides mechanisms like constraints, primary keys, and foreign keys to enforce data integrity and consistency, ensuring that the data is accurate and reliable. - -- **Security**: RDBMSs offer various security features such as user authentication, access control, and data encryption to protect sensitive data. - -Here are some of the limitations of using an RDBMS: - -- **Complexity**: Setting up and managing an RDBMS can be complex, especially for large applications. It requires technical knowledge and skills to manage, tune, and optimize the database. - -- **Cost**: RDBMSs can be expensive, both in terms of licensing fees and the computational and storage resources they require. - -- **Fixed Schema**: RDBMS follows a rigid schema for data organization, which means any changes to the schema can be time-consuming and complicated. - -- **Handling of Unstructured Data**: RDBMSs are not suitable for handling unstructured data like multimedia files, social media posts, and sensor data, as their relational structure is optimized for structured data. - -- **Horizontal Scalability**: RDBMSs are not as easily horizontally scalable as NoSQL databases. Scaling horizontally, which involves adding more machines to the system, can be challenging in terms of cost and complexity. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Advantages and Disadvantages of DBMS](https://cloud.google.com/learn/what-is-a-relational-database) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/recursive-queries@TjgwabhEtaSoYMLNr6q9l.md b/src/data/roadmaps/sql/content/recursive-queries@TjgwabhEtaSoYMLNr6q9l.md index db90aa366..db2c19ab3 100644 --- a/src/data/roadmaps/sql/content/recursive-queries@TjgwabhEtaSoYMLNr6q9l.md +++ b/src/data/roadmaps/sql/content/recursive-queries@TjgwabhEtaSoYMLNr6q9l.md @@ -1,8 +1,8 @@ # Recursive Queries -Recursive queries in SQL allow for the repeated execution of a query within itself, enabling the traversal of hierarchical or tree-like data structures. This powerful feature is particularly useful for handling nested relationships, such as organizational hierarchies, bill of materials, or network topologies. By using a combination of an anchor member (initial query) and a recursive member (the part that refers to itself), recursive queries can iterate through multiple levels of data, retrieving information that would be difficult or impossible to obtain with standard SQL constructs. This technique simplifies complex queries and improves performance when dealing with self-referential data. +Recursive queries are SQL queries that refer to themselves within their own definition. They're used to process hierarchical or tree-structured data, where relationships exist between rows in the same table, like organizational charts, bill of materials, or social networks. Using `WITH RECURSIVE` clause, these queries iterate through the data until a certain condition is met, allowing you to traverse the hierarchy and extract related information. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Recursive Queries in SQL](https://codedamn.com/news/sql/recursive-queries-in-sql) - [@article@Recursive SQL Expression Visually Explained](https://builtin.com/data-science/recursive-sql) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/replace@VNbb3YPc0FtrROylRns8h.md b/src/data/roadmaps/sql/content/replace@VNbb3YPc0FtrROylRns8h.md index 522fb8c05..807c96314 100644 --- a/src/data/roadmaps/sql/content/replace@VNbb3YPc0FtrROylRns8h.md +++ b/src/data/roadmaps/sql/content/replace@VNbb3YPc0FtrROylRns8h.md @@ -2,6 +2,6 @@ The `REPLACE` function in SQL is used to substitute all occurrences of a specified substring within a string with a new substring. It takes three arguments: the original string, the substring to be replaced, and the substring to replace it with. If the specified substring is found in the original string, `REPLACE` returns the modified string with all instances of the old substring replaced by the new one. If the substring is not found, the original string is returned unchanged. This function is particularly useful for data cleaning tasks, such as correcting typos, standardizing formats, or replacing obsolete data. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to use the SQL REPLACE Function](https://www.datacamp.com/tutorial/sql-replace) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/right-join@shpgZkh1CLqUwjOaRtAFy.md b/src/data/roadmaps/sql/content/right-join@shpgZkh1CLqUwjOaRtAFy.md index c5c1365a4..911a72c50 100644 --- a/src/data/roadmaps/sql/content/right-join@shpgZkh1CLqUwjOaRtAFy.md +++ b/src/data/roadmaps/sql/content/right-join@shpgZkh1CLqUwjOaRtAFy.md @@ -1,7 +1,7 @@ # RIGHT JOIN -A `RIGHT JOIN` in SQL is a type of outer join that returns all rows from the right (second) table and the matching rows from the left (first) table. If there's no match in the left table, `NULL` values are returned for the left table's columns. This join type is less commonly used than LEFT JOIN but is particularly useful when you want to ensure all records from the second table are included in the result set, regardless of whether they have corresponding matches in the first table. `RIGHT JOIN` is often used to identify missing relationships or to include all possible values from a lookup table. +A RIGHT JOIN combines rows from two tables based on a related column. It returns all rows from the right table (the table specified after the `RIGHT JOIN` keyword), and the matching rows from the left table. If there's no match in the left table for a row in the right table, `NULL` values are returned for the columns from the left table in the result set. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL RIGHT JOIN With Examples](https://www.programiz.com/sql/right-join) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/rollback@xbD67KVlt3UhHpKh8HLx8.md b/src/data/roadmaps/sql/content/rollback@xbD67KVlt3UhHpKh8HLx8.md index 57cae41bc..9d667e016 100644 --- a/src/data/roadmaps/sql/content/rollback@xbD67KVlt3UhHpKh8HLx8.md +++ b/src/data/roadmaps/sql/content/rollback@xbD67KVlt3UhHpKh8HLx8.md @@ -2,7 +2,7 @@ `ROLLBACK` is a SQL command used to undo transactions that have not yet been committed to the database. It reverses all changes made within the current transaction, restoring the database to its state before the transaction began. This command is crucial for maintaining data integrity, especially when errors occur during a transaction or when implementing conditional logic in database operations. `ROLLBACK` is an essential part of the ACID (Atomicity, Consistency, Isolation, Durability) properties of database transactions, ensuring that either all changes in a transaction are applied, or none are, thus preserving data consistency. -Learn more from the following resources: +Visit the following resources to learn more: -- [@video@How to undo a mistake a in SQL: Rollback and Commit](https://www.youtube.com/watch?v=jomsdMLiIZM) -- [@article@Difference between COMMIT and ROLLBACK in SQL](https://byjus.com/gate/difference-between-commit-and-rollback-in-sql/) \ No newline at end of file +- [@article@Difference between COMMIT and ROLLBACK in SQL](https://byjus.com/gate/difference-between-commit-and-rollback-in-sql/) +- [@video@How to undo a mistake a in SQL: Rollback and Commit](https://www.youtube.com/watch?v=jomsdMLiIZM) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/round@9DntFiZV1AyaRPhYP5q6u.md b/src/data/roadmaps/sql/content/round@9DntFiZV1AyaRPhYP5q6u.md index 5bc452d4b..c818184ff 100644 --- a/src/data/roadmaps/sql/content/round@9DntFiZV1AyaRPhYP5q6u.md +++ b/src/data/roadmaps/sql/content/round@9DntFiZV1AyaRPhYP5q6u.md @@ -2,6 +2,6 @@ The `ROUND` function in SQL is used to round a numeric value to a specified number of decimal places. It takes two arguments: the number to be rounded and the number of decimal places to round to. If the second argument is omitted, the function rounds the number to the nearest whole number. For positive values of the second argument, the number is rounded to the specified decimal places; for negative values, it rounds to the nearest ten, hundred, thousand, etc. The `ROUND` function is useful for formatting numerical data for reporting or ensuring consistent precision in calculations. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@What is the SQL ROUND Function and how does it work?](https://www.datacamp.com/tutorial/mastering-sql-round) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/row@aLDl75i8gtLRA2Ud-fMmQ.md b/src/data/roadmaps/sql/content/row@aLDl75i8gtLRA2Ud-fMmQ.md index 3dd9ab4e3..2d0e6e89f 100644 --- a/src/data/roadmaps/sql/content/row@aLDl75i8gtLRA2Ud-fMmQ.md +++ b/src/data/roadmaps/sql/content/row@aLDl75i8gtLRA2Ud-fMmQ.md @@ -2,7 +2,7 @@ In SQL, a row (also called a record or tuple) represents a single, implicitly structured data item in a table. Each row contains a set of related data elements corresponding to the table's columns. Rows are fundamental to the relational database model, allowing for the organized storage and retrieval of information. Operations like INSERT, UPDATE, and DELETE typically work at the row level. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Row - Database](https://en.wikipedia.org/wiki/Row_(database)) - [@article@Database Row: Definition, Examples](https://www.devx.com/terms/database-row/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/row_number@zW27ZHdLwQY-85iqbBKQZ.md b/src/data/roadmaps/sql/content/row_number@zW27ZHdLwQY-85iqbBKQZ.md index 6fd2646f9..24618befa 100644 --- a/src/data/roadmaps/sql/content/row_number@zW27ZHdLwQY-85iqbBKQZ.md +++ b/src/data/roadmaps/sql/content/row_number@zW27ZHdLwQY-85iqbBKQZ.md @@ -1,8 +1,8 @@ # Row_number -ROW_NUMBER() is a SQL window function that assigns a unique, sequential integer to each row within a partition of a result set. It's useful for creating row identifiers, implementing pagination, or finding the nth highest/lowest value in a group. The numbering starts at 1 for each partition and continues sequentially, allowing for versatile data analysis and manipulation tasks. +ROW\_NUMBER() is a SQL window function that assigns a unique, sequential integer to each row within a partition of a result set. It's useful for creating row identifiers, implementing pagination, or finding the nth highest/lowest value in a group. The numbering starts at 1 for each partition and continues sequentially, allowing for versatile data analysis and manipulation tasks. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL ROW_NUMBER](https://www.sqltutorial.org/sql-window-functions/sql-row_number/) - [@article@How to Use ROW_NUMBER OVER() in SQL to Rank Data](https://learnsql.com/blog/row-number-over-in-sql/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/savepoint@pJtYvXUo81aZfPuRjIbMq.md b/src/data/roadmaps/sql/content/savepoint@pJtYvXUo81aZfPuRjIbMq.md index e86a28a61..aca239d34 100644 --- a/src/data/roadmaps/sql/content/savepoint@pJtYvXUo81aZfPuRjIbMq.md +++ b/src/data/roadmaps/sql/content/savepoint@pJtYvXUo81aZfPuRjIbMq.md @@ -2,7 +2,7 @@ A `SAVEPOINT` in SQL is a point within a transaction that can be referenced later. It allows for more granular control over transactions by creating intermediate points to which you can roll back without affecting the entire transaction. This is particularly useful in complex transactions where you might want to undo part of the work without discarding all changes. `SAVEPOINT` enhances transaction management flexibility. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL SAVEPOINT](https://www.ibm.com/docs/pl/informix-servers/12.10?topic=statements-savepoint-statement) - [@video@DBMS - Save Point](https://www.youtube.com/watch?v=30ldSUkswGM) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/scalar@eXQ-TrTlqL5p2AdGnozkL.md b/src/data/roadmaps/sql/content/scalar@eXQ-TrTlqL5p2AdGnozkL.md index 363af17d5..5f33862f5 100644 --- a/src/data/roadmaps/sql/content/scalar@eXQ-TrTlqL5p2AdGnozkL.md +++ b/src/data/roadmaps/sql/content/scalar@eXQ-TrTlqL5p2AdGnozkL.md @@ -2,7 +2,7 @@ A scalar value is a single data item, as opposed to a set or array of values. Scalar subqueries are queries that return exactly one column and one row, often used in `SELECT` statements, `WHERE` clauses, or as part of expressions. Scalar functions in SQL return a single value based on input parameters. Understanding scalar concepts is crucial for writing efficient and precise SQL queries. -Learn more from the following resources: +Visit the following resources to learn more: -- [@video@Using Scalar SQL to boost performance](https://www.youtube.com/watch?v=v8X5FGzzc9A) -- [@article@Creating SQL Scalar Functions](https://www.ibm.com/docs/en/db2/11.5?topic=functions-creating-sql-scalar) \ No newline at end of file +- [@article@Creating SQL Scalar Functions](https://www.ibm.com/docs/en/db2/11.5?topic=functions-creating-sql-scalar) +- [@video@Using Scalar SQL to boost performance](https://www.youtube.com/watch?v=v8X5FGzzc9A) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/select@i8u8E_sne6XiKJo2FXDog.md b/src/data/roadmaps/sql/content/select@i8u8E_sne6XiKJo2FXDog.md index 7d21dffb6..40dc8bce0 100644 --- a/src/data/roadmaps/sql/content/select@i8u8E_sne6XiKJo2FXDog.md +++ b/src/data/roadmaps/sql/content/select@i8u8E_sne6XiKJo2FXDog.md @@ -1,7 +1,3 @@ -# SELECT - -SELECT is one of the most fundamental SQL commands, used to retrieve data from one or more tables in a database. It allows you to specify which columns to fetch, apply filtering conditions, sort results, and perform various operations on the data. The SELECT statement is versatile, supporting joins, subqueries, aggregations, and more, making it essential for data querying and analysis in relational databases. - -Learn more from the following resources: - +# Select Statement +The `SELECT` statement in SQL is used to retrieve data from one or more tables. It allows you to specify which columns you want to see and apply conditions to filter the rows returned. Think of it as a powerful tool to query a database and extract specific information based on your needs. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/select@rmqXH29n1oXtZ8tvmcRFn.md b/src/data/roadmaps/sql/content/select@rmqXH29n1oXtZ8tvmcRFn.md index 012b12e33..57081506e 100644 --- a/src/data/roadmaps/sql/content/select@rmqXH29n1oXtZ8tvmcRFn.md +++ b/src/data/roadmaps/sql/content/select@rmqXH29n1oXtZ8tvmcRFn.md @@ -1,6 +1,3 @@ -# SELECT statement - -SELECT is one of the most fundamental SQL commands, used to retrieve data from one or more tables in a database. It allows you to specify which columns to fetch, apply filtering conditions, sort results, and perform various operations on the data. The SELECT statement is versatile, supporting joins, subqueries, aggregations, and more, making it essential for data querying and analysis in relational databases. - -Learn more from the following resources: - +# SELECT statement + +SELECT is one of the most fundamental SQL commands, used to retrieve data from one or more tables in a database. It allows you to specify which columns to fetch, apply filtering conditions, sort results, and perform various operations on the data. The SELECT statement is versatile, supporting joins, subqueries, aggregations, and more, making it essential for data querying and analysis in relational databases. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/selective-projection@w53CSY53nAAN0ux-XeJ4c.md b/src/data/roadmaps/sql/content/selective-projection@w53CSY53nAAN0ux-XeJ4c.md index b635d07dc..35940d413 100644 --- a/src/data/roadmaps/sql/content/selective-projection@w53CSY53nAAN0ux-XeJ4c.md +++ b/src/data/roadmaps/sql/content/selective-projection@w53CSY53nAAN0ux-XeJ4c.md @@ -1,3 +1,3 @@ # Selective Projection -Selective projection in SQL refers to the practice of choosing only specific columns (attributes) from a table or query result, rather than selecting all available columns. This technique is crucial for optimizing query performance and reducing unnecessary data transfer. By using SELECT with explicitly named columns instead of `SELECT *`, developers can improve query efficiency and clarity, especially when dealing with large tables or complex joins. +Selective projection in SQL refers to the practice of choosing only specific columns (attributes) from a table or query result, rather than selecting all available columns. This technique is crucial for optimizing query performance and reducing unnecessary data transfer. By using SELECT with explicitly named columns instead of `SELECT *`, developers can improve query efficiency and clarity, especially when dealing with large tables or complex joins. \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/self-join@6qG0AVYd6Y1B8LOSDoMX9.md b/src/data/roadmaps/sql/content/self-join@6qG0AVYd6Y1B8LOSDoMX9.md index 0c34628ee..a6d0c8837 100644 --- a/src/data/roadmaps/sql/content/self-join@6qG0AVYd6Y1B8LOSDoMX9.md +++ b/src/data/roadmaps/sql/content/self-join@6qG0AVYd6Y1B8LOSDoMX9.md @@ -1,10 +1,8 @@ # Self Join -A `SELF JOIN` is a standard SQL operation where a table is joined to itself. This might sound counter-intuitive, but it's actually quite useful in scenarios where comparison operations need to be made within a table. Essentially, it is used to combine rows with other rows in the same table when there's a match based on the condition provided. +A self join is a query in SQL that joins a table to itself. This is useful when you want to compare rows within the same table, often based on a hierarchical relationship or other connection between the data points within that table. Think of it as creating two copies of the same table and then joining them based on a shared column, allowing you to relate data from the same source in a new way. -It's important to note that, since it's a join operation on the same table, alias(es) for table(s) must be used to avoid confusion during the join operation. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Understanding the Self Joins in SQL](https://www.dbvis.com/thetable/understanding-self-joins-in-sql/) - [@article@SQL self joins](https://www.w3schools.com/sql/sql_join_self.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/sql-keywords@6yoo7qC6X2jYDIjd3HIm7.md b/src/data/roadmaps/sql/content/sql-keywords@6yoo7qC6X2jYDIjd3HIm7.md index 28a7a0f28..a003a3e73 100644 --- a/src/data/roadmaps/sql/content/sql-keywords@6yoo7qC6X2jYDIjd3HIm7.md +++ b/src/data/roadmaps/sql/content/sql-keywords@6yoo7qC6X2jYDIjd3HIm7.md @@ -2,6 +2,6 @@ SQL keywords are reserved words that have special meanings within SQL statements. These include commands (like `SELECT`, `INSERT`, `UPDATE`), clauses (such as `WHERE`, `GROUP BY`, `HAVING`), and other syntax elements that form the structure of SQL queries. Understanding SQL keywords is fundamental to writing correct and effective database queries. Keywords are typically case-insensitive but are often written in uppercase by convention for better readability. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Keywords, Operators and Statements](https://blog.hubspot.com/website/sql-keywords-operators-statements) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/sql-vs-nosql-databases@gx4KaFqKgJX9n9_ZGMqlZ.md b/src/data/roadmaps/sql/content/sql-vs-nosql-databases@gx4KaFqKgJX9n9_ZGMqlZ.md index c669d54eb..115ae68c7 100644 --- a/src/data/roadmaps/sql/content/sql-vs-nosql-databases@gx4KaFqKgJX9n9_ZGMqlZ.md +++ b/src/data/roadmaps/sql/content/sql-vs-nosql-databases@gx4KaFqKgJX9n9_ZGMqlZ.md @@ -2,7 +2,7 @@ SQL (relational) and NoSQL (non-relational) databases represent two different approaches to data storage and retrieval. SQL databases use structured schemas and tables, emphasizing data integrity and complex queries through joins. NoSQL databases offer more flexibility in data structures, often sacrificing some consistency for scalability and performance. The choice between SQL and NoSQL depends on factors like data structure, scalability needs, consistency requirements, and the nature of the application. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Understanding SQL vs NoSQL Databases](https://www.mongodb.com/resources/basics/databases/nosql-explained/nosql-vs-sql) - [@video@SQL vs NoSQL Databases in 4 mins](https://www.youtube.com/watch?v=_Ss42Vb1SU4) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/stored-procedures--functions@w7FNjdwqjY7X69aJqqBy4.md b/src/data/roadmaps/sql/content/stored-procedures--functions@w7FNjdwqjY7X69aJqqBy4.md index 7550ee49e..fdd7653c8 100644 --- a/src/data/roadmaps/sql/content/stored-procedures--functions@w7FNjdwqjY7X69aJqqBy4.md +++ b/src/data/roadmaps/sql/content/stored-procedures--functions@w7FNjdwqjY7X69aJqqBy4.md @@ -2,6 +2,6 @@ Stored procedures and functions are precompiled database objects that encapsulate a set of SQL statements and logic. Stored procedures can perform complex operations and are typically used for data manipulation, while functions are designed to compute and return values. Both improve performance by reducing network traffic and allowing code reuse. They also enhance security by providing a layer of abstraction between the application and the database. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Stored Procedure vs Functions](https://www.shiksha.com/online-courses/articles/stored-procedure-vs-function-what-are-the-differences/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/subqueries@86iZ8s8EdhSuYwgwAM_EO.md b/src/data/roadmaps/sql/content/subqueries@86iZ8s8EdhSuYwgwAM_EO.md index 69b8c5293..5d0ed50e2 100644 --- a/src/data/roadmaps/sql/content/subqueries@86iZ8s8EdhSuYwgwAM_EO.md +++ b/src/data/roadmaps/sql/content/subqueries@86iZ8s8EdhSuYwgwAM_EO.md @@ -2,7 +2,7 @@ Subqueries, also known as nested queries or inner queries, are SQL queries embedded within another query. They can be used in various parts of SQL statements, such as SELECT, FROM, WHERE, and HAVING clauses. Subqueries allow for complex data retrieval and manipulation by breaking down complex queries into more manageable parts. They're particularly useful for creating dynamic criteria, performing calculations, or comparing sets of results. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Sub Queries](https://www.tutorialspoint.com/sql/sql-sub-queries.htm) - [@video@Advanced SQL Tutorial | Subqueries](https://www.youtube.com/watch?v=m1KcNV-Zhmc) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/substring@PnG_5D6q66NAKxXVOwA6N.md b/src/data/roadmaps/sql/content/substring@PnG_5D6q66NAKxXVOwA6N.md index fd1608dcd..fab351a4b 100644 --- a/src/data/roadmaps/sql/content/substring@PnG_5D6q66NAKxXVOwA6N.md +++ b/src/data/roadmaps/sql/content/substring@PnG_5D6q66NAKxXVOwA6N.md @@ -2,7 +2,7 @@ SUBSTRING is a SQL function used to extract a portion of a string. It allows you to specify the starting position and length of the substring you want to extract. This function is valuable for data manipulation, parsing, and formatting tasks. The exact syntax may vary slightly between database systems, but the core functionality remains consistent, making it a versatile tool for working with string data in databases. -Learn more from the following resources: +Visit the following resources to learn more: -- [@video@Advanced SQL Tutorial | String Functions + Use Cases](https://www.youtube.com/watch?v=GQj6_6V_jVA) -- [@article@SQL SUBSTRING](https://www.w3schools.com/sql/func_sqlserver_substring.asp) \ No newline at end of file +- [@article@SQL SUBSTRING](https://www.w3schools.com/sql/func_sqlserver_substring.asp) +- [@video@Advanced SQL Tutorial | String Functions + Use Cases](https://www.youtube.com/watch?v=GQj6_6V_jVA) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/sum@w4T3jFb0ilf1KNw-AvRXG.md b/src/data/roadmaps/sql/content/sum@w4T3jFb0ilf1KNw-AvRXG.md index da7e813b2..f66b2c09e 100644 --- a/src/data/roadmaps/sql/content/sum@w4T3jFb0ilf1KNw-AvRXG.md +++ b/src/data/roadmaps/sql/content/sum@w4T3jFb0ilf1KNw-AvRXG.md @@ -2,6 +2,6 @@ SUM is an aggregate function in SQL used to calculate the total of a set of values. It's commonly used with numeric columns in combination with GROUP BY clauses to compute totals for different categories or groups within the data. SUM is essential for financial calculations, statistical analysis, and generating summary reports from database tables. It ignores NULL values and can be used in conjunction with other aggregate functions for complex data analysis. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL SUM](https://www.studysmarter.co.uk/explanations/computer-science/databases/sql-sum/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/table@R9WDMRd-3wxsKH97-sT3n.md b/src/data/roadmaps/sql/content/table@R9WDMRd-3wxsKH97-sT3n.md index eadcb85da..e37aa16c6 100644 --- a/src/data/roadmaps/sql/content/table@R9WDMRd-3wxsKH97-sT3n.md +++ b/src/data/roadmaps/sql/content/table@R9WDMRd-3wxsKH97-sT3n.md @@ -2,7 +2,7 @@ A table is a fundamental structure for organizing data in a relational database. It consists of rows (records) and columns (fields), representing a collection of related data entries. Tables define the schema of the data, including data types and constraints. They are the primary objects for storing and retrieving data in SQL databases, and understanding table structure is crucial for effective database design and querying. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Table (Database)](https://en.wikipedia.org/wiki/Table_(database)) - [@article@Introduction to Tables](https://support.microsoft.com/en-gb/office/introduction-to-tables-78ff21ea-2f76-4fb0-8af6-c318d1ee0ea7) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/time@88KlrMqSza9_YaD7Dv61p.md b/src/data/roadmaps/sql/content/time@88KlrMqSza9_YaD7Dv61p.md index 77482f358..c9ef92356 100644 --- a/src/data/roadmaps/sql/content/time@88KlrMqSza9_YaD7Dv61p.md +++ b/src/data/roadmaps/sql/content/time@88KlrMqSza9_YaD7Dv61p.md @@ -2,5 +2,4 @@ The TIME data type in SQL is used to store time values, typically in the format of hours, minutes, and seconds. It's useful for recording specific times of day without date information. SQL provides various functions for manipulating and comparing TIME values, allowing for time-based calculations and queries. The exact range and precision of TIME can vary between different database management systems. -Learn more from the following resources: - +Learn more from the following resources: \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/timestamp@7hEqkoxkdAWmakGZsMJx-.md b/src/data/roadmaps/sql/content/timestamp@7hEqkoxkdAWmakGZsMJx-.md index 2f8fcf7d4..6d714777e 100644 --- a/src/data/roadmaps/sql/content/timestamp@7hEqkoxkdAWmakGZsMJx-.md +++ b/src/data/roadmaps/sql/content/timestamp@7hEqkoxkdAWmakGZsMJx-.md @@ -1,9 +1,7 @@ # TIMESTAMP -SQL `TIMESTAMP` is a data type that allows you to store both date and time. It is typically used to track updates and changes made to a record, providing a chronological time of happenings. +A TIMESTAMP is a data type used to store a specific point in time, typically including both date and time components. It often includes fractions of a second (milliseconds or microseconds) for greater precision. It is very common for databases to have a timestamp that automatically updates when a row is updated. -Depending on the SQL platform, the format and storage size can slightly vary. For instance, MySQL uses the 'YYYY-MM-DD HH:MI:SS' format and in PostgreSQL, it's stored as a 'YYYY-MM-DD HH:MI:SS' format but it additionally can store microseconds. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Different SQL TimeStamp functions in SQL Server](https://www.sqlshack.com/different-sql-timestamp-functions-in-sql-server/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/transaction-isolation-levels@ujeq8EIFcrqkBjoFizsJM.md b/src/data/roadmaps/sql/content/transaction-isolation-levels@ujeq8EIFcrqkBjoFizsJM.md index 19c89328e..3221c076c 100644 --- a/src/data/roadmaps/sql/content/transaction-isolation-levels@ujeq8EIFcrqkBjoFizsJM.md +++ b/src/data/roadmaps/sql/content/transaction-isolation-levels@ujeq8EIFcrqkBjoFizsJM.md @@ -2,7 +2,7 @@ Transaction isolation levels in SQL define the degree to which the operations in one transaction are visible to other concurrent transactions. There are typically four standard levels: Read Uncommitted, Read Committed, Repeatable Read, and Serializable. Each level provides different trade-offs between data consistency and concurrency. Understanding and correctly setting isolation levels is crucial for maintaining data integrity and optimizing performance in multi-user database environments. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Everything you always wanted to know about SQL isolation levels](https://www.cockroachlabs.com/blog/sql-isolation-levels-explained/) - [@article@Isolation Levels in SQL Server](https://www.sqlservercentral.com/articles/isolation-levels-in-sql-server) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/transactions@OdaBXz2XBAVLsQ-m7xtAM.md b/src/data/roadmaps/sql/content/transactions@OdaBXz2XBAVLsQ-m7xtAM.md index bcd13f237..c48d425a9 100644 --- a/src/data/roadmaps/sql/content/transactions@OdaBXz2XBAVLsQ-m7xtAM.md +++ b/src/data/roadmaps/sql/content/transactions@OdaBXz2XBAVLsQ-m7xtAM.md @@ -2,7 +2,7 @@ Transactions in SQL are units of work that group one or more database operations into a single, atomic unit. They ensure data integrity by following the ACID properties: Atomicity (all or nothing), Consistency (database remains in a valid state), Isolation (transactions don't interfere with each other), and Durability (committed changes are permanent). Transactions are essential for maintaining data consistency in complex operations and handling concurrent access to the database. -Learn more from the following resources: +Visit the following resources to learn more: -- [@articles@Transactions](https://www.tutorialspoint.com/sql/sql-transactions.htm) +- [@article@Transactions](https://www.tutorialspoint.com/sql/sql-transactions.htm) - [@article@A Guide to ACID Properties in Database Management Systems](https://www.mongodb.com/resources/basics/databases/acid-transactions) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/truncate-table@K5vhqTJrdPK08Txv8zaEj.md b/src/data/roadmaps/sql/content/truncate-table@K5vhqTJrdPK08Txv8zaEj.md index a2cf5b66e..8467fd0be 100644 --- a/src/data/roadmaps/sql/content/truncate-table@K5vhqTJrdPK08Txv8zaEj.md +++ b/src/data/roadmaps/sql/content/truncate-table@K5vhqTJrdPK08Txv8zaEj.md @@ -1,10 +1,8 @@ # Truncate Table -The `TRUNCATE TABLE` statement is a Data Definition Language (DDL) operation that is used to mark the extents of a table for deallocation (empty for reuse). The result of this operation quickly removes all data from a table, typically bypassing a number of integrity enforcing mechanisms intended to protect data (like triggers). +Truncate Table is a command in SQL used to remove all rows from a table. It's like resetting the table to its initial, empty state. The table structure itself (columns, data types, constraints) remains intact. `TRUNCATE TABLE` is generally faster than `DELETE` because it deallocates the data pages used by the table, rather than individually logging each row deletion. -It effectively eliminates all records in a table, but not the table itself. Unlike the `DELETE` statement, `TRUNCATE TABLE` does not generate individual row delete statements, so the usual overhead for logging or locking does not apply. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@TRUNCATE TABLE](https://www.tutorialspoint.com/sql/sql-truncate-table.htm) - [@video@SQL Tutorial - TRUNCATE TABLE](https://www.youtube.com/watch?v=zJidbjOQlJM) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/unique@5yGo8i7eplxtXOD_qfzOs.md b/src/data/roadmaps/sql/content/unique@5yGo8i7eplxtXOD_qfzOs.md index 1d8a9428f..df00d831a 100644 --- a/src/data/roadmaps/sql/content/unique@5yGo8i7eplxtXOD_qfzOs.md +++ b/src/data/roadmaps/sql/content/unique@5yGo8i7eplxtXOD_qfzOs.md @@ -1,7 +1,7 @@ -# Unique +# Unique Constraint -`UNIQUE` is a constraint in SQL used to ensure that all values in a column or a set of columns are distinct. When applied to a column or a combination of columns, it prevents duplicate values from being inserted into the table. This constraint is crucial for maintaining data integrity, especially for fields like email addresses, usernames, or product codes where uniqueness is required. `UNIQUE` constraints can be applied during table creation or added later, and they automatically create an index on the specified column(s) for improved query performance. Unlike `PRIMARY KEY` constraints, `UNIQUE` columns can contain `NULL` values (unless explicitly disallowed), and a table can have multiple `UNIQUE` constraints. +A unique constraint ensures that all values in a column (or a group of columns) are different. It prevents duplicate entries, maintaining data integrity by enforcing uniqueness for the specified field(s). This is useful for fields like email addresses or usernames, where each record should have a distinct value. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL UNIQUE Constraint](https://www.w3schools.com/sql/sql_unique.asp) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/update@KJJ6PYjTnr_3yU2mNPL9v.md b/src/data/roadmaps/sql/content/update@KJJ6PYjTnr_3yU2mNPL9v.md index 4ba1c196c..ddd636264 100644 --- a/src/data/roadmaps/sql/content/update@KJJ6PYjTnr_3yU2mNPL9v.md +++ b/src/data/roadmaps/sql/content/update@KJJ6PYjTnr_3yU2mNPL9v.md @@ -1,7 +1,7 @@ -# UPDATE +# UPDATE Statement -The UPDATE statement in SQL is used to modify existing records in a table. It allows you to change the values of one or more columns based on specified conditions. The basic syntax includes specifying the table name, the columns to be updated with their new values, and optionally, a WHERE clause to filter which rows should be affected. UPDATE can be used in conjunction with subqueries, joins, and CTEs (Common Table Expressions) for more complex data modifications. It's important to use UPDATE carefully, especially with the WHERE clause, to avoid unintended changes to data. In transactional databases, UPDATE operations can be rolled back if they're part of a transaction that hasn't been committed. +The UPDATE statement modifies existing data within a table. It allows you to change the values of one or more columns in a table, based on specified conditions. You can update a single row or multiple rows, and it's essential for keeping your database information accurate and current. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Efficient column updates in SQL](https://www.atlassian.com/data/sql/how-to-update-a-column-based-on-a-filter-of-another-column) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/update@eu9dJFi6gBPMBdy08Y5Bb.md b/src/data/roadmaps/sql/content/update@eu9dJFi6gBPMBdy08Y5Bb.md index 4ba1c196c..ee83fc423 100644 --- a/src/data/roadmaps/sql/content/update@eu9dJFi6gBPMBdy08Y5Bb.md +++ b/src/data/roadmaps/sql/content/update@eu9dJFi6gBPMBdy08Y5Bb.md @@ -1,7 +1,7 @@ -# UPDATE +# UPDATE Statement -The UPDATE statement in SQL is used to modify existing records in a table. It allows you to change the values of one or more columns based on specified conditions. The basic syntax includes specifying the table name, the columns to be updated with their new values, and optionally, a WHERE clause to filter which rows should be affected. UPDATE can be used in conjunction with subqueries, joins, and CTEs (Common Table Expressions) for more complex data modifications. It's important to use UPDATE carefully, especially with the WHERE clause, to avoid unintended changes to data. In transactional databases, UPDATE operations can be rolled back if they're part of a transaction that hasn't been committed. +The UPDATE statement modifies existing data within a table. It allows you to change the values of one or more columns for specific rows based on a specified condition. You use the `UPDATE` statement to correct errors, reflect changes in data, or apply new information to your database. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@Efficient column updates in SQL](https://www.atlassian.com/data/sql/how-to-update-a-column-based-on-a-filter-of-another-column) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/upper@Othfo7NvTVzfyL906PLM1.md b/src/data/roadmaps/sql/content/upper@Othfo7NvTVzfyL906PLM1.md index eb43a3e1b..3df6a52ef 100644 --- a/src/data/roadmaps/sql/content/upper@Othfo7NvTVzfyL906PLM1.md +++ b/src/data/roadmaps/sql/content/upper@Othfo7NvTVzfyL906PLM1.md @@ -1,7 +1,7 @@ # UPPER -UPPER() is a string function in SQL used to convert all characters in a specified string to uppercase. This function is particularly useful for data normalization, case-insensitive comparisons, or formatting output. UPPER() typically works on alphabetic characters and leaves non-alphabetic characters unchanged. It's often used in SELECT statements to display data, in WHERE clauses for case-insensitive searches, or in data manipulation operations. Most SQL databases also provide a complementary LOWER() function for converting to lowercase. When working with international character sets, it's important to be aware of potential locale-specific behavior of UPPER(). +UPPER is a string function that transforms all characters in a given string to uppercase. It accepts a single string or character-based column as an argument and returns a new string where every letter has been converted to its uppercase equivalent. Non-alphabetic characters and already uppercase characters remain unchanged. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@How to Convert a String to Uppercase in SQL](https://learnsql.com/cookbook/how-to-convert-a-string-to-uppercase-in-sql/) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/using-indexes@9wOgP0i9G4HSeZGn2Gm7r.md b/src/data/roadmaps/sql/content/using-indexes@9wOgP0i9G4HSeZGn2Gm7r.md index b4fad48a9..3b8750f05 100644 --- a/src/data/roadmaps/sql/content/using-indexes@9wOgP0i9G4HSeZGn2Gm7r.md +++ b/src/data/roadmaps/sql/content/using-indexes@9wOgP0i9G4HSeZGn2Gm7r.md @@ -2,7 +2,7 @@ Indexes in SQL are database objects that improve the speed of data retrieval operations on database tables. They work similarly to an index in a book, allowing the database engine to quickly locate data without scanning the entire table. Proper use of indexes can significantly enhance query performance, especially for large tables. However, they come with trade-offs: while they speed up reads, they can slow down write operations (INSERT, UPDATE, DELETE) as the index also needs to be updated. Common types include B-tree indexes (default in most systems), bitmap indexes, and full-text indexes. Understanding when and how to create indexes is crucial for database optimization. This involves analyzing query patterns, understanding the data distribution, and balancing the needs of different types of operations on the database. -Learn more from the following resources: +Visit the following resources to learn more: - [@article@What is an index in SQL?](https://stackoverflow.com/questions/2955459/what-is-an-index-in-sql) - [@video@SQL Indexes - Definition, Examples, and Tips](https://www.youtube.com/watch?v=NZgfYbAmge8) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/views@2tyezwOIxV6O84N-Q3Awh.md b/src/data/roadmaps/sql/content/views@2tyezwOIxV6O84N-Q3Awh.md index 7c7807d46..441a7d832 100644 --- a/src/data/roadmaps/sql/content/views@2tyezwOIxV6O84N-Q3Awh.md +++ b/src/data/roadmaps/sql/content/views@2tyezwOIxV6O84N-Q3Awh.md @@ -1,14 +1,8 @@ # Views -Views in SQL are virtual tables based on the result set of an SQL statement. They act as a saved query that can be treated like a table, offering several benefits: +Views are like virtual tables. Instead of physically storing data, a view's definition is based on a query against one or more tables. When you query a view, the database executes the underlying query defined in the view, and the results are presented as if they were from an actual table. This simplifies complex queries and provides a level of data abstraction and security. -- Simplifying complex queries by encapsulating joins and subqueries -- Providing an additional security layer by restricting access to underlying tables -- Presenting data in a more relevant format for specific users or applications +Visit the following resources to learn more: -Views can be simple (based on a single table) or complex (involving multiple tables, subqueries, or functions). Some databases support updatable views, allowing modifications to the underlying data through the view. Materialized views, available in some systems, store the query results, improving performance for frequently accessed data at the cost of additional storage and maintenance overhead. - -Learn more from the following resources: - -- [@video@SQL Views Tutorial](https://www.youtube.com/watch?v=cLSxasHg9WY) -- [@article@Views in SQL](https://www.datacamp.com/tutorial/views-in-sql) \ No newline at end of file +- [@article@Views in SQL](https://www.datacamp.com/tutorial/views-in-sql) +- [@video@SQL Views Tutorial](https://www.youtube.com/watch?v=cLSxasHg9WY) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/what-are-relational-databases@R9DQNc0AyAQ2HLpP4HOk6.md b/src/data/roadmaps/sql/content/what-are-relational-databases@R9DQNc0AyAQ2HLpP4HOk6.md index 181a3fcf1..eb7c0c581 100644 --- a/src/data/roadmaps/sql/content/what-are-relational-databases@R9DQNc0AyAQ2HLpP4HOk6.md +++ b/src/data/roadmaps/sql/content/what-are-relational-databases@R9DQNc0AyAQ2HLpP4HOk6.md @@ -1,16 +1,8 @@ -# What Are Relational Databases? +# Relational Databases -Relational databases are a type of database management system (DBMS) that stores and provides access to data points that are related to one another. Based on the relational model introduced by E.F. Codd in 1970, they use a structure that allows data to be organized into tables with rows and columns. Key features include: +Relational databases organize data into tables, where each table represents a specific type of entity (like customers or products). These tables are linked together based on relationships between the data, often using shared columns called keys. This structure allows for efficient storage, retrieval, and management of large datasets while ensuring data integrity and consistency. -- Use of SQL (Structured Query Language) for querying and managing data -- Support for ACID transactions (Atomicity, Consistency, Isolation, Durability) -- Enforcement of data integrity through constraints (e.g., primary keys, foreign keys) -- Ability to establish relationships between tables, enabling complex queries and data retrieval -- Scalability and support for multi-user environments +Visit the following resources to learn more: -Examples of popular relational database systems include MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. They are widely used in various applications, from small-scale projects to large enterprise systems, due to their reliability, consistency, and powerful querying capabilities. - -Learn more from the following resources: - -- [@video@What is a relational database?](https://www.youtube.com/watch?v=OqjJjpjDRLc) - [@article@What is a relational database - AWS](https://aws.amazon.com/relational-database/) +- [@video@What is a relational database?](https://www.youtube.com/watch?v=OqjJjpjDRLc) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/where@WhYAy6f7Euk3E49-ot644.md b/src/data/roadmaps/sql/content/where@WhYAy6f7Euk3E49-ot644.md index acdc65c80..dc4c29b81 100644 --- a/src/data/roadmaps/sql/content/where@WhYAy6f7Euk3E49-ot644.md +++ b/src/data/roadmaps/sql/content/where@WhYAy6f7Euk3E49-ot644.md @@ -1,10 +1,8 @@ -# WHERE +# WHERE Clause in SELECT Statements -SQL provides a WHERE clause that is basically used to filter the records. If the condition specified in the WHERE clause satisfies, then only it returns the specific value from the table. You should use the WHERE clause to filter the records and fetching only the necessary records. +The WHERE clause is a fundamental part of the SELECT statement in SQL. It filters the rows returned by a query based on a specified condition. Essentially, it allows you to retrieve only the data that meets certain criteria, enabling you to focus on specific subsets of information within your database tables. -The WHERE clause is not only used in SELECT statement, but it is also used in UPDATE, DELETE statement, etc., which we will learn in subsequent chapters. +Visit the following resources to learn more: -Learn more from the following resources: - -- [@video@How to filter with the WHERE clause in SQL](https://www.youtube.com/watch?v=4Uv0o8IBqw0) -- [@article@WHERE Clause](https://www.w3schools.com/sql/sql_where.asp) \ No newline at end of file +- [@article@WHERE Clause](https://www.w3schools.com/sql/sql_where.asp) +- [@video@How to filter with the WHERE clause in SQL](https://www.youtube.com/watch?v=4Uv0o8IBqw0) \ No newline at end of file diff --git a/src/data/roadmaps/sql/content/window-functions@tBvXLLp5FKeSSN35Kj1X4.md b/src/data/roadmaps/sql/content/window-functions@tBvXLLp5FKeSSN35Kj1X4.md index 227143868..2d3474dcb 100644 --- a/src/data/roadmaps/sql/content/window-functions@tBvXLLp5FKeSSN35Kj1X4.md +++ b/src/data/roadmaps/sql/content/window-functions@tBvXLLp5FKeSSN35Kj1X4.md @@ -1,10 +1,8 @@ # Window Functions -SQL Window functions enable you perform calculations on a set of rows related to the current row. This set of rows is known as a 'window', hence 'Window Functions'. +Window functions perform calculations across a set of rows that are related to the current row. Unlike standard aggregate functions that group rows into a single result row, window functions retain the individual rows and add a calculated value for each row based on the window frame. This allows you to perform analyses like calculating running totals, moving averages, or ranking within partitions of data without collapsing the rows. -These are termed so because they perform a calculation across a set of rows which are related to the current row - somewhat like a sliding window. - -Learn more from the following resources: +Visit the following resources to learn more: - [@article@SQL Window Functions](https://mode.com/sql-tutorial/sql-window-functions) - [@video@SQL Window Functions in 10 Minutes](https://www.youtube.com/watch?v=y1KCM8vbYe4) \ No newline at end of file