Tutorial: Databases

This tutorial introduces what databases are and their basic structures

Databases Overview

Data is all around us, from Amazon history purchases to student grades contained inside a gradebook. What to do with all this data depends on context, but all data requires storage. Most websites today use databases, including video streaming, social media, e-commerce, finances, and many others.

What is a Database?

A database is a collection of data stored electronically within a computer system. Within a database, they are typically stored in rows and columns to make processing, managing, updating, and organizing efficient. As mentioned before, most databases use SQL to write and query data. To query data is to take an action on a database such as SELECT, INSERT, UPDATE, or DELETE. Quorum does not use SQL syntax for databases. There are many different types of databases, but for our purposes we will mostly be working with a relational database. Here are brief descriptions of the many different types of databases organizations use [1]:

Types of Databases
Database TypeStructureFunctionality
RelationalTables with columns and rowsProvides the most efficient and flexible way to access structured information
Object-OrientedIn the form of objectsDatabase for object-oriented programming
DistributedTwo or more files located in different machinesTo store data on multiple computers in the same location or scattered on different networks
Data warehouseCentral repository for dataFast query and analysis
NoSQLAllows unstructured and semistructured data to be stored and manipulatedDatabases for more complex web applications
GraphEntities and relationships between entities tailored to very specific scientific, financial, or other functions
Open SourcedSame as SQL / NoSQL databaseSource code is open sourced
Cloudcollection of data, either structured or unstructured, that resides on a private, public, or hybrid cloud computing platformtraditional and database as a service (DBaaS). With DBaaS, administrative tasks and maintenance are performed by a service provider
MultimodelVarious structures combine different types of database models into a single, integrated back end
JSON / DocumentJSON formatsstoring, retrieving, and managing document-oriented information
Self-DrivingML Modelsautomate database tuning, security, backups, updates, and other routine management tasks

In order to run our database, we will need to use database software to help assist in creating, editing, and maintaining our records. Such software allows users to manage and access data easily. In the current version, Quorum supports only MySQL, an open source database implementation. It was designed and optimized for web applications and can run on any platform.

Database Table Structure

Our database structure will be similar to what we see on Google Sheets and Microsoft Excel: a table of rows and columns. The rows of a table represent entities or events in some application domain. The columns of a table represent row attributes. Let's go through an example of our relational database structure. Let us have a model of a group of information regarding students, classes, and professors. Each box is represented by a table:

Student Tables
StudentID LastName FirstName Phone GPA
Course Tables
CourseID Title Semester Units Location Time InstructorID
55461CS 420FA 20213MOP 2031:00 PM23452
52551MUS 115SP 20223TYB 4552:30 PM31341
64513HIST 202FA 20223RCC 1108:30 AM31313
Instructor Tables
InstructorID LastName FirstName Rank Department

These tables contain unique values like student ID, instructor ID, and course ID and we refer to these as keys. The keys in one table can refer to a row in another table such as matching the Instructor key inside of Courses to Instructor ID key inside of Instructor. These so-called "foreign keys" are a common way of tracking data between tables. Note that Quorum only currently supports relational databases.


[1]: Oracle, What is a Database? https://www.oracle.com/database/what-is-database.

Next Tutorial

In the next tutorial, we will discuss MySQL, which describes how to install and set up MySQL.