From 46a6e012f2856e94a6195872462c577f5baebc52 Mon Sep 17 00:00:00 2001 From: James Foster Date: Thu, 12 Oct 2023 12:03:54 +1100 Subject: [PATCH 1/3] Discuss the concept of relational. --- episodes/00-sql-introduction.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/episodes/00-sql-introduction.md b/episodes/00-sql-introduction.md index aae78860..85e4653c 100644 --- a/episodes/00-sql-introduction.md +++ b/episodes/00-sql-introduction.md @@ -111,6 +111,10 @@ In most cases, each record will have a unique identifier, called a *key*, which is stored as one of its fields. Records may also contain keys that refer to records in other tables, which enables us to combine information from two or more sources. +The idea of *relational* is associated with organizing information across multiple tables in the database. +The *relationships* between tables in a database can be established (or even enforced) in different ways, through the use of *keys* and other constraints. +In many small datasets we have only a few tables and we don't have to think about cross-references within datasets. +The idea of *relational data* becomes more and more important as the amount and complexity of data grows. This provides the motivation for using relational databases: to organize data through related keys. :::::::::::::::::::::::::::::::::::::::::::::::::: From aa4aa2e19ba8f05dad22741f8b38603517c908c8 Mon Sep 17 00:00:00 2001 From: James Foster Date: Thu, 12 Oct 2023 12:22:20 +1100 Subject: [PATCH 2/3] Move explanatory text outside definition. --- episodes/00-sql-introduction.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/episodes/00-sql-introduction.md b/episodes/00-sql-introduction.md index 85e4653c..a4f2c400 100644 --- a/episodes/00-sql-introduction.md +++ b/episodes/00-sql-introduction.md @@ -111,14 +111,15 @@ In most cases, each record will have a unique identifier, called a *key*, which is stored as one of its fields. Records may also contain keys that refer to records in other tables, which enables us to combine information from two or more sources. -The idea of *relational* is associated with organizing information across multiple tables in the database. -The *relationships* between tables in a database can be established (or even enforced) in different ways, through the use of *keys* and other constraints. + +:::::::::::::::::::::::::::::::::::::::::::::::::: + +The *relational* concept is connected with organizing information across multiple tables in the database. +The *relationships* between tables in a database can be established (or even enforced) in different ways, through the use of keys and other constraints. In many small datasets we have only a few tables and we don't have to think about cross-references within datasets. The idea of *relational data* becomes more and more important as the amount and complexity of data grows. This provides the motivation for using relational databases: to organize data through related keys. -:::::::::::::::::::::::::::::::::::::::::::::::::: - ## Databases ### Why use relational databases From c9692ab52e08975c40f6d667556f44f487aef67b Mon Sep 17 00:00:00 2001 From: James Foster Date: Tue, 31 Mar 2026 21:58:38 +1100 Subject: [PATCH 3/3] Update to address comments --- episodes/00-sql-introduction.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/episodes/00-sql-introduction.md b/episodes/00-sql-introduction.md index a4f2c400..fdbe7b4c 100644 --- a/episodes/00-sql-introduction.md +++ b/episodes/00-sql-introduction.md @@ -114,11 +114,6 @@ which enables us to combine information from two or more sources. :::::::::::::::::::::::::::::::::::::::::::::::::: -The *relational* concept is connected with organizing information across multiple tables in the database. -The *relationships* between tables in a database can be established (or even enforced) in different ways, through the use of keys and other constraints. -In many small datasets we have only a few tables and we don't have to think about cross-references within datasets. -The idea of *relational data* becomes more and more important as the amount and complexity of data grows. This provides the motivation for using relational databases: to organize data through related keys. - ## Databases @@ -130,8 +125,14 @@ Using a relational database serves several purposes. - This means there's no risk of accidentally changing data when you analyze it. - If we get new data we can rerun the query. - It's fast, even for large amounts of data. -- It improves quality control of data entry (type constraints and use of forms in MS Access, Filemaker, Oracle Application Express etc.) -- The concepts of relational database querying are core to understanding how to do similar things using programming languages such as R or Python. +- It improves quality control of data entry. + - Restrictions on what is valid data within a table can be enforced in different ways, such as + the use of data types, cross-references and other relationships between tables. +- The concepts used in querying relational databases help us understanding how to do similar things in other programming languages such as R or Python. + +In many small datasets we have only a few tables and we don't have to think about too many cross-references, or *keys*, between tables. +Shared keys between tables becomes increasingly important as the volume and complexity of data grows. +One motivation for using relational databases is being able to organize data using keys that must consistently refer to other tables. ### Database Management Systems @@ -181,8 +182,8 @@ To summarize: - One field per type of information - No redundant information - Split into separate tables with one table per class of information - - Needs an identifier in common between tables – shared column - to - reconnect (known as a *foreign key*). + - Needs an identifier in common between tables – a shared column - to + reconnect the information (known as a *foreign key* constraint). ### Import