AQA GCSE Computer Science
Boolean logic, databases and SQL — AQA GCSE Computer Science revision
Free revision notes, key terms, common exam traps and 5 practice questions with answers. About 6 minutes to read.
Boolean logic basics
- Boolean logic works with only two values: True (1) and False (0), used throughout computer hardware and programming conditions.
- AND gives True only if both inputs are True; OR gives True if at least one input is True; NOT reverses a single input's value.
- A truth table lists every possible combination of inputs and the resulting output for a logic gate or expression.
- Logic diagrams use standard symbols to represent AND, OR and NOT gates connected together to build more complex logic circuits.
Combining logical operators
- Combined logical expressions link multiple gates, e.g. (A AND B) OR NOT C, and are evaluated following the order of operations shown by brackets.
- Combined Boolean expressions are used in programming conditions, e.g. IF age >= 18 AND hasID THEN allowPurchase().
- To build a truth table for a combined expression, evaluate each sub-part first (like A AND B), then combine with the remaining operators.
- Boolean logic underpins searching (e.g. search engine queries with AND/OR) as well as circuit design in computer hardware.
Key terms
- Boolean logic
- Logic based only on True and False values, used in circuits and conditions.
- AND gate
- Logic gate that outputs True only when all inputs are True.
- OR gate
- Logic gate that outputs True when at least one input is True.
- NOT gate
- Logic gate that reverses the input value (True to False or vice versa).
- Truth table
- A table showing every input combination and the resulting output for a logic expression.
- Record
- A single row of data in a database table, representing one entity.
Common exam traps
- Confusing AND (needs all conditions true) with OR (needs at least one condition true).
- Forgetting NOT only takes a single input, unlike AND/OR which take two or more.
- Mixing up records (rows) with fields (columns) in a database table.
Practice questions with answers
1. What output does an AND gate give when both inputs are True?
- • True
- • False
- • Undefined
- • Depends on order
Answer: True
AND only outputs True if both inputs are True.
2. What does a NOT gate do to its input?
Answer: It reverses/inverts the input value
NOT flips True to False and False to True.
3. An OR gate outputs True when...
- • Both inputs are True
- • At least one input is True
- • Neither input is True
- • The inputs are equal
Answer: At least one input is True
OR only needs one of its inputs to be True to output True.
4. How many rows are needed in a truth table for two Boolean inputs?
Answer: 4
Two inputs give 2² = 4 possible combinations.
5. What uniquely identifies each record in a database table?
- • Foreign key
- • Primary key
- • Field name
- • Table name
Answer: Primary key
The primary key ensures each record can be uniquely identified.
Keep going in the app
This topic has 55 questions in total, plus flashcards, cram mode and Grade 9 Push challenges.
More free Computer Science revision
- All AQA Computer Science revision pages
- All GCSE Computer Science topics
- AQA Computer Science: Computer systems and CPU architecture
- AQA Computer Science: Memory and storage
- AQA Computer Science: Systems software and utilities
- AQA Computer Science: Networks and network topologies
- AQA Computer Science: Network and cyber security
- AQA Computer Science: Data representation: binary, hex, images and sound
- Every subject on ReviseRush
ReviseRush is an independent educational revision aid. It is not affiliated with, endorsed by or connected to AQA, Edexcel, OCR, WJEC, Pearson or any exam board. All notes and questions are original. Always check content against your official course and specification. No grade outcome is guaranteed.