MySQL LEFT JOIN Keyword

MySQL LEFT JOIN Keyword

The LEFT JOIN keyword returns all records from the left table (table1), and the matching records (if any) from the right table (table2).

Continue reading MySQL LEFT JOIN Keyword

MySQL INNER JOIN Keyword

MySQL INNER JOIN Keyword

The INNER JOIN keyword selects records that have matching values in both tables. Continue reading MySQL INNER JOIN Keyword

MySQL Joins

MySQL Joining Tables

A JOIN clause is used to combine rows from two or more tables, based on a related column between them.

Let’s look at a selection from the “Orders” table: Continue reading MySQL Joins

MySQL Aliases

MySQL Aliases

Aliases are used to give a table, or a column in a table, a temporary name.

Aliases are often used to make column names more readable.

An alias only exists for the duration of that query.

An alias is created with the AS keyword. Continue reading MySQL Aliases

MySQL BETWEEN Operator

The MySQL BETWEEN Operator

The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates.

The BETWEEN operator is inclusive: begin and end values are included. Continue reading MySQL BETWEEN Operator

MySQL IN Operator

The MySQL IN Operator

The IN operator allows you to specify multiple values in a
WHERE
clause.

The IN operator is a shorthand for multiple
OR
conditions. Continue reading MySQL IN Operator

MySQL COUNT(), AVG() and SUM() Functions

MySQL COUNT(), AVG() and SUM() Functions

The COUNT() function returns the number of rows that matches a specified criterion.

COUNT() Syntax

SELECT COUNT(column_name)
FROM table_name
WHERE condition;

The AVG() function returns the average value of a numeric column. Continue reading MySQL COUNT(), AVG() and SUM() Functions

MySQL MIN() and MAX() Functions

MySQL MIN() and MAX() Functions

The MIN() function returns the smallest value of the selected column.

The MAX() function returns the largest value of the selected column. Continue reading MySQL MIN() and MAX() Functions