Free · 102 Topics · No Signup
SQL Notes
Query, join, and manage relational data — written by Coding Now Tech Institute's mentors. Free to read, structured to actually help you learn.
SQL notes by Coding Now Tech Institute cover 102 topics — from sql home to joining multiple tables in sql — each explained with short definitions, syntax and runnable code examples. They are 100% free, need no signup, and work as quick revision for college exams, SQL interviews and Coding Now Tech Institute's mentor-led SQL course in Pitampura, Delhi.
SQL Tutorial
SQL Tutorial chapters
SQL Database
SQL Database chapters
SQL Basics
Databases, tables, data types and the core DDL/DML commands.
SQL Queries
SELECT, filtering, sorting and combining result sets with set operators.
SQL Joins
INNER, LEFT, RIGHT, FULL, CROSS and SELF joins explained with sample tables.
No notes found. Try a different search term, or browse all SQL notes.
SQL Tutorial
46 of 46 topics publishedSQL HOME
SQL is the universal language of databases, and every analyst, backend developer and data engineer uses it daily. This free track takes you from writing your first query to joins, views and security best practices.
SQL Intro
Structured Query Language lets you store, search and manage data held in relational databases. Start here to understand what SQL is, why it powers almost every serious application, and how you will use it in real jobs.
SQL Syntax
SQL reads like simple English, but its syntax rules decide whether a query runs or crashes. Master the basic structure of statements, keywords and semicolons before moving to complex queries.
SQL Select
SELECT is the first command every SQL learner writes and the one professionals use hundreds of times a day. It fetches exactly the columns you need from a table without disturbing the underlying data.
SQL Select Distinct
Real-world tables are full of repeated values, and SELECT DISTINCT is the tool that removes them in one line. Data analysts rely on it constantly to find unique customers, cities or categories.
SQL Where
The WHERE clause turns a dump of rows into a precise answer by filtering records against conditions. Almost every business question you answer with SQL starts with a good WHERE clause.
SQL Order By
Sorted output is what makes reports readable, and ORDER BY gives you full control over it. Learn to arrange rows by one or more columns in ascending or descending order.
SQL And
The AND operator lets you stack several filter conditions into one query, so you can ask questions like rows matching this AND that. It is the backbone of precise data filtering.
SQL Or
OR widens your query to match rows that satisfy any of several conditions. Knowing when to combine OR with AND, and how to group them, prevents silently wrong results.
SQL Not
NOT inverts a condition and is perfect for excluding records — everything except a category, a date range or a status. It reads naturally and keeps complex filters short.
SQL Insert Into
Adding data is just as important as reading it, and INSERT INTO is how new rows enter a table. You will use it when building apps, loading files and setting up test data.
SQL Null Values
NULL means the value is unknown or missing, and it behaves differently from zero or an empty string. Handling NULL correctly separates careful developers from bug-prone queries.
SQL Update
The UPDATE statement changes existing rows in place, which is why every developer treats it with care. Pairing it with WHERE is the difference between fixing one record and ruining a whole table.
SQL Delete
DELETE removes rows permanently, so understanding it properly protects real business data. Learn how to target the right records and why forgetting WHERE is the classic SQL disaster.
SQL Select Top
Working with big tables often means you only want the first few rows, and SELECT TOP (or LIMIT) delivers exactly that. It is handy for sampling data and building leaderboards.
SQL Aggregate Functions
Aggregate functions compress thousands of rows into a single answer — totals, averages, counts and more. They are the heart of every dashboard and summary report.
SQL Min()
MIN() finds the smallest value in a column, from the cheapest product to the earliest date. It is one of the first tools you reach for when exploring a new dataset.
SQL Max()
MAX() returns the largest value in a column, like the highest salary or the most recent order. Combined with grouping, it answers best-of questions in one query.
SQL Count()
COUNT() tells you how many rows match your conditions, and it is often the first number a stakeholder asks for. Learn its variants, including counting distinct values.
SQL Sum()
SUM() adds up a numeric column — revenue, hours, quantities — turning raw rows into business totals. It powers invoices, budgets and every sales report.
SQL Avg()
AVG() computes the average of a numeric column, from order values to delivery times. Watch how it handles NULLs, because that detail changes your answer.
SQL Like
LIKE searches for patterns inside text using wildcards, so you can find names, emails or product codes without exact matches. It is the workhorse of fuzzy text search in SQL.
SQL Wildcards
Wildcards are the pattern symbols that make LIKE powerful — % matches any characters, _ matches one. Mastering them turns vague search terms into reliable filters.
SQL In
IN lets you match a column against a list of values in one clean clause instead of chaining many ORs. It is the natural way to query for a set of known items.
SQL Between
BETWEEN checks whether a value falls inside a range, making date and price filters short and readable. Remember that its bounds are inclusive, which trips up beginners.
SQL Aliases
Aliases give tables and columns temporary short names, keeping complex queries readable. They are also what puts clean column headings on your exported reports.
SQL Joins
Joins combine rows from multiple tables, which is where SQL starts earning its keep. Nearly every real business query pulls data from at least two tables using joins.
SQL Inner Join
INNER JOIN returns only the rows that match in both tables — the standard way to link orders to customers or employees to departments. It is the join you will use most often.
SQL Left Join
LEFT JOIN keeps every row from the first table even when no match exists in the second, filling gaps with NULLs. It is perfect for finding customers with no orders yet.
SQL Right Join
RIGHT JOIN mirrors LEFT JOIN by keeping all rows from the second table instead. It is used less often, but knowing it makes join logic complete.
SQL Full Join
FULL JOIN returns rows from both tables, matched where possible and NULL-padded elsewhere. It is the tool for comparing two datasets side by side.
SQL Self Join
A self join links a table to itself, which sounds odd until you need to compare employees with their managers or find pairs of related products. It unlocks hierarchical queries.
SQL Union
UNION stacks the results of two queries into one list while removing duplicates. It is how you combine similar datasets from different tables or reports.
SQL Union All
UNION ALL also stacks result sets but keeps every row, duplicates included. Use it when you need speed and know duplicates are impossible or acceptable.
SQL Group By
GROUP BY collapses rows that share a value so aggregates run per group — sales by city, orders by month. It is the engine behind every grouped report.
SQL Having
HAVING filters groups the way WHERE filters rows, so you can ask for categories with sales above a threshold. It is the step beginners usually miss.
SQL Exists
EXISTS checks whether a subquery returns any rows, which is often faster than joining when you only care about existence. It reads naturally in business questions.
SQL Any
ANY compares a value against every result of a subquery and matches if at least one comparison succeeds. It gives you subquery power in a single operator.
SQL All
ALL matches only when a comparison holds against every row returned by a subquery — for example, salaries greater than all values in a list. It is the strict cousin of ANY.
SQL Select Into
SELECT INTO copies query results into a brand-new table in one step. It is a quick way to build backups and snapshots during development.
SQL Insert Into Select
INSERT INTO SELECT moves data between tables by combining an insert with a query. It powers bulk copies, table merges and archive jobs.
SQL Case
CASE works like if-else logic inside a query, letting you map codes to labels or bucket values into ranges. It keeps transformations inside the database instead of the app.
SQL Null Functions
NULL-handling functions like COALESCE and IFNULL swap missing values for sensible defaults. Reports that show blanks today become clean and useful with these.
SQL Stored Procedures
Stored procedures package a whole sequence of SQL into a reusable, callable routine. They centralise business logic and are a must-know for database developer roles.
SQL Comments
Comments document your queries so teammates — and future you — understand the intent. Good commenting is a professional habit interviewers notice.
SQL Operators
SQL operators — arithmetic, comparison, logical and bitwise — let you calculate and decide inside queries. A firm grip on operator precedence prevents subtle wrong results.
SQL Database
21 of 21 topics publishedSQL Create DB
CREATE DATABASE initialises the container that will hold all of a project's tables. It is the first step in setting up any new system.
SQL Drop DB
DROP DATABASE permanently deletes a database and everything inside it. Learn when and why you would use it, and why backups come first.
SQL Backup DB
Backups are what stand between you and total data loss, and every serious setup automates them. Learn the standard ways to back up and restore a database.
SQL Create Table
CREATE TABLE defines the structure that stores your data — columns, types and rules. A well-designed table makes every later query simpler and faster.
SQL Drop Table
DROP TABLE removes a table and all its rows permanently. Understanding the difference between dropping, truncating and deleting saves real accidents.
SQL Alter Table
Requirements change, and ALTER TABLE lets you add, modify or remove columns without rebuilding the table. It is how live databases evolve safely.
SQL Constraints
Constraints are the rules you set on columns — uniqueness, non-null, valid ranges — so bad data never enters the system. They are your first line of data-quality defence.
SQL Not Null
NOT NULL guarantees a column always holds a value, blocking the missing data that breaks reports and logic. It belongs on every field that is truly required.
SQL Unique
The UNIQUE constraint prevents duplicate values in a column, such as two users with the same email. It keeps data clean without extra application code.
SQL Primary Key
A primary key uniquely identifies every row in a table, and every well-designed table has one. It anchors relationships and makes lookups fast and reliable.
SQL Foreign Key
Foreign keys link rows across tables and enforce referential integrity, so you cannot reference a customer that does not exist. They are the glue of relational design.
SQL Check
CHECK validates values against a condition before they are stored — ages above zero, statuses from a fixed list. It catches bad data at the database, not just in the app.
SQL Default
DEFAULT supplies a value automatically when none is provided, keeping inserts short and consistent. It quietly powers fields like timestamps and status flags.
SQL Create Index
Indexes dramatically speed up searches on large tables, much like a book's index. Learn when to add them — and why too many slow down writes.
SQL Auto Increment
AUTO INCREMENT lets the database assign the next number to each new row, giving you effortless unique IDs. It is the standard primary-key strategy.
SQL Dates
Dates have their own data types and functions in SQL, and real reporting depends on handling them correctly. Learn to store, filter and format date values properly.
SQL Views
Views are saved, reusable queries that behave like tables while keeping the real data untouched. They simplify reporting and hide complex joins from end users.
SQL Injection
SQL injection is a top web vulnerability where attackers manipulate queries through user input. Understanding it is non-negotiable for anyone building database-driven apps.
SQL Parameters
Parameterised queries separate data from SQL code, neutralising injection attacks at the source. This is the secure way every modern application talks to a database.
SQL Prepared Statements
Prepared statements compile a query once and reuse it with different values, combining safety and performance. They are the recommended pattern for all dynamic queries.
SQL Hosting
A database has to live somewhere, and hosting options range from local servers to managed cloud services. Learn how production databases are deployed, secured and backed up.
SQL Basics
12 of 12 topics publishedWhat Is SQL? A Practical Introduction
What SQL actually is, what it does, and why it matters for analysts and developers.
SQL Databases — RDBMS Explained
What a relational database is, and how MySQL, PostgreSQL, SQL Server and others compare.
SQL vs NoSQL — Key Differences Explained
How relational (SQL) and non-relational (NoSQL) databases differ, and when to use each.
SQL Data Types — Numeric, String, Date & Boolean
The major SQL data type categories and how they differ across MySQL, PostgreSQL and SQL Server.
CREATE DATABASE in SQL
How to create a new SQL database, with syntax and dialect notes.
CREATE TABLE in SQL
How to define a new table with columns, data types and constraints.
ALTER TABLE in SQL
How to add, modify, rename and drop columns on an existing table.
DROP TABLE in SQL
How to permanently delete a table, and when to use it instead of TRUNCATE or DELETE.
TRUNCATE TABLE in SQL
How TRUNCATE instantly clears a table, and exactly how it differs from DELETE.
SQL INSERT Statement
How to add new rows to a table — single row, multiple rows, and INSERT...SELECT.
SQL UPDATE Statement
How to modify existing rows safely — and why the WHERE clause is critical.
SQL DELETE Statement
How to remove specific rows from a table, and how DELETE compares to TRUNCATE and DROP.
SQL Queries
13 of 13 topics publishedSQL SELECT Statement
The most-used SQL statement — retrieving columns from a table.
SQL SELECT DISTINCT
How to remove duplicate rows from a result set using DISTINCT.
SQL WHERE Clause
How to filter rows with WHERE, and the comparison operators available.
SQL AND / OR Operators
Combining multiple conditions in WHERE, and why parentheses matter.
SQL NOT Operator
Reversing a condition with NOT, including its behavior with NULL values.
SQL IN Operator
Matching a value against a list, and using IN with a subquery.
SQL BETWEEN Operator
Filtering values within an inclusive range, including the datetime gotcha.
SQL LIKE Operator
Pattern matching with % and _ wildcards for partial text search.
SQL IS NULL / IS NOT NULL
Testing for missing values correctly — why = NULL never works.
SQL ORDER BY Clause
Sorting query results, including multi-column sorts.
SQL LIMIT Clause
Restricting row count for top-N results and pagination.
SQL Aliases (AS)
Renaming columns and tables for readability with AS.
SQL CASE Statement
Adding if/else logic to a query, and the CASE + SUM pivot pattern.
SQL Joins
10 of 10 topics publishedSQL Joins — Complete Guide
An overview of all six SQL join types, with a shared reference dataset used across this section.
INNER JOIN in SQL
Returning only rows that match in both tables — syntax, example, and common mistakes.
LEFT JOIN in SQL
Keeping every row from the left table, and the LEFT JOIN + IS NULL pattern for finding unmatched rows.
RIGHT JOIN in SQL
Keeping every row from the right table — the mirror image of LEFT JOIN.
FULL OUTER JOIN in SQL
Keeping every row from both tables, and how to simulate it in MySQL.
CROSS JOIN in SQL
Producing every combination of two tables — the Cartesian product.
SELF JOIN in SQL
Joining a table to itself for hierarchical data like employees and managers.
INNER JOIN vs LEFT JOIN
The core difference, and how to decide which join type a report actually needs.
LEFT JOIN vs RIGHT JOIN
Why they're mirror images of each other, and why LEFT JOIN is the common convention.
Joining Multiple Tables in SQL
Chaining three or more joins together to build real, multi-table reports.
Ready to go from notes to a real career?
Join Coding Now Tech Institute's SQL course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.
Enroll Now — Free Demo AvailableSQL Notes – FAQs
What students search before reading SQL notes.