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
Inserting, updating, deleting and joining data
- 3 things to know
- Component 2
Overview
Danger of an UPDATE statement written with no WHERE clause and term join in SQL.
What you need to know
Answer each one before you reveal it.
Why is it safer to name the columns in an INSERT INTO statement?
Pupil holds PupilID, Surname and Year. Write SQL that inserts only identifier 300 and surname Rees by naming the columns.
Questions from this subtopic
Each one with the model answer underneath.
- 1
Pupil holds PupilID, Surname and Year in that order. Write SQL to add pupil 214, surname Owen, in year 12.
Model answer
INSERT INTO Pupil VALUES (214, 'Owen', 12). The values are listed in the same order as the columns of the table.
- 2
Why is it safer to name the columns in an INSERT INTO statement?
Model answer
Named columns let the database system match each value to the right column. A later change to the table layout then cannot silently misplace the data.
- 3
Pupil holds PupilID, Surname and Year. Write SQL that inserts only identifier 300 and surname Rees by naming the columns.
Model answer
INSERT INTO Pupil (PupilID, Surname) VALUES (300, 'Rees'). Any column not named is left empty or takes its default value.
- 4
What happens when an INSERT INTO statement omits a value for a NOT NULL column?
Model answer
The database system rejects the insertion and reports an error. The row is not added to the table.
- 5
Pupil holds PupilID and Year. Write SQL to move pupil 214 into year 13.
Model answer
UPDATE Pupil SET Year = 13 WHERE PupilID = 214. The WHERE clause limits the change to that single row.
- 6
What is the danger of an UPDATE statement written with no WHERE clause?
Model answer
An UPDATE with no WHERE clause changes the named column in every row of the table. The original values are lost.
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.