Full Marks

GCSE Computer Science · Topic 5

Databases and impacts of technology

Databases and the impacts of technology covers how data is organised, and how technology affects people and the planet.

We will use relational databases, keys and S Q L queries.

Then we look at data protection and computer misuse law, copyright and licences, privacy, and environmental impacts.

In this topic

  1. 5.1Relational databases and SQLFree below · 13 questions
  2. 5.2Ethical, legal and environmental impactsOpen in Full Marks · 16 questions

5.1 · Free notes

Relational databases and SQL

Diagram: Relational databases and SQL

Key points

In more detail

Practice

Relational databases and SQL: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. Which SQL command retrieves data?

  1. INSERT
  2. UPDATE
  3. SELECT
  4. DELETE
Show answer

C: SELECT. SELECT ... FROM ... WHERE ... is the standard query form.

2. What is a primary key?

  1. A password for the database
  2. A field that uniquely identifies each record
  3. The first field in a table
  4. A link to a website
Show answer

B: A field that uniquely identifies each record. No two records may share the same primary key value.

3. What does a foreign key do?

  1. Encrypts a table
  2. Links a record to the primary key of another table
  3. Sorts records
  4. Deletes a record
Show answer

B: Links a record to the primary key of another table. This creates relationships between tables.

4. Which SQL keyword filters records?

  1. ORDER BY
  2. WHERE
  3. FROM
  4. SELECT
Show answer

B: WHERE. WHERE applies a condition to select matching records.

5. What is an advantage of a relational database over a flat file?

  1. It stores less data
  2. It reduces data duplication and inconsistency
  3. It never needs keys
  4. It cannot be queried
Show answer

B: It reduces data duplication and inconsistency. Data is stored once and linked rather than repeated.

6. Which SQL command adds a new record?

  1. SELECT
  2. INSERT INTO
  3. UPDATE
  4. WHERE
Show answer

B: INSERT INTO. INSERT INTO adds rows to a table.

7. What does ORDER BY do in SQL?

  1. Filters records
  2. Sorts the results
  3. Deletes records
  4. Creates a table
Show answer

B: Sorts the results. It can sort ascending or descending.

8. In a relational database, what is a record?

  1. A column
  2. A row containing data about one entity
  3. A table
  4. A key
Show answer

B: A row containing data about one entity. Fields are the columns within each record.

9. A table named pupils has fields name, year and score. Which query lists the names of pupils with a score above 70, from highest score to lowest?

  1. SELECT name FROM pupils ORDER BY score DESC WHERE score > 70
  2. SELECT name FROM pupils WHERE score < 70 ORDER BY score ASC
  3. SELECT * WHERE score > 70 FROM pupils ORDER BY score
  4. SELECT name FROM pupils WHERE score > 70 ORDER BY score DESC
Show answer

D: SELECT name FROM pupils WHERE score > 70 ORDER BY score DESC. The order is SELECT, FROM, WHERE, then ORDER BY. DESC sorts highest first, and > 70 selects scores above 70. The other queries have the clauses in the wrong order or use the wrong comparison or sort direction.

10. A shop's Orders table has OrderID, CustomerID and Date. Customers has CustomerID, Name and Address. Which statement about CustomerID is correct?

  1. It is a primary key in both tables so they cannot be linked
  2. It is a primary key in Orders and a foreign key in Customers
  3. It is a foreign key in Orders and the primary key in Customers
  4. It is a foreign key in both tables and so uniquely identifies no records
Show answer

C: It is a foreign key in Orders and the primary key in Customers. Each customer appears once in Customers, so CustomerID is its primary key. In Orders a customer can appear many times, so CustomerID links to Customers and is a foreign key.

Keep going in Full Marks

Full Marks has 13 questions on Relational databases and SQL (3 more than here), set out in practice levels. You also get notes and 3D models for all 2 subtopics of Databases and impacts of technology, plus games, timed exams and past papers.

On your exam board

All GCSE Computer Science topics