Search This Blog

MySQL Tutorial

mysql tutorial

MySQL Tutorial

MySQL is the world's most popular open-source relational database technology.

Our tutorial will start with the basics of MySQL such as how to retrieve and manipulate data. Then we will move to the more advanced topics such as how to create tables, functions, procedures, and triggers. We will conclude with a review of the functions that are proprietary to MySQL.

With this tutorial, you should be on your way to becoming proficient in MySQL and its programming language.

Prerequisites

There are no prequisities for this MySQL tutorial. You should be able to easily understand this tutorial and learn the basic concepts of MySQL as you progress to the more advanced topics.

Now, let's get started!

Start Tutorial

Or jump directly to a topic in MySQL:

MySQL Functions

Functions - AlphabeticalMySQL Functions listed alphabetically
Functions - CategoryMySQL Functions listed by category

MySQL Keys, Constraints and Indexes

Primary KeysCreate, alter, and drop primary keys
Unique ConstraintsCreate, add, and drop unique constraints
IndexesCreate, drop and rename indexes (performance tuning)

MySQL Privileges and Passwords

Grant/Revoke PrivilegesGrant or revoke privileges
Change PasswordChange a user's password

MySQL Database Administration

UsersDatabase accounts

MySQL Programming

FunctionsCreate and drop functions
ProceduresCreate and drop procedures
TriggersCreate and drop triggers
CursorsCreate cursors within stored programs
Literals (Constants)String, number, date, time, boolean literals
Declaring VariablesDeclare variables within stored programs
Loops and Conditional StatementsLOOP statement, IF-THEN-ELSE and others
AUTO_INCREMENT (Sequences)Create a sequence of numbers using the AUTO_INCREMENT attribute
Comments within SQLHow to create comments within your SQL statement

MySQL Comparison Operators

Comparison OperatorsOperators such as =, <>, !=, >, <, and so on

MySQL Query Types

SELECT StatementRetrieve records from a table
SELECT LIMIT StatementRetrieve records from a table and limit results
INSERT StatementInsert records into a table
UPDATE StatementUpdate records in a table
DELETE StatementDelete records from a table
DELETE LIMIT StatementDelete records and limit number of deletions
TRUNCATE TABLE StatementDelete all records from a table (no rollback)
UNION OperatorCombine 2 result sets (removes duplicates)
UNION ALL OperatorCombine 2 result sets (includes duplicates)
INTERSECT OperatorIntersection of 2 result sets
SubqueriesA query within a query

MySQL Joins

JOIN TablesInner and Outer joins

MySQL Aliases

ALIASESCreate a temporary name for a column or table

MySQL Clauses

DISTINCT ClauseRetrieve unique records
FROM ClauseList tables and join information
WHERE ClauseFilter results
ORDER BY ClauseSort query results
GROUP BY ClauseGroup by one or more columns
HAVING ClauseRestrict the groups of returned rows

MySQL SQL Functions

COUNT FunctionReturn the count of an expression
SUM FunctionReturn the sum of an expression
MIN FunctionReturn the min of an expression
MAX FunctionReturn the max of an expression
AVG FunctionReturn the average of an expression

MySQL Conditions

AND Condition2 or more conditions to be met
OR ConditionAny one of the conditions are met
AND and ORCombine AND and OR conditions
LIKE ConditionUse wildcards in a WHERE clause
IN ConditionAlternative to multiple OR conditions
NOT ConditionNegate a condition
IS NULL ConditionTest for a NULL value
IS NOT NULL ConditionTest for a NOT NULL value
BETWEEN ConditionRetrieve within a range (inclusive)
EXISTS ConditionCondition is met if subquery returns at least one row

MySQL Tables and Views

CREATE TABLECreate a table
CREATE TABLE ASCreate a table from another table's definition and data
ALTER TABLEAdd, modify, delete columns in a table; rename a table
DROP TABLEDelete a table
VIEWVirtual tables (views of other tables)

MySQL Data Types

Data TypesData Types in MySQL

MySQL Question and Answer

Question & AnswerVarious questions and answers

 

No comments:

Post a Comment

MySQL: DROP TRIGGER Statement

  MySQL:   DROP TRIGGER Statement This MySQL tutorial explains how to use the   DROP TRIGGER statement   to drop a trigger in MySQL with syn...