Bitzu

FC0-U71 ยท Data and databases

Relational databases: tables, keys and relationships

Tables, rows, fields, primary and foreign keys, and relationships between tables.

Key points

  • A relational database stores data in tables.
  • A row (record) is one item, a field (column) is one attribute.
  • A primary key uniquely identifies each row.
  • A foreign key is a field that holds the primary key of a row in another table, which creates the relationship and keeps the data consistent.

Source: https://www.postgresql.org/docs/current/tutorial-fk.html

Practice questions

Single choice

What uniquely identifies each row in a relational table?

  1. The primary key
  2. The report
  3. The query
  4. The backup
Show answer

Answer: A. The primary key

The primary key has a unique value in every row. Reports, queries and backups work with rows but do not identify them.

Select all that apply

Which statements about relational tables are correct?

  1. A row holds the data for one record
  2. A field (column) holds one attribute of every record
  3. Two rows in a table may share the same primary key value
  4. Every table must contain exactly one row
  5. A foreign key must always point to a column in the same table
Show answer

Answer: A. A row holds the data for one record, B. A field (column) holds one attribute of every record

Rows are records and columns are attributes. Primary key values must be unique, tables hold many rows, and a foreign key normally points to another table.

True or false

Two rows in the same table can have the same primary key value as long as other fields differ.

Show answer

Answer: False

A primary key must be unique across the whole table, whatever the other fields contain. Otherwise it could not identify a single row.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More FC0-U71 topics in this module