AQA Comp Sci WB2 Answers Ms
AQA Comp Sci WB2 Answers Ms
AQA AS/A-level
Computer Science 2
Fundamentals of data
representation
Number systems, number bases and units of
information
1 a i 7 or 0 (1)
iv 3 or π (1)
v –3 (1) (ℝ is the set of real numbers, including all natural numbers, integers, rational
numbers and irrational numbers)
Easier to understand/remember.
NB: Don’t allow 'takes up less space' – not clear that this refers to display space, hexadecimal
does not save storage space.
3 a 8 (1)
c 256 (1)
4 a 1 byte (1)
d 5 300 000 bytes OR 5.3 million bytes OR 5.3 109 bytes (1)
a 0 1 0 1
1 0 1 0 +
1 1 1 1 (1)
b 1 0 1 1 0 1 0 1
0 1 1 1 1 1 0 1 +
01 01 11 11 01 0 11 0 (1 mark per correct nibble – ignore a ninth ‘1’ on the far left)
7 0 0 1 0 0 1 1 0 *
0 0 0 0 0 0 1 1
Fundamentals of data representation
1001 . 0110
9.375 OR 9 + 0.25 + 0.125 OR
Use of two's complement: 0011 0011 (no marks for this step)
NB: Exactly 8 bits for mantissa/4 bits for exponent required for final mark.
NB: Exactly 8 bits for mantissa and 4 bits for exponent required for final mark.
To allow for including an increased range of non-alphabetic symbols (e.g. divide sign, sigma
sign, copyright sign, emojis). (1)
b Rejected (1)
Because the number of 1s is odd (and the system is using even parity). (1)
c If two (or more) errors occur then the parity check may be passed. (1)
15 a 0110 (1)
b Each bit is transmitted multiple times OR 3 times OR 5 times OR any odd number greater
than 2. (1)
The receiver checks if all the bits are the same each time. (1)
If they are not then it assumes the value received the most times is correct. (1)
c A calculation is performed using the bits that are to be sent OR a (single-digit) value is
produced by an algorithm. (1)
When received, the same algorithm is used to calculate the check digit. (1)
If the digits match then the transmission is accepted OR if the digits don’t match then the
transmission is rejected. (1)
Fundamentals of data representation
b 256 or 28 (1)
c 6 million pixels * 8 bits per pixel ÷ 8 bits per byte (1 mark for any two parts applied correctly)
Pixel dimensions OR image height OR image width OR colour depth OR colour palette OR
date the image was created OR date last modified OR date last opened OR location (in the
case of photographs) OR file type OR application used to edit OR camera used OR camera
settings OR facial recognition data (tagged person) OR any other reasonable answer.
b 420 px * 120 px * 4 bits per pixel ÷ 8 bits per byte (1, any three parts applied correctly)
Coordinates OR edge thickness OR edge colour OR fill colour OR edge style OR fill style OR
object type.
Nyquist’s theorem OR the minimum sample rate should be at least double the maximum
frequency to be recorded. (1)
b 100 000 samples per second * 30 seconds * 12 bits per sample ÷ 8 bits per byte (1 mark for
any three correct elements)
21 a Repeated values can be stated once (1) along with the number of times they are repeated (1)
b Repeated patterns can be stored in a dictionary (1) and referred to by their index (1)
e.g. CGT : 1, AA: 2, Sequence: 12121 (1) (Allow any sensible sequence.)
Encryption
22 a HOHSKDQW (1)
b APRIL (1)
c FGGF (1)
d FGGF (1)
Point: brute force (1) Explain: try every possible combination as there are only 25. (1)
Point: frequency distribution (1) Explain: assume the most common letters in the ciphertext
relate to the most common letters in plaintext, typically ‘e', ‘t’, ‘a’. (1)
23 a 0100 0011
b 0100 0010 0100 0001 0100 0100 (1 mark for writing out BAD in ASCII)
1010 0111 0101 1011 1001 0110 (1 mark for laying out key correctly)
1110 0101 0001 1010 1101 0010 (1 mark for applying XOR)
d The same key is used to encrypt and decrypt the ciphertext/plaintext. (1)
Fundamentals of data representation
Exam-style questions
24 a (1 mark per correct row)
Number ℤ ℝ ℚ ℕ Irrational
3.7
–9
4
π
b To denote the order of a set of values OR to denote the position or rank of each item. (1)
27 a 172 (1)
8 + 2 + ½ + ¼ (conversion process)
28 a 0 0101.01 (1) (Move decimal point by 5 for the value of the exponent. Allow/ignore leading
zeros.)
4+1+¼
b In a normalised floating point number the first two bits/most significant bits will be different. (1)
So more characters are available OR can send messages that use characters beyond the
basic Roman alphabet OR can send messages in other languages OR can send messages
that use emojis. (1)
c 0100 0001 0100 0010 0100 0011 (1 mark for correctly listing ASCII codes)
0101 1010 0010 0110 0111 1011 (1 mark for correctly listing the key)
0001 1011 0110 0100 0011 1000 (1 mark for correctly applying XOR)
d Indicative response
Brute force
The Caesar cipher uses one common key for all characters. It is trivially easy to try all 25
combinations of keys for a Caesar cipher and there are very few possible double-matches
(where one ciphertext word could be converted to more than one plaintext word).
It is impossible to use a brute force approach to crack the Vernam cipher as each character
uses a different key.
Frequency analysis
With the Caesar cipher, it is likely that the most commonly found characters in the ciphertext
message will match the most commonly found characters in the language (e.g. ‘e’, ‘a’, ‘t’ in
English). The letter 'q' in English is almost always followed by the letter ‘u’. As the same key is
used throughout, once a match has been made for some letters, the entire message will be
compromised.
With the Vernam cipher, each character is encrypted using a different key and therefore
frequency analysis is unhelpful. Even if one or two characters could be cracked with
confidence, this would give no clue to the remainder of the message.
truly random
then the encryption is mathematically secure and cannot be decrypted even given infinite time
and infinite ciphertext, whereas this is not true of the Caesar cipher.
24 million × 24 bits per pixel ÷ 8 bits per byte = 72 million bytes (1)
= 72 MB (1)
Colour palette
Camera settings
Geo-location settings.
Using fewer pixels the file size can be reduced, but without lowering the quality so much that
it becomes intrusive. (1)
By reducing the number of colours fewer bits will be needed to store the colour of each pixel.
(1)
e A string of identically coloured pixels (1) could be stored by recording the number of pixels
and then the colour. (1)
(Allow demonstration by example, e.g. if there were 10 identical black pixels in row then
storing ’10 black' is much shorter than storing black 10 times.)
Fundamentals of computer systems
Fundamentals of computer
systems
Hardware and software
1 a To hide the complexity of the hardware from the user. (1)
Management/allocation of processors
Management/allocation of memory/RAM
Power/battery management
Interrupt handling.
2 a i Translator (1)
NB: An IDE is designed to allow the user to write, edit and run program code; it is not software
designed to help the computer system run.
Mark in pairs, 1 mark for identification and 1 mark for explanation. Max. two pieces of
software: (4)
e.g.
Device driver; used to allow the operating system to communicate with an external
device/peripheral (allow by example, e.g. printer).
System monitor; used to record/display data relating to the system such as memory usage,
processor usage, temperature, etc.
Difference: the machine code program will be represented in binary. The assembly language
program will be represented using characters/mnemonics OR the assembly language
program will be stored using ASCII/Unicode. (1)
NB: Refuse ‘stored’ instead of ‘represented’ but allow ‘written’. All data stored in a computer
system is ultimately stored as binary. Allow ‘stored’ in reference to ASCII/Unicode as the
distinction is clear.
b Assembler (1)
It is easier for developers to write OR read OR debug OR maintain code using high-level
languages.
Comments can be added to high-level code to make the code easier to understand/maintain.
b Interpreter (1)
This allows a high-level language to be compiled into a format that will run on any platform.
(1)
Fundamentals of computer systems
As long as the virtual machine is present (e.g. Java and the Java Virtual Machine (JVM)) (1)
the bytecode is then compiled by the virtual machine at (or just before) runtime into machine
code for that specific platform. (1)
This gives the appearance that compiling the program produces platform-specific machine
code, while actually allowing the compiled bytecode to be executed quickly across multiple
platforms. (1)
A B P
0 0 0
0 1 1
1 0 1
1 1 1
A and B show four unique combinations (any order) (1)
A B P
0 0 1
0 1 1
1 0 1
1 1 0
A and B show four unique combinations (any order) (1)
(1)
(Allow buffer.)
7
Fundamentals of computer systems
A B C D E
0 0 0 0 0
0 1 1 0 1
1 1 1 1 1
1 0 0 0 0
8 NB: For Boolean algebra questions, examiners typically mark until they see the FIRST error.
Steps CAN be combined and marks should be awarded where the working is clear even if two
steps have occurred at the same time BUT it is much better to show EVERY step.
a A (1)
b 0 (1)
0 + 1 = 1 (1)
= P ⊕ Q (1)
= a.b (1)
= x . y (1)
(Allow x + y )
( ( x . y ) . x ) . y=( ( x . y ) . x ) + y
= (( x + y ) . x )+ y
= ( x .x+x. y )+ y
= 0+ x . y+ y
= x . y+ y
= x.y. y
= (x + y ). y
= x . y+ y . y
= x.y
b Clock/trigger/enable (1)
Data (1)
Used to accept data OR allow data input OR change the internal state of the D-type flip-flop.
(1)
NB: The model of the D-type flip-flop used by AQA (and some other exam boards) only has two
inputs: data and clock, without set or reset. Some resources may include all four.
Exam-style questions
10 a Software designed to manage the system OR allow the system to run OR manage the
computer hardware (1)
Utility (program) (1) a program used to maintain/optimise a computer system. (1) Any suitable
example, e.g. anti-malware, firewall, disk defragmenter, disk clean up, system monitor,
backup manager, etc. (1)
Library (program) (1) a resource OR collection of program code that can be accessed by
other programs. (1) Any suitable example, e.g. math library, random number library, GUI
library, etc. (1)
Translator (1) used to translate high-level language OR assembly language source code into
machine code (for execution). (1) Example: assembler OR compiler OR interpreter. (1)
c Role of the OS: to hide the complexity of the hardware from the user. (1)
Interrupt handling
11 a Need:
One HLL instruction may be translated into several machine code instructions. (1)
Each instruction is then executed by the process (in the case of an interpreter) OR stored in
an object code/machine code/bytecode file (in the case of a compiler). (1)
b Any two from: (4) (Mark in pairs: 1 mark for identification, 1 mark for expansion)
Less likely to make mistakes (1) as machine code looks very similar OR counter argument for
HLL. (1)
Fundamentals of computer systems
Logic in HLL is easier to follow (1) due to the use of structured statements OR data structures
OR comments. (1)
Can be run on different platforms (1) as machine code is specific to one instruction set OR
platform. (1)
c Indicative response
The source code can be made available so that others can view/edit/improve/maintain the
algorithms/program code. The program can be updated more easily as the form and structure
of the data may change over time.
The program will not need to be translated separately for each platform before it is shared
and the program will work on any platform for which an interpreter is available.
Debugging will be easier as the program will halt at the exact point in the program where an
error is detected.
Some programming languages are restricted to either a compiler or an interpreter. Paul may
have chosen a programming language that does not have a compiler available.
b 1 (1)
a . b (1)
Fundamentals of computer systems
e LHS RHS
(a . a+ b . a) (b . a+ b . b)
(0+ b . a) (b . a+ 0)
b.a b.a
b+ a b+ a
b+ a b+ a
1 mark for expanding brackets
13 a (4)
(Allow AND between A OR B and C, then the second AND between this and NOT D.)
b X =( A + B ) .C . D (2)
1 mark for A + B
1 mark for C . D
14 a
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
c Used to add two binary digits OR two single-bit binary numbers (1) and output the result as a
two-digit binary number OR output the sum and carry. (1)
NB: Refuse ‘binary numbers’ unless explicitly stated that they are single-bit.
d By using two half-adders and an OR gate OR XOR gate (1) two-digit/n-digit/numbers of more
than one digit can be added together. (1)
15
1 mark for evidence of following the circuit diagram and not simply adding the three binary
numbers
Order of columns not important. Not all three intermediary columns required to be used.
Fundamentals of computer organisation and
architecture
Fundamentals of computer
organisation and
architecture
Internal hardware components
The stored program concept, structure of the
processor and its components
External hardware devices
1 a
1 mark for each correct description (match to the step, not the step number)
(Max. 8 in total)
b Both steps use separate registers/neither step directly impacts the data required for the other.
(1)
d In von Neumann architecture, both programs and data use the same main memory OR data
bus. (1)
In Harvard architecture, programs are stored in one block of memory and data in another OR
programs and data are fetched using different buses. (1)
3 a To save data/programs (1) so that they can be accessed at a later time. (1)
e Indicative response
R2 0100 1001
1 mark for updating correct register
b Immediate (1)
e Design
Identifying that a Logical Shift Right, followed by Logical Shift Left are required to perform the
integer division and multiplication. (1)
Identifying that a compare and branch are required in place of the IF statement. (1)
Programming
Performing comparison of the result and the original value, with a suitable branch. (1)
Using a branch or HALT to skip over the second MOV instructions. (1)
Example solution
BEQ same
MOV R3, #0
HALT OR B end
Fundamentals of computer organisation and
architecture
Label same
MOV R3, #1
Label end
HALT
Exam-style questions
5 a
Registers Memory
R0 R1 R2 R3 600 601 602 603 604
0 3 601 12 3 12 9 14 11
12 2 602 9
21 1 603 14
35 0 604 35
R1 should count down from 3 to 0 (1)
R3 should store the value in the corresponding memory address from R2 (1)
b Repeatedly adds n numbers, where n is the value stored in memory address 600 (1) and
stores the answer in the next memory address. (1)
c Any four from: (8) (Mark in pairs: 1 mark for identification, 1 mark for expansion)
Increased cache size (1) so that more of the most frequently used programs/data can be
made available for fast access. (1)
Increased number of cores (1) so that more instructions can be executed simultaneously. (1)
Increased clock speed (1) so that more instructions can be executed in the same amount of
time. (1)
Wider data bus (1) for greater throughput of data into the processor OR reduces bottlenecks
when retrieving data. (1)
Larger word length (1) for larger values OR values with greater precision can be processed in
fewer steps. (1)
Wider address bus (1) allows for larger allocation of main memory/RAM (which reduces the
need for slower virtual memory). (1)
6 a Lower cost per unit of storage for magnetic hard drives OR higher cost per unit for SSDs. (1)
Fundamentals of computer organisation and
architecture
Larger capacity available for magnetic hard drives OR smaller capacities typical for SSDs. (1)
b Indicative response
DVD/Optical
Advantages:
Disadvantages:
Slow to read/write
Easily scratched/damaged
Advantages:
Resilient/difficult to damage
Disadvantages:
Advantages:
Disadvantages:
Large/heavy/expensive to post
(Reward any reasonable conclusion in favour of a suitable medium except magnetic hard drive.)
Student doesn’t necessarily own the intellectual property rights/copyright permissions to share the
resources.
If the student fails to gain permission from the relevant copyright holders they will be in breach of
the law.
The users of the service may still have access to the file after the 24 hours if they have made a
local copy.
Possibility to include DRM as part of the file in order to prevent access after the 24 hours.
The student has a legal responsibility to ensure that any personal data is held securely.
The data must not be transferred to another country without similar regulation.
The student may need to comply with a request for access to data from authorities.
(Refuse reference to Computer Misuse Act as this is aimed at those who would gain unauthorised
access and not at the student hosting the site.)
Max. 2 laws discussed (ignore any discussion after the first two laws)
Exam-style questions
Consequences of uses for computing
2 Indicative response
Staff access these details remotely OR without being aware of the exact location of the data.
Appropriate steps
Data stored somewhere other than on the web server – transferred to a secure computer that is
not running a web server as soon as it is entered.
Data stored in a folder that is not publicly accessible OR outside the public-facing folders in the
web server’s folder structure.
Permissions used so that where the data is stored on the web server, only members of a specific
group of users would be able to access the data.
(Refuse ‘password protected’ as this is vague and, alone, would not provide sufficient levels of
security.)
What are the possible consequences for users who have had their personal data compromised?
Who designed/maintained the online system – was it in-house or contracted out, and how much of
the blame should fall with each party?
Was the Data Protection Act breached? Legislation says that data should be held securely, but
there are no explicit rules about exactly what this means.
Did the person who accessed the data break the Computer Misuse Act?
What legal penalties should apply to the person who accessed the data?
What legal recourse is there for the users whose details were accessed?
Lessons learned
Improved training for developers in terms of the legal requirements of data security.
Consequences of uses for computing
Need for scrutiny of the system/penetration testing to ensure that data is secure.
Fundamentals of
communication and
networking
Topic 1 Communication
1 a A set of rules OR standards (to allow for data transmission) (1)
In serial transmission data is sent consecutively/one after another (through a single line). (1)
The longer distance needed for peripheral devices makes interference OR crosstalk more
likely.
b A wider bandwidth means that each signal can contain more than 1 bit OR can be used to
represent more than two possible values (1) meaning that the bit rate can be higher than the baud
rate. (1)
Topic 2 Networking
3 a Star (1)
By responding to requests
d Data would not be centralised OR separate copies would be held on each workstation (1)
so a workstation may not hold the current/correct version of a file. (1)
Changes made on one workstation may not be reflected on the other workstations. (1)
More customers may visit (1) because of access to public WiFi. (1)
Computers OR staff can be moved more freely (1) allowing for more flexible working practices
(allow any sensible example). (1)
Café can charge customers for WiFi (1) increasing profits. (1)
Anyone with a wireless network adapter can receive the transmission/data/signal. (1)
d Mark in pairs:
(Allow ‘password’ in place of ‘key’ in order to decrypt the signal, but for the identification mark
it must be clear that the data is encrypted. Stating ‘password protected’ is not enough.)
If another transmission is detected at the same time the message was sent (1), wait a
random amount of time. (1)
f Benefits: (2)
In the case of collision, RTS is a small message to resend (1) instead of having to resend the
whole message (1) especially on a busy network. (1)
Fundamentals of communication and networking
Drawbacks: (2)
Increased latency OR more data needs to be transmitted overall OR delay while performing
the RTS/CTS protocol (1) especially on a quiet network (where collisions are less likely). (1)
The internet
5 a Any four from: (4)
Sender’s IP address
Receiver’s IP address
Packet number
Length
Priority
c A gateway is used to allow data to be placed onto/accepted from the internet. (1)
d Easier to remember OR recognise OR provides information to the user (e.g. name of the
organisation). (1)
A request is made to the DNS server to find the IP address for a given domain name.
DNS server/Domain Name Server holds a table of domain names and corresponding IP
addresses.
Fundamentals of communication and networking
f The DNS result is stored in the user’s cache (because it was used recently) OR stored on the
user’s computer (in the hosts file). (1)
6 a Symmetric encryption uses the same key to encrypt and decrypt the data OR asymmetric
encryption uses different keys to encrypt and decrypt the data. (1)
Because the encryption is asymmetric, no other users can decrypt the message.
Sender
The hash OR a message is encrypted using the sender’s private key. (1)
Receiver
d To prove that a user’s public key is authentic (1) by encrypting the public key using the
certificate authority’s private key (1) and decrypting it using the certificate authority’s public
key. (1)
ii Code that exploits a weakness in the network (as opposed to attaching itself to a file) (1)
Fundamentals of communication and networking
iii A program that tricks the user into running it OR a program that pretends to do one thing
but actually does something else (1)
Transport: (1) used to split the data into packets OR packet number OR port number (1)
Network OR internet: (1) used to address each packet OR sender’s IP address OR receiver’s
IP address (1)
Link: (1) used to put the packet onto the transmission medium OR sender’s MAC address OR
receiver’s MAC address (1)
c Link (1)
d So that one layer can be rewritten OR changed OR modified (1) without affecting the other
layers. (1)
b i 80 (1)
ii 20 OR 21 (1)
iv 22 (1)
v 443 (1)
Server may not be in the same location as the administrator (1) so saves on travel time OR
having to physically relocate the server. (1)
No need for a keyboard and mouse OR input and output devices for the server (1) saving
money. (1)
b i e.g. 192.168.0.1 (1) (any value between 192.168.0.0 and 192.168.0.255 except for
192.168.0.2 or 192.168.0.3)
ii e.g. 192.168.0.4 (1) (any value between 192.168.0.0 and 192.168.0.255 except for
192.168.0.2, 192.168.0.3 or the answer to part (i))
iii e.g. 192.168.1.2 (1) (any value between 192.168.1.0 and 192.168.1.255 except for
192.168.1.1)
iv e.g. 192.168.2.2 (1) (any value between 192.168.1.0 and 192.168.1.255 except for
192.168.2.1)
d When a request is sent from a workstation within the network the return IP address will be
non-routable OR private. (1)
e A gateway OR router at the edge of the network (1) will provide a return address from the
pool of allowable routable IP addresses OR from the 245 available IP addresses (1) so that
when the response is received it can be returned to the correct device. (1)
(Max. 2)
b C – Create
R – Retrieve
U – Update
D – Delete
2 correct (1)
d JSON (1)
XML (1)
e JSON (1)
Fundamentals of communication and networking
Exam-style questions
11 a Advantage: Can send more data simultaneously OR can use one line for
synchronisation/timing. (1)
SSID hiding (1) so that visitors will not be able to see the network. (1)
MAC address filtering OR MAC address whitelisting (1) so that only authorised devices will
be able to connect to the network. (1)
WPA OR WPA2 OR encryption (1) so that unauthorised users will be unable to read any of
the data that is transmitted. (1)
c 172.16.0.263 (1)
d (2)
Useful when there are potentially more devices that could access the network than there are
devices available. (1)
Drawback is that it can be more difficult to trace an action back to one user/device. (1)
b Easier to remember than an IP address OR tells the user something about the organisation or
nature of the website. (1)
Fundamentals of communication and networking
c Internet registries manage the sale of domain names (1) so that the same domain name
cannot be linked to more than one IP address OR customer. (1)
d Update (1)
g Indicative response
Hardware
The existing thick-client network will be made of standard PCs, each running the majority of
tasks locally. A thin-client network would require a central server (or servers, depending on
the scale of the network) with cheaper ‘thin’ or ‘dumb’ terminals, each with very little individual
processing power. The central server may be very expensive and would need to be
significantly more powerful than a standard thick-client machine. Each terminal must be
connected to the network at all times or will lose access to the vast majority of its processing
capabilities as well as access to data storage.
Capability
The existing thick-client network will likely afford staff adequate processing power for the vast
majority of office-based tasks and is probably not using its full processing capabilities for the
vast majority of the time. A well-designed thin-client network would cope very well with most
office-based activities and staff would be unlikely to notice a significant difference in
processing capabilities. Graphics-intensive tasks such as producing digital animation, video
editing, gaming and detailed image editing is more likely to be problematic, partly due to the
requirement for fast data connections and partly due to the remote nature of the server and
the latency in waiting for a response to processing requests. It may be wise to maintain a
small number of thick clients specifically for any graphics or processor intensive tasks.
Sustainability
Once configured, a thin-client network should be easier to sustain as software updates and
the installation of new software only needs to be carried out on the central server. Adding new
thin clients will be quicker, easier and cheaper than adding new thick clients to the network.
Hardware upgrades to the server are likely to be less frequent, but more expensive when they
do occur. Overall the total cost of ownership for a thin-client network may be lower if it is
properly specified when first installed and depending on the nature of the tasks and the
number of machines that are replaced.
Fundamentals of databases
Conceptual data models, relational databases,
database design and normalisation
1 a Channel OR Programme OR Owner (1) (Refuse if any other detail (e.g. attributes) included.)
c ChannelID (1)
(Longer, written answers are more likely than the shorter format used here and are perfectly
acceptable.)
e (2)
2 a Two or more attributes/fields (1) used together to uniquely identify a record (1)
Used here because it is possible for two different tenants to have the same first name or
same last name (1)
NB: It is still possible for two different tenants to have the same first AND last names, so this does
not represent the most ideal solution.
Purpose of Postcode relation is clear (can be inferred from the attributes used even if not
exactly correct) (1)
DPT (don’t penalise twice) for this within the same question part (e.g. part (a)).
Ignore case.
Ignore a FINAL trailing semicolon (;) at the end of any SQL statement.
YearGroup INT
OR
Defining StudentID with a valid data type and as primary key (1)
Two other valid fields with sensible data types and lengths (if included) (1)
All fields with sensible data types and lengths and no additional fields (1)
Valid data types for YearGroup: INT, SMALLINT, MEDIUMINT, INTEGER, any text type
Valid data types for text fields: VARCHAR, CHAR, NCHAR, NVARCHAR, VARCHAR2,
NVARCHAR2, TEXT, LONGTEXT, NTEXT, TINYTEXT, MEDIUMTEXT
OR
Analysis (3)
Fundamentals of databases
Identifying the foreign key relationship as part of the WHERE clause (1)
SQL (2)
Correct SQL syntax in 2 or 3 of the four SQL clauses (SELECT, FROM, WHERE, AND) (1)
ORDER BY LastName
Analysis (4)
Identifying one foreign key relationship as part of the WHERE clause (1)
SQL (3)
Correct SQL syntax in 2 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER BY)
(1)
Correct SQL syntax in 3 or 4 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER
BY) (1)
Accept answers that include the Student table, even though this is not necessary.
Accept other forms of selecting a valid date, e.g. Date >= 1/4/18 AND Date <= 30/4/18, use of
DATEPART, MONTH or LIKE, as long as they are valid.
Refuse overly simplistic attempts to identify the date, e.g. Date = “May 2018” Q1.
Fundamentals of databases
Big Data
5 a Volume: data that is too big to fit on a single server (1)
NB: The 3Vs are excellent to aid recall but answer MUST go into more detail.
Data is immutable OR stateless OR one part of a program cannot change the data and
therefore impact another part of the program.
Order of execution is less important/not as strictly defined (due to the immutable nature of the
data, which makes it easier to process the data in a distributed system).
Exam-style questions
NB: For all questions in this topic:
DPT (don’t punish twice) for this within the same question part (e.g. part (a)).
Ignore case.
BookingID INT
Day VARCHAR(8)
StartTime TIME
OR
Defining BookingID with a valid data type and as primary key (1)
Defining ActName with a valid data type and as a foreign key, with correct reference (1)
Defining StageName with a valid data type and as a foreign key, with correct reference (1)
Two other valid fields with sensible data types and lengths (if included) (1)
All fields with sensible data types and lengths and no additional fields (1)
Valid data types for BookingID: INT, SMALLINT, MEDIUMINT, INTEGER, any text type
Valid data types for text fields: VARCHAR, CHAR, NCHAR, NVARCHAR, VARCHAR2,
NVARCHAR2, TEXT, LONGTEXT, NTEXT, TINYTEXT, MEDIUMTEXT
Day: text field, but also allow DATE, DATETIME, DATETIME2, DATE/TIME, SMALLDATETIME
e (2)
Fundamentals of databases
OR
SORT BY Day
Analysis (4)
Identifying the foreign key relationships as part of the WHERE clause (1)
SQL (3)
Correct SQL syntax in 2 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER BY)
(1)
Fundamentals of databases
Correct SQL syntax in 3 or 4 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER
BY) (1)
i (3)
Identification of a new relation to store the information about what act types can be matched
with stage types. (1)
(Allow any meaningful name for the relation. Allow responses that explain the new design rather
than the table design.)
Alternative response given the wording of the question may be to add two fields to an existing
table, e.g. Stage(Name, StageType, Curfew, ActType1, ActType2).
j Add each edit/update to a queue (1) and process each one in order. (1)
b Data set too large to fit on a single server OR data set too large to be processed on a single
computer. (1)
c Variety of data types OR structures OR formats (1) meaning that the data will not fit into a
traditional relational database structure. (1)
The data structure cannot be made larger/smaller OR the data itself cannot be changed/must
be copied if it needs to be altered (1) which means that in a distributed/parallel architecture,
each process is unaffected by other processes. (1)
Fundamentals of functional programming
Fundamentals of functional
programming
Functional programming paradigm
1 a N/ /natural numbers/positive integers (1)
2 a Z/ /integers (1)
b Z/ /integers (1)
c integer (1)
d integer (1)
e (3)
Allows the calling/application of a multi-parameter function (1) with fewer than the required
number of parameters/only one argument. (1)
sub (x, y) = x - y
b Z/ /integers (1)
c 32 = 9 (1)
7 + 9 = 16 (1)
d 42 = 16 (1)
12 – 16 = –4 (1)
head (tail (tail num)) = 9 (1) Mark for correct answer only, working not needed
5 a [1,2,3,4,5] (1)
b [2,8,18,32,50] (1)
c [16,25] (1)
d [4,16] (1)
e 55 (1)
f 0 (1)
g 48 (1)
d Potential answer
Repeat:
Repeat:
2 + 4 + 6 + fold (+) 0 []
2+4+6+0
Result is 12
Potential answer
2+4+6+0
Result is 12
(Allow the use of different types of fold, e.g. foldl would combine to 0 + 2 + 4 + 6.)
Exam-style questions
8 a N/ /natural numbers (1)
b i 10 (1)
ii [4,9] (1)
iv [10,4,9] (1)
c i 18 (1)
ii [10,20] (1)
iv 24 (1)
v 72 (1)
e Potential answer
Apply head/tail:
1:9:[]
[1:9]
Potential answer
Apply filter:
1:9:[]
[1,9]
Use of head/tail
Use of recursion