SQL

UNION

This command combines results from two or more select queries. In order to use the UNION command, you must have the same number of columns in each select statement and the corresponding columns must have Read more…

By Josh, ago
SQL

HAVING

This command is used with GROUP BY to filter group rows. It is similar to WHERE, but HAVING applies to the aggregated rows after the GROUP BY command (WHERE applies to individual rows before the Read more…

By Josh, ago
SQL

GROUP BY

GROUP BY statements use various aggregate functions to combine rows and look at aggregated information. Aggregate functions used below: MIN, MAX, AVG, COUNT, SUM. The calls below are made a hypothetical transaction database with columns Read more…

By Josh, ago
SQL

Basic SQL Statements

SQL is case-insensitive, but by convention SQL commands are typed in upper case. The examples below return specific data from a hypothetical database named transactions with columns: first_name, last_name, customer_id, and price. Basic commands: SELECT Read more…

By Josh, ago