{
  "id": 6792092,
  "title": "Getting into SQL For Beginners:",
  "url": "https://urgent.news/2026/09/11/getting-into-sql-for-beginners",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-11T20:12:55.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ian_munene/getting-into-sql-for-beginners-20hd"
  },
  "original_language": "en",
  "account": "Embarking on a SQL journey may seem intimidating at first, yet every great adventure starts with the first step. This guide breaks down the basics of SQL, making it accessible for beginners.\n\n1. DDL (Data Definition Language): DDL is about crafting and restructuring the database's blueprint. Key commands include:\n- CREATE SCHEMA: Establishes new database compartments, organizing tables and objects.\n- CREATE TABLE: Initiates a fresh table and specifies its columns.\n- ALTER: Adjusts existing tables, adding, renaming, or modifying column data types.\n- DROP: Permanently deletes unwanted columns.\n- TRUNCATE: Erases all rows while preserving the table's structure.\n\nExample: Create a schema named \"greenwood_academy\", then a \"students\" table with columns for ID, first name, last name, and gender. Modify the schema with commands like ALTER TABLE to add a \"phone_number\" column.\n\n2. DML (Data Manipulation Language): DML focuses on handling the actual data within the structure. Common commands are:\n- INSERT: Adds new rows to a table.\n- UPDATE: Amends existing records.\n- DELETE: Eliminates rows.\n- SELECT*: Retrieves data from a database.\n\nExample: Update a student's city from \"Nairobi\" using the command: UPDATE greenwood_academy.students SET city = 'Nairobi' WHERE student_id = 5.\n\n3. SQL Joins: These commands merge data from multiple tables using shared columns. Types include:\n- INNER JOIN: Returns only matching records from both tables.\n- LEFT JOIN: Includes all rows from the left table and matching rows from the right, filling NULL values where no match exists.\n- RIGHT JOIN: Reverses the LEFT JOIN process.\n- FULL OUTER JOIN: Combines data from both tables, even if columns don't match.\n\n4. SUBQUERIES & CTES: These are powerful tools for complex queries:\n- Subqueries: Nested queries embedded within larger SQL statements.\n- CTE (Common Table Expressions): Named, temporary result sets defined at the start of a query using the WITH clause.\n\nExample: A subquery calculates the average score from a table and orders the results by that average. A CTE computes the same average first, then uses it in the main query. Both methods yield identical results, but CTEs can simplify complex calculations.\n\n5. SQL Functions: These tools help manipulate data, perform calculations, and format outputs within queries. They come in two forms:\n- Scalar Functions: Operate on individual rows and return a single value per row, such as UPPER(), LOWER(), ROUND(), and LENGTH().\n- Aggregate Functions: Work on sets of rows to generate a single summarized value, like COUNT(), AVG(), SUM(), MIN(), and MAX().\n\nExample: Use a scalar function to rename column headers with UPPER() and LOWER(), or an aggregate function to calculate the average marks in a table.",
  "summary": "Starting new endeavors can feel daunting, but every journey begins with a single step. Learning SQL opens doors to new opportunities. This guide simplifies the fundamentals of SQL, teaching you its essential elements. 1.DDL(Data Definition Language) DDL defines and modifies the database structure and schema, determining table appearance and data content. There are various commands that are used…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}