Profile a table before you transform it. A profile tells you how many rows there are, how many values each column actually holds, how many distinct keys appear and where the minimum and maximum sit. COUNT(*) counts rows, while COUNT(column) skips NULLs, so the difference between them is the number of missing values. In a notebook, the Data Profile tab on a result and df.summary() give the same picture for every column at once.
Set operators compare whole result sets. INTERSECT returns the rows that appear in both queries, EXCEPT returns the rows of the first query that are missing from the second, and UNION combines them. They match rows by position, so both queries must return the same number of columns with compatible types. EXCEPT is also a safe way to find keys with no match: NOT IN returns no rows at all when the list it checks contains a NULL.
UNPIVOT does the opposite of PIVOT. It turns several value columns into two columns, one holding the old column name and one holding its value. By default it leaves out NULL values.
COUNT(*) counts every row. Count the amount column itself so rows with a missing amount are left out of amount_values.