Relational SQL — queries, joins, constraints, views and prepared statements — written by Aivasu Tech Institute's mentors. Free to read, structured to actually help you learn.
MySQL notes by Aivasu Tech Institute cover 64 topics — from mysql home to mysql prepared statements — 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, MySQL interviews and Aivasu Tech Institute's mentor-led MySQL course in Pitampura, Delhi.
No notes found. Try a different search term, or browse all MySQL notes.
SQL is the standard language for dealing with Relational Databases.
The SELECT statement is used to select data from a database.
The SELECT DISTINCT statement is used to return only distinct (unique) values.
The WHERE clause is used to filter records.
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The WHERE clause can contain one or many AND operators.
The WHERE clause can contain one or more OR operators.
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
The INSERT INTO statement is used to insert new records in a table.
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
The UPDATE statement is used to update or modify one or more records in a table.
The DELETE statement is used to delete existing records in a table.
The LIMIT clause is used to limit the number of records to return.
An aggregate function is a function that performs a calculation on a set of values, and returns a single value.
The MIN() function returns the smallest value of the selected column.
The MAX() function returns the largest value of the selected column.
The COUNT() function returns the number of rows that matches a specified criterion.
The SUM() function is used to calculate the total sum of values within a numeric column.
The AVG() function returns the average value of a numeric column.
The LIKE operator is used in a WHERE clause to search for a specified pattern within a column's text data.
A wildcard character is used to substitute one or more characters in a string.
The IN operator is used in the WHERE clause to check if a specified column's value matches any value within a provided list.
The BETWEEN operator is used in the WHERE clause to select values within a specified range.
An alias is created with the AS keyword, and is often used to make a column name more readable.
The JOIN clause is used to combine rows from two or more tables, based on a related column between them.
The INNER JOIN clause returns only rows that have matching values in both tables.
The LEFT JOIN clause returns all rows from the left table (table1), and only the matched rows from the right table (table2).
The RIGHT JOIN clause returns all rows from the right table (table2), and only the matched rows from the left table (table1).
The CROSS JOIN clause returns the Cartesian product of two or more tables (combines every row from the first table with every row from the second table).
A self join is a regular join, but the table is joined with itself.
The UNION operator is used to combine the result-set of two or more SELECT statements.
The UNION ALL operator is used to combine the result-set of two or more SELECT statements.
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".
The HAVING clause is used to filter the results of a GROUP BY query based on aggregate functions.
The EXISTS operator is used in a WHERE clause to check whether a subquery returns any rows.
The ANY operator is used to compare a value to every value returned by a subquery.
The ALL operator is used to compare a value to every value returned by a subquery.
The INSERT INTO SELECT statement is used to copy data from an existing table and insert it into another existing table.
The CASE statement is used to define different results based on specified conditions in an SQL statement.
Operations involving NULL values can sometimes lead to unexpected results.
A stored procedure is a precompiled SQL code that can be saved and reused.
Comments are used to explain SQL code, or to temporarily prevent execution of SQL code (for debugging).
MySQL operators are keywords and symbols used to perform operations with data values.
The CREATE DATABASE statement is used to create a new SQL database.
The DROP DATABASE statement is used to permanently delete an existing SQL database.
The CREATE TABLE statement is used to create a new table in a database.
The DROP TABLE statement is used to permanently delete an existing table in a database.
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
Constraints are rules for data in a table.
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
The UNIQUE constraint ensures that all values in a column are unique.
The PRIMARY KEY constraint uniquely identifies each record in a database table.
The FOREIGN KEY constraint establishes a link between two tables, and prevents action that will destroy the link between them.
The CHECK constraint is used to ensure that the values in a column satisfies a specific condition.
The DEFAULT constraint is used to automatically insert a default value for a column, if no value is specified.
The CREATE INDEX statement is used to create indexes on tables in databases, to speed up data retrieval.
An auto-increment field is a numeric column that automatically generates a unique number, when a new record is inserted into a table.
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
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 is a code injection technique that can destroy your database. SQL injections are a common web hacking technique.
Prepared statements is used to protect a web site from SQL injections.
Join Aivasu Tech Institute's MySQL course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.
Enroll Now — Free Demo Available✳ Common questions
What students search before reading MySQL notes.