Intro to PROC SQL¶
A relational database consists of data stored in tables where the columns represent varaibles and the rows represent observations. SQL (structured query language) is a language for navigating and manipulating the database and tables. Today, we will introduce some basic SQL and compare it with DATA and PROC step code to perform the same actions.
The most used SQL statement is the SELECT statement, so we will start with SELECT and its substatements. The basic syntax is as follows:
PROC SQL;
SELECT
FROM
WHERE
GROUP BY columns
HAVING expressions
ORDER BY columns;
QUIT;
Not all of these statements need to be used each time, but they must be used in this order.