Relational Databases
Databases and Database Management Systems (DBMS)

Database Models

  • Relational: tables & relationships
  • Hierarchical: tree structures
  • Object Oriented: objects & properties
  • Document: JSON like documents
  • Key-value: key, value pairs
  • Network: interconnected entities
  • Graph: data points & relationships
What are Relational Databases (RDBs)?

Relational databases provides a structured way to store, manage, and access large amounts of data. RDBs excel at organizing data into related tables, allowing for efficient retrieval and analysis.

Benefits:


id,name,email,course_id,course
1,Jon,jb@mail.com,GEO101,Intro to Geology
1,Jon,jb@mail.com,MAT200,College Math II
2,Alice,abell@u.edu,BIO250,Intermediate Bio
2,Alice,abell@u.edu,GEO101,Intro to Geology
2,Alice,abell@u.edu,MAT200,College Math II
3,Bob,bob@work.com,BIO250,Intermediate Bio
4,Maria,maria@u2.edu,CSE100,Intro to Python
        

CSV file

Enrollments

student_id course_id
1 GEO101
1 MAT200
2 BIO250
2 GEO101
2 MAT200
3 BIO250
4 CSE100

Students

id name email
1 Jon jb@mail.com
2 Alice abell@u.edu
3 Bob bob@work.com
4 Maria maria@u2.edu

DB Tables

Courses

id course
GEO101 Intro to Geology
MAT200 College Math II
BIO250 Intermediate Bio
CSE200 Intro to Python

Conceptual Model

Relational Database Terms and Definitions

Entity-Relationship Diagram (ERD)

An ERD is a graphical representation of a database schema that shows the entities (tables) within a database, their attributes (columns), and the relationships between them.

What is Structured Query Language (SQL)?

Structured Query Language is the language used to communicate with RDBs. It allows us to perform a wide range of tasks, including:

Benefits:

What courses did Alice enroll in?


        SELECT course_id from Enrollments WHERE student_id = 2
    

The SQL query above returns BIO250, GEO101, MAT200