What’s in a database? A database is a system for storing, retrieving, and analyzing data. A database is made up of tables. Tables are made up of rows (entries) and columns (attributes). Each entry has its own unique identifier, usually a number, called a primary key. Primary keys exist in their own column in each table.
Why do primary keys matter? This brings us back to the question of why we need databases. Primary keys ensure that each entry (row) in a database is unique. In comparison, when we consider a database alternative, like Microsoft Excel, each cell is unique. Each cell can be changed independently of any other element in the spreadsheet, including the other cells in its row. Really, primary keys allow for the relations that make up relational databases.
What’s SQL? SQL stands for Structured Query Language. It’s the language used to make databases understandable by computers or other machines.
Well then, what’s MySQL? MySQL is relational database management system (RDBMS) , a software product that understands SQL. DCSI has chosen to explore databases using MySQL because it’s is free, open-source, and widely used.
A database is collection of organized data, made up of tables. Each table represents a real-world entity. A relational database keeps track of relations between information stored in different tables according to their common elements. Tables are organized into rows and columns, where rows represent one instance, or record, of a real-world entity and columns represent characteristics, or attributes, of the record. A single cell in a table represents a field, an intersection between a row and column.
In order to maintain the relations of a relational database, every record in a table has a unique primary key, an unchanging value held in a table’s column.
To put these terms into context, we can consider a fictional Bowdoin database. The database might contain tables for Students, Dorm Rooms, Professors, Classes, and more.
A Student table might contain records of each student at Bowdoin, where each row represents an individual student. Each column in the Student table might represent different attributes of each Student, for example, their unique student ID number, their first name, their last name, the SU box number, and more. Conveniently, since each Bowdoin student has a unique
A good way to think about the relationship between primary keys are foreign keys is to consider
Definitions
- Database: “A system that allows for the efficient retrieval and storage of information” (Ramsay)
- Relational database management system: The
- Domain: “The universe of discourse” (Ramsay)
- Entities: The elements of a domain, represented as rows. Essentially, the major components of categorization.
- Attributes: The categories within an attribute, represented as columns.
- Fields: The intersection of rows and columns.
- Primary key: A unique value held by each individual record in a table. Representationally, it is held in its own column.
- Foreign key: Stores a reference back to the entity.
- Association: An entity that represents an abstracted relationship between two foreign keys.
- Schema: A representation of database design that is understandable to computers/machines. (Ramsay)
- Structured Query Language (SQL): The language used to translate database design into a representation understandable to computers/machines. (Ramsay)
These definitions and analogies are inspired by the Digital Humanities Coursepack by Harvey Quaemen, Jon Bath, and John Yobb and by Stephen Ramsay’s “Databases” in “A Companion to the Digital Humanities”. Thank you!