Free · 67 Topics · No Signup
SQL Notes
Query, join, and manage relational data — written by CodingNow 2.0's mentors. Free to read, structured to actually help you learn.
SQL notes by CodingNow 2.0 cover 67 topics — from sql home to sql hosting — 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 CodingNow 2.0's mentor-led SQL course in Pitampura, Delhi.
No notes found. Try a different search term, or browse all SQL notes.
SQL Tutorial
46 of 46 topics publishedSQL HOME
SQL is a standard language for storing, manipulating and retrieving data in databases.
SQL Intro
SQL is a standard language for accessing and manipulating databases.
SQL Syntax
Most of the actions you need to perform on a database are done with SQL statements.
SQL Select
The SELECT statement is used to select data from a database.
SQL Select Distinct
The SELECT DISTINCT statement is used to return only distinct (unique) values.
SQL Where
The WHERE clause is used to filter records.
SQL Order By
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
SQL And
The WHERE clause can contain one or many AND operators.
SQL Or
The WHERE clause can contain one or more OR operators.
SQL Not
The NOT operator is used in the WHERE clause to return all records that DO NOT match the specified criteria. It reverses the result of a condition from true
SQL Insert Into
The INSERT INTO statement is used to insert new records in a table.
SQL Null Values
If a field in a table is optional, it is possible to insert or update a record without adding any value to this field. This way, the field will be saved with a
SQL Update
The UPDATE statement is used to update or modify one or more records in a table.
SQL Delete
The DELETE statement is used to delete existing records in a table.
SQL Select Top
The SELECT TOP clause is used to limit the number of records to return.
SQL Aggregate Functions
An aggregate function is a function that performs a calculation on a set of values, and returns a single value.
SQL Min()
The MIN() function returns the smallest value of the selected column.
SQL Max()
The MAX() function returns the largest value of the selected column.
SQL Count()
The COUNT() function returns the number of rows that matches a specified criterion.
SQL Sum()
The SUM() function is used to calculate the total sum of values within a numeric column.
SQL Avg()
The AVG() function returns the average value of a numeric column.
SQL Like
The LIKE operator is used in a WHERE clause to search for a specified pattern within a column's text data.
SQL Wildcards
A wildcard character is used to substitute one or more characters in a string.
SQL In
The IN operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list.
SQL Between
The BETWEEN operator is used in the WHERE clause to select values within a specified range.
SQL Aliases
An alias is created with the AS keyword, and is often used to make a column name more readable.
SQL Joins
The JOIN clause is used to combine rows from two or more tables, based on a related column between them.
SQL Inner Join
The INNER JOIN returns only rows that have matching values in both tables.
SQL Left Join
The LEFT JOIN returns all rows from the left table (table1), and only the matched rows from the right table (table2).
SQL Right Join
The RIGHT JOIN returns all rows from the right table (table2), and only the matched rows from the left table (table1).
SQL Full Join
The FULL JOIN returns all rows when there is a match in either the left or right table.
SQL Self Join
A self join is a regular join, but the table is joined with itself.
SQL Union
The UNION operator is used to combine the result-set of two or more SELECT statements.
SQL Union All
The UNION ALL operator is used to combine the result-set of two or more SELECT statements.
SQL Group By
The GROUP BY statement is used to group rows that have the same values into summary rows, like "Find the number of customers in each country".
SQL Having
The HAVING clause is used to filter the results of a GROUP BY query based on aggregate functions.
SQL Exists
The EXISTS operator is used in a WHERE clause to check whether a subquery returns any rows.
SQL Any
The ANY operator is used to compare a value to every value returned by a subquery.
SQL All
The ALL operator is used to compare a value to every value returned by a subquery.
SQL Select Into
The SELECT INTO statement is used to create a new table and fill it with data from an existing table.
SQL Insert Into Select
The INSERT INTO SELECT statement is used to copy data from an existing table and insert it into another existing table.
SQL Case
The CASE expression is used to define different results based on specified conditions in an SQL statement.
SQL Null Functions
SQL COALESCE(), IFNULL(), ISNULL(), and NVL() Functions
SQL Stored Procedures
A stored procedure is a precompiled SQL code that can be saved and reused.
SQL Comments
Comments are used to explain SQL code, or to temporarily prevent execution of SQL code (for debugging).
SQL Operators
SQL operators are keywords and symbols used to perform operations with data values.
SQL Database
21 of 21 topics publishedSQL Create DB
The CREATE DATABASE statement is used to create a new SQL database.
SQL Drop DB
The DROP DATABASE statement is used to permanently delete an existing SQL database.
SQL Backup DB
The BACKUP DATABASE statement is used in SQL Server to create a full backup of an existing SQL database.
SQL Create Table
The CREATE TABLE statement is used to create a new table in a database.
SQL Drop Table
The DROP TABLE statement is used to permanently delete an existing table in a database.
SQL Alter Table
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
SQL Constraints
SQL constraints are rules for data in a table.
SQL Not Null
The NOT NULL constraint enforces a column to NOT accept NULL values. This enforces a field to always contain a value, which means that you cannot insert a new
SQL Unique
The UNIQUE constraint ensures that all values in a column are unique.
SQL Primary Key
The PRIMARY KEY constraint uniquely identifies each record in a database table.
SQL Foreign Key
The FOREIGN KEY constraint establishes a link between two tables, and prevents action that will destroy the link between them.
SQL Check
The CHECK constraint is used to ensure that the values in a column satisfies a specific condition.
SQL Default
The DEFAULT constraint is used to automatically insert a default value for a column, if no value is specified.
SQL Create Index
The CREATE INDEX statement is used to create indexes on tables in databases, to speed up data retrieval.
SQL Auto Increment
An auto-increment field is a numeric column that automatically generates a unique number, when a new record is inserted into a table.
SQL Dates
The most difficult part when working with dates in databases, is to be sure that the format of the date you are trying to insert/select, matches the format of t
SQL Views
An SQL view is a virtual table based on the result-set of an SQL statement. An SQL view contains rows and columns, just like a real table. The fields in the vie
SQL Injection
SQL injection is a code injection technique that can destroy your database. SQL injections are a common web hacking technique.
SQL Parameters
SQL parameters (Parameterized Queries) can be used to protect a web site from SQL injections.
SQL Prepared Statements
SQL Prepared Statements - Prevent SQL Injection
SQL Hosting
If you want your web site to store and retrieve data from a database, your web server must have access to a database-system.
Ready to go from notes to a real career?
Join CodingNow 2.0'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.