{"id":24753802,"url":"https://github.com/chaseofthejungle/intro-to-sql","last_synced_at":"2025-06-10T11:09:24.926Z","repository":{"id":273791071,"uuid":"919656964","full_name":"chaseofthejungle/intro-to-sql","owner":"chaseofthejungle","description":"An overview guide of essential SQL databasing and querying concepts.","archived":false,"fork":false,"pushed_at":"2025-03-19T20:52:51.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T21:40:22.393Z","etag":null,"topics":["databases","rdbms","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaseofthejungle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-20T19:06:59.000Z","updated_at":"2025-03-19T20:52:55.000Z","dependencies_parsed_at":"2025-01-23T01:25:24.446Z","dependency_job_id":"39471529-7d30-4c86-9fc2-2295455feb42","html_url":"https://github.com/chaseofthejungle/intro-to-sql","commit_stats":null,"previous_names":["chaseofthejungle/intro-to-sql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseofthejungle%2Fintro-to-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseofthejungle%2Fintro-to-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseofthejungle%2Fintro-to-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseofthejungle%2Fintro-to-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaseofthejungle","download_url":"https://codeload.github.com/chaseofthejungle/intro-to-sql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056910,"owners_count":20553856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["databases","rdbms","sql"],"created_at":"2025-01-28T11:35:53.040Z","updated_at":"2025-06-10T11:09:24.897Z","avatar_url":"https://github.com/chaseofthejungle.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro to Structured Query Language (SQL)\n  \n**Overview:** A *database* is an organized data source/structure that should be easily accessible (by appropriately authenticated and authorized users, when relevant) for data management, retrieval, and long-term storage. *Relational Database Management Systems (RDBMSes)* are specialized databases that store data in tables (and sometimes other structures, such as forms and queries in Microsoft Access software) and share data between tables using common columns. *Structured Query Language (SQL)* is a standardized language that performs RDBMS tasks such as creating, reading, updating, and deleting data (also known as 'CRUD' operations).\n  \n#### Table of Contents\n  \n1. [NoSQL vs. SQL](#no-sql)\n2. [CRUD Operations](#crud)\n3. [Database Terms](#key-terms)\n4. [SQL Clauses](#sql-clauses)\n5. [SQL Constraints](#sql-constraints)\n6. [SQL Filtering and Sorting](#sql-filtering-sorting)\n7. [SQL Joins](#sql-joins)\n8. [Supplemental Resources](#supplemental)\n  \n\u003chr /\u003e\n    \n## 1. \u003ca name=\"no-sql\"\u003eNoSQL vs. SQL\u003c/a\u003e\n  \nSeveral key differences between SQL and Not Only SQL (NoSQL) databases include:\n\n| Feature | SQL | NoSQL |\n| :---: | :---: | :---: |\n| Direction of Scalability | Vertical | Horizontal |\n| Popular Objects | Tables | Column Stores, Documents, Graphs, Key-Value Pairs |\n| Schemas | Predefined | Dynamic |\n| Transaction Handling | Rows (Single or Multiple) | Unstructured Data (e.g., JSON) |\n  \nSome common reasons for choosing a NoSQL database include: quick response times/low latency, instant/real-time analytics, constantly-evolving data, and server scalability needs.\n  \n* **Examples of NoSQL Databases include:**\n    - [Actian NoSQL Object Database](https://www.actian.com/databases/nosql/): Supports transactional storage of data using object-oriented programming (OOP) languages.\n    - [Apache Cassandra](https://cassandra.apache.org/_/index.html): Optimizes parallel/commodity computing to handle and serve massive data volumes.\n    - [Apache HBase](https://hbase.apache.org/): Enables fault-tolerant storage of sparse data.\n    - [Couchbase](https://www.couchbase.com/): Promotes linear scalability and memcached key/value data storage.\n    - [MongoDB](https://www.mongodb.com/): Utilizes JSON-like documents and handles large volume, diverse data storage (e.g., e-mails, scanned documents).\n    - [Redis](https://redis.io/): Popular as a message broker and distributed cache, supporting low-latency reading and writing.\n  \n\u003chr /\u003e\n  \n## 2. \u003ca name=\"crud\"\u003eCRUD Operations\u003c/a\u003e\n\nPersistent storage databases have four types of operations that are performed open them, which are commonly abbreviated as *CRUD*:\n\n| CRUD Principle | Popular SQL Statement Keywords |\n| :---: | :---: |\n| **C**reate | INSERT INTO/VALUES, CREATE TABLE |\n| **R**ead | SELECT |\n| **U**pdate | UPDATE, ALTER TABLE/ADD |\n| **D**elete | DELETE, DROP TABLE |\n  \n\u003chr /\u003e\n  \n## 3. \u003ca name=\"key-terms\"\u003eDatabase Terms\u003c/a\u003e\n  \n**Table:** A database object/structure containing related fields (columns) and their associated records (rows).  \n**Field:** A column from a database table. This is a vertical data unit with a name and a data type (e.g., Integer, String, Date).  \n**Record:** A row from a database table. This is a horizontal data unit that spans all of the fields (columns) in a table.  \n**Entity:** A 'noun' (person, place, or thing) that the data of a record (row) describes.  \n  \n**Primary Key:** One or more fields (columns) in a database table that uniquely identifies a row by not permitting repeat values (IDs, such as student and employee IDs, are popular primary keys).  \n**Foreign Key:** One of more fields (columns) in a database table that only include values corresponding to the primary key of another table. Primary and foreign keys, in tandem, define table relationships.  \n**Referential Integrity:** Occurs when the values of a foreign key successfully correspond to the row values of an associated table's primary key.  \n  \n**Relational:** A database type in which the relationships between tables are established via matching/corresponding fields (columns). A software program that provides data persistence for and manages relational databases is referred to as an *RDBMS* (Relational Database Management System).  \n**Normalization:** A data organization approach in which best practices for data integrity are followed (data are consistent and redundancy is reduced).\n  \n\u003chr /\u003e\n  \n## 4. \u003ca name=\"sql-clauses\"\u003eSQL Clauses\u003c/a\u003e  \n\nSix of the most commonly applied SQL clauses include:\n  \n* **SELECT:** Specifies which column(s) results should be returned from.\n* **FROM:** Specifies which table(s) results should be returned from.\n* **WHERE:** Filters datas based on provided conditions/constraints.\n* **GROUP BY:** Brings together rows (as summary rows) that have the same values for specified columns/fields.\n* **HAVING:** After aggregate functions are utilized, filters grouped rows according to provided specifications.\n* **ORDER BY:** Sorts data in ascending (A-Z, 0-9) or descending (Z-A, 9-0) order.  \n  \n\u003chr /\u003e\n\n## 5. \u003ca name=\"sql-constraints\"\u003eSQL Constraints\u003c/a\u003e\n  \n(TODO)\n  \n\u003chr /\u003e\n\n## 6. \u003ca name=\"sql-filtering-sorting\"\u003eSQL Filtering and Sorting\u003c/a\u003e\n  \n(TODO)\n  \n\u003chr /\u003e\n  \n## 7. \u003ca name=\"sql-joins\"\u003eSQL Joins\u003c/a\u003e\n  \nAn SQL `JOIN` clause combines rows/records from multiple tables, relying on a related column/field from between them in doing so. Types of joins include:\n  \n**INNER JOIN**: Retrieves records with corresponding values from the tables expressed in the join clause.  \n**LEFT OUTER JOIN**: Retrieves all records from the 'left' table, as well as corresponding records from the 'right' table.  \n**RIGHT OUTER JOIN**: Retrieves all records from the 'right' table, as well as the corresponding records from the 'left' table.  \n**FULL OUTER JOIN**: Retrieves all corresponding records, regardless of if the match is form the 'left' or 'right' table.  \n  \n\u003chr /\u003e\n  \n## 8. \u003ca name=\"supplemental\"\u003eSupplemental Resources\u003c/a\u003e\n  \n* *[Data Repositories Overview Guide](https://github.com/chaseofthejungle/data-repositories-overview)*  \n* *[Types of Databases Guide](https://github.com/chaseofthejungle/types-of-databases)*\n* *[Codecademy Learn SQL Course](https://www.codecademy.com/learn/learn-sql)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaseofthejungle%2Fintro-to-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaseofthejungle%2Fintro-to-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaseofthejungle%2Fintro-to-sql/lists"}