ABSTRACT

This chapter introduces readers to SQL. It explains terminology (such as tables and queries), how to open and browse a database, how to examine a table’s structure and how to query a table to retrieve specific columns of specific records in a specific order. We also cover how to summarize data with GROUP BY queries and crosstab queries, which are similar to Pivot Tables. It explains how to join tables that share a variable, such as multiple years of Census data. We also emphasize the importance of shoe-leather reporting to verify matches. This chapter covers both “inner” joins and “outer” joins, nested queries (such as how to find records in Table A that are not in Table B) and how to improve joins by splitting, combining and manipulating the character strings in key fields. The exercises in the chapter include working with Census data on incomes and geographic areas.