0
0
Intro to Computingfundamentals~10 mins

Relational database basics in Intro to Computing - Draw & Build Visually

Choose your learning style9 modes available
Draw This - beginner

Draw a diagram of a simple relational database for a library system. Include two tables: Books and Authors. Show the columns for each table and the relationship between them using primary and foreign keys.

10 minutes
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Grading Criteria
Both Authors and Books tables are drawn
Authors table includes AuthorID as primary key and Name column
Books table includes BookID as primary key, Title column, and AuthorID as foreign key
Relationship between AuthorID in Books and AuthorID in Authors is shown with a connecting line or arrow
Primary keys are clearly marked (e.g., PK)
Foreign keys are clearly marked (e.g., FK)
Solution
  +----------------+       +----------------+
  |    Authors     |       |     Books      |
  +----------------+       +----------------+
  | AuthorID (PK)  |<----->| AuthorID (FK)  |
  | Name           |       | BookID (PK)    |
  +----------------+       | Title          |
                           +----------------+

This diagram shows two tables: Authors and Books.

The Authors table has AuthorID as the primary key, which uniquely identifies each author, and a Name column for the author's name.

The Books table has BookID as its primary key, a Title column for the book's name, and AuthorID as a foreign key linking each book to its author.

The arrow shows the relationship: each book is linked to one author by matching AuthorID values.

This setup helps organize data so you can find all books by an author or find the author of a book easily.

Variations - 2 Challenges
[intermediate] Draw a relational database diagram for a student enrollment system with three tables: Students, Courses, and Enrollments. Show primary keys, foreign keys, and relationships.
[advanced] Draw a relational database diagram for an online store with tables: Customers, Orders, Products, and OrderDetails. Include primary keys, foreign keys, and relationships.