3. Our Data
Tip
Keep this page open in a second tab while you're getting started. It may be helpful to refer to as you're writing your first queries.For this course, I have built a small demo database for an organization named Save the Birds and Trees. This is a fake organization and the data used in this course is all algorithmically generated and fake as well (including names, addresses, and email addresses). Throughout this course, you will be querying their data to gain practical experience writing SQL in a fundraising context. Before we get going, I wanted to briefly describe the structure of our data, the database schema.
Tables
Our database has five tables:
- accounts - ID numbers and names for donors.
- transactions - information about gifts given by donors
- source_codes - information about campaigns and source codes
- addresses - address information for donors
- emails - email address information for donors
This is a simple data model; your database likely contains tens or hundreds of tables. That said, your database probably contains nearly direct analogues of these five tables and the concepts you learn in this course will apply to other tables you may need to access in your work.
Schema and Relationships
The database diagram below shows all five of our tables with each of their column names and data types, along with the relationships between them. Bolded column names (with the key icon) indicate each table's primary key. The link icon indicates foreign keys. The lines connecting the primary and foreign keys of different tables show you how the tables are related to one another.
Sample Data
The tables below show ten sample records from each of our five tables so you can get an idea of what this data looks like.
Accounts table
Transactions table
Source_Codes table
Addresses table
Emails table
You may want to return to this page from time to time to refresh your memory about the database structure.