Eduqas A-Level Computer Science A500QS
Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs
Variables, Scope, Parameters and Identifiers
Recursion and Modular Programming
Sorting Algorithms
Searching and Shortest-Path Algorithms
Big O Notation and Algorithm Efficiency
Validation, Verification and Testing
Data Compression
Programming Paradigms and Computer Languages
Systems Analysis, Maintenance and Documentation
System Design and Human-Computer Interaction
Software Engineering Tools and Translators
Computing, Society and the Law
Computer Architecture, the Processor and Assembly Language
Input, Output and Secondary Storage
Networks, Protocols and the Internet
Data Transmission and Network Performance
Number Systems and Binary Arithmetic
Data Types, Characters and Floating Point
Files, Records and File Organisation
Databases, Normalisation and Entity Modelling
SQL, Big Data and Distributed Systems
The Operating System and Its Modes
Interrupts, Memory Management and Scheduling
Types of Software System
Data Security, Cryptography and Attack
SQL, Big Data and Distributed Systems
Comparison operators, IN, AND, OR and sub-queries
- 3 things to know
- Component 2
Overview
Six comparison operators used in an SQL WHERE clause, difference between < and <= in a WHERE clause and term sub-query.
What you need to know
Answer each one before you reveal it.
A table Staff holds Salary. Write SQL to list all columns for staff earning more than 30000.
What is the difference between < and <= in a WHERE clause?
Questions from this subtopic
Each one with the model answer underneath.
- 1
List the six comparison operators used in an SQL WHERE clause.
Model answer
The six comparison operators are =, >, >=, <, <= and <>. The last of these tests for inequality.
- 2
A table Staff holds Salary. Write SQL to list all columns for staff earning more than 30000.
Model answer
SELECT * FROM Staff WHERE Salary > 30000. The operator > excludes a salary of exactly 30000.
- 3
What is the difference between < and <= in a WHERE clause?
Model answer
The operator < excludes the stated value. The operator <= returns rows equal to the stated value as well.
- 4
Staff holds Department. Write SQL to list staff in either Sales or Finance using a single operator.
Model answer
SELECT * FROM Staff WHERE Department IN ('Sales', 'Finance'). The IN operator tests membership of a list of values.
- 5
Explain why IN is often preferred to a chain of OR conditions.
Model answer
The IN operator states a list of acceptable values in one short clause. A long chain of OR tests is harder to read and harder to change.
- 6
Staff holds Department and Salary. Write SQL to find staff in Sales earning over 25000.
Model answer
SELECT * FROM Staff WHERE Department = 'Sales' AND Salary > 25000. Each condition must be true for a row to be returned.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in SQL, Big Data and Distributed Systems, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.