CadencePlus Solutions

SQL Foundations

Read, filter and summarize data, then create and change records safely.

Read data

SELECT and FROM: SQL is the language used to ask questions of a relational database: a collection of related tables. SELECT chooses the output; FROM names its source.

Aliases and DISTINCT: Give results names people can understand, and remove repeated combinations only when the question calls for it.

LIMIT / TOP: A small sample makes exploration manageable. A meaningful top list also needs a deliberate sort.

Filter and sort

ORDER BY: Sorting is part of the answer when sequence matters. The order you see in a table preview is not a guarantee.

WHERE and comparison operators: WHERE keeps the individual rows that meet your conditions. Start with one rule, then combine rules deliberately.

NULL, LIKE and wildcards: Missing values and text patterns need their own rules. NULL is not zero, an empty string, or the word “NULL”.

Summarize

COUNT, SUM, AVG, MIN, MAX: An aggregate turns several input rows into a summary value. Decide what each input row represents before calculating.

GROUP BY: GROUP BY changes your result’s grain. One row per order becomes one row per customer, country, or reporting period.

HAVING: WHERE filters source rows; HAVING filters the groups built from those rows.

Combine tables

Keys and relationships: A join needs more than matching names. It needs keys that represent the relationship you actually want.

INNER and LEFT JOIN: Joins match rows using a condition. Choose the join according to which unmatched rows your answer must retain.

Basic CASE: CASE adds a calculated category to your output. The rules should match the business definition, not just produce attractive labels.

Manage data safely

CREATE TABLE and constraints: A table definition describes what can be stored. Start with the row meaning, then choose columns and rules.

INSERT INTO: INSERT adds new records. Name the destination columns so each value has a clear meaning.

UPDATE and safe targeting: UPDATE changes existing records. Verify the target before you change it, and inspect what changed afterward.

DELETE and safe targeting: DELETE removes records. A selective condition and a verification query keep that change deliberate.