Exchanging Data: Databases, Networks and Web Technologies - Worksheets, Questions and Revision
10 original exam-style questions - 7 pages of questions with a full mark scheme - free printable PDF.
Exchanging Data: Databases, Networks and Web Technologies revision guideMore A Level Computer Science practiceMock exams
This topic is chapter 3 of A Level Computer Science Topic Workbook 1 and chapter 3 of A Level Computer Science 10-Minute Tests.
1.3 Exchanging Data: Databases, Networks and Web Technologies
| StudentID | StudentName | TutorGroup | {ModuleCode, ModuleName, Grade} |
|---|---|---|---|
| 1001 | Amara Okafor | 12A | {(COMP101, Computer Systems, A), (COMP102, Programming, B)} |
| 1002 | Liam Fraser | 12B | {(COMP101, Computer Systems, B)} |
Student(StudentID, Name, TutorGroup)
Module(ModuleCode, ModuleName)
Enrolment(StudentID, ModuleCode, Grade)
StudentID is the primary key of Student, ModuleCode is the primary key of Module, and (StudentID, ModuleCode) is the composite primary key of Enrolment, with StudentID and ModuleCode as foreign keys.
Question 1
- (a) States that the hash function converts a key into an index/address (oe)M1
- (a) Explains this allows data to be stored and retrieved directly/in near constant time, without searching every record (oe)A1
- (a) Answer: A hash function converts a key into a table index, allowing data to be stored at and retrieved from that index directly rather than being searched for.
- (b) 23 -> index 3 and 7 -> index 7 both placed with no collisionM1
- (b) 17 correctly identified as colliding at index 7 and probed to index 8M1
- (b) 13 correctly identified as colliding at index 3 and probed to index 4M1
- (b) Fully correct final table cao: index 3 = 23, index 4 = 13, index 7 = 7, index 8 = 17, all other indices emptyA1
- (b) Answer: Index 0: empty, 1: empty, 2: empty, 3: 23, 4: 13, 5: empty, 6: empty, 7: 7, 8: 17, 9: empty
- (c) Keys that share a common factor with the table size (or are multiples of it) cluster/collide at the same or nearby indices, especially if the table size is not prime (oe)B1
- (c) Answer: Keys sharing a common factor with the table size can cluster at the same indices, causing more collisions than a well-chosen table size/hash function.
Question 2
- (a) Client-side scripting: code is executed in the user's browser/on the user's device (oe)B1
- (a) Correct example client-side language, e.g. JavaScriptB1
- (a) Server-side scripting: code is executed on the web server before the page/response is sent to the client (oe)B1
- (a) Correct example server-side language, e.g. PHP, Python, or ASP.NETB1
- (a) Answer: Client-side: runs in the browser (e.g. JavaScript). Server-side: runs on the web server before the page is sent (e.g. PHP).
- (b) States that the data does not need to be sent to the server and a response waited for before the error is shown (oe)M1
- (b) Explains this reduces the load on the server and the amount of data sent over the network, since invalid entries are never transmitted (oe)A1
- (b) Explains this gives the applicant immediate/faster feedback, improving the user experience (oe)A1
- (b) Answer: Client-side validation checks the value in the browser immediately, so invalid entries are never sent to the server, reducing server load and network traffic and giving the applicant instant feedback.
- (c) Client-side code can be viewed and modified by the user (e.g. via browser developer tools), so it cannot be trusted to enforce a security check (oe)B1
- (c) The database holding the passwords is only accessible from the server, so the comparison must be performed there (oe)B1
- (c) Answer: Client-side code is visible and editable by the user, so it cannot be trusted to enforce security, and only the server has access to the password database, so the check must happen there.
Question 3
- (a) Symmetric encryption uses the same single key to encrypt and decrypt the data (oe)B1
- (a) Asymmetric encryption uses a mathematically linked key pair (a public key and a private key); data encrypted with one key can only be decrypted with the other (oe)B1
- (a) Comparative point, e.g. symmetric is faster but requires the key to be shared securely in advance, whereas asymmetric avoids that key-distribution problem but is slower (oe)B1
- (a) Answer: Symmetric: one shared key for both encryption and decryption, fast but must be distributed securely. Asymmetric: a public/private key pair, slower, but removes the need to share a secret key in advance.
- (b) States that asymmetric encryption is computationally expensive/slow, particularly for large amounts of data (oe)M1
- (b) States that symmetric encryption is much faster and better suited to encrypting the bulk of the session's data (oe)A1
- (b) Explains that asymmetric encryption is instead used briefly to securely exchange the symmetric session key, solving the key-distribution problem without the ongoing performance cost (oe)A1
- (b) Answer: Asymmetric encryption is slow for large volumes of data, so it is used only to safely exchange a symmetric session key; the fast symmetric algorithm then encrypts the rest of the session, combining the security of asymmetric key exchange with the speed of symmetric encryption.
- (c) Shows a shift of 3 applied consistently to each letterM1
- (c) Fully correct ciphertext cao: QHWZRUNA1
- (c) Answer: QHWZRUN
- (d) Only 25 possible shifts/keys exist, so it can be broken quickly by brute force, or it is vulnerable to frequency analysis (oe)B1
- (d) Answer: There are only 25 possible shift values, so the cipher can be broken almost instantly by trying every shift (brute force) or by frequency analysis.
Question 4
- (a) States that the table contains a repeating group / multi-valued attribute (oe)B1
- (a) Identifies the specific repeating group in context, i.e. a student can have more than one set of ModuleCode/ModuleName/Grade values in one recordB1
- (a) Answer: It is not in 1NF because each student record can contain a repeating group of module data (more than one ModuleCode/ModuleName/Grade set per StudentID).
- (b) Removes the repeating group so that each student-module combination becomes a separate rowM1
- (b) Correct attributes shown for every row: StudentID, StudentName, TutorGroup, ModuleCode, ModuleName, GradeA1
- (b) Correctly identifies the composite primary key as (StudentID, ModuleCode)A1
- (b) Answer:
Primary key: (StudentID, ModuleCode)StudentID StudentName TutorGroup ModuleCode ModuleName Grade 1001 Amara Okafor 12A COMP101 Computer Systems A 1001 Amara Okafor 12A COMP102 Programming B 1002 Liam Fraser 12B COMP101 Computer Systems B - (c) Identifies that StudentName and TutorGroup depend only on StudentID (part of the composite key), not on the whole keyM1
- (c) Identifies that ModuleName depends only on ModuleCode (part of the composite key), not on the whole keyM1
- (c) Correctly splits into Student(StudentID, StudentName, TutorGroup) and Module(ModuleCode, ModuleName) with appropriate primary keysA1
- (c) Correctly retains Enrolment(StudentID, ModuleCode, Grade) with a composite primary key (StudentID, ModuleCode) and both attributes as foreign keys referencing Student and ModuleA1
- (c) Answer: Student(StudentID [PK], StudentName, TutorGroup); Module(ModuleCode [PK], ModuleName); Enrolment(StudentID [PK, FK], ModuleCode [PK, FK], Grade)
- (d) Defines a transitive dependency as a non-key attribute depending on another non-key attribute, rather than directly on the primary key (oe)M1
- (d) Explains that removing transitive dependencies reduces data redundancy and prevents update/insertion/deletion anomalies (oe)A1
- (d) Correctly judges, with justification, that no further transitive dependency exists in the part (c) tables, since every non-key attribute (StudentName, TutorGroup, ModuleName, Grade) depends directly on its table's primary keyA1
- (d) Answer: 3NF removes transitive dependencies to reduce redundancy and avoid anomalies. In this case the part (c) tables are already in 3NF, as no non-key attribute depends on another non-key attribute.
Question 5
- (a) Correct SELECT and FROM clauses referencing Student and Enrolment (or an equivalent JOIN)M1
- (a) Correct join condition linking Student.StudentID = Enrolment.StudentIDM1
- (a) Correct WHERE clause filtering ModuleCode = 'COMP101' AND Grade = 'A', caoA1
- (a) Answer: SELECT Name FROM Student, Enrolment WHERE Student.StudentID = Enrolment.StudentID AND Enrolment.ModuleCode = 'COMP101' AND Enrolment.Grade = 'A';
- (b) Correct SELECT of TutorGroup and a COUNT aggregate function on StudentID (or *)M1
- (b) Correct GROUP BY TutorGroup clauseA1
- (b) Fully correct, syntactically valid statement caoA1
- (b) Answer: SELECT TutorGroup, COUNT(StudentID) FROM Student GROUP BY TutorGroup;
- (c) Correct ALTER TABLE Student keyword and table nameM1
- (c) Correct ADD COLUMN syntax with column name and DATE data type, caoA1
- (c) Answer: ALTER TABLE Student ADD DateOfBirth DATE;
Question 6
- (a) Atomicity: a transaction is treated as a single indivisible unit that either completes fully or is rolled back entirely (oe)B1
- (a) Consistency: a transaction takes the database from one valid state to another, obeying all defined rules/constraints (oe)B1
- (a) Isolation: concurrently executing transactions do not interfere with one another, behaving as if run sequentially (oe)B1
- (a) Durability: once a transaction is committed, its changes are permanent, even if the system subsequently fails (oe)B1
- (a) Answer: Atomicity - all or nothing. Consistency - database moves between valid states. Isolation - concurrent transactions do not interfere. Durability - committed changes survive failure.
- (b) Identifies the problem: without isolation, both transactions could read the original balance (500) before either writes back, so one withdrawal's update could be lost/overwritten (a lost update)M1
- (b) Explains that Isolation ensures the transactions are processed as if one happens completely before the other (serially), e.g. via locking the record during the first transactionA1
- (b) Explains that the second transaction then reads the updated balance (200) left by the first, correctly declining/processing based on the true remaining balance, so both withdrawals are reflected correctlyA1
- (b) Answer: Without isolation both machines could read the 500 balance and each write back 200, losing one withdrawal. Isolation locks the record so the second transaction must wait and reads the already-updated balance (200), giving a correct final result.
- (c) Prevents two transactions from modifying the same record at the same time, avoiding data inconsistency/lost updates (oe)B1
- (c) States that the lock is released once the transaction has committed or been rolled back, allowing other transactions to proceed (oe)B1
- (c) Answer: Record locking stops two transactions updating the same record simultaneously, preventing lost updates; the lock is released once the transaction commits or rolls back so others can then access the record.
Question 7
- (a) Describes a crawler as a program that automatically follows hyperlinks between pages to discover content across the web (oe)B1
- (a) Describes the index as a data structure storing keywords/terms mapped to the pages they appear in (oe)B1
- (a) States that the index is built up in advance from the pages the crawler visitsB1
- (a) Explains that this allows the search engine to search the prebuilt index rather than the entire live web at query time, giving a fast response (oe)B1
- (a) Answer: A crawler automatically follows links to discover web pages, and the content found is used to build an index mapping keywords to pages. When a query is made, the search engine searches this prebuilt index rather than the live web, giving a near-instant response.
- (b) States that PageRank counts the number of backlinks (links from other pages) pointing to a page (oe)B1
- (b) States that a link from a page with a higher rank/quality contributes more to the score than a link from a low-ranked page, so quality matters as well as quantity (oe)B1
- (b) States that pages with a higher resulting score are ranked/displayed higher in the search results (oe)B1
- (b) Valid illustrative example, e.g. a recipe page linked to from a well-established site such as BBC Good Food would rank higher than an identical recipe page linked to only from one small personal blog (oe)B1
- (b) Answer: PageRank scores a page by counting backlinks, weighting links from higher-ranked pages more heavily than links from low-ranked pages, and pages with a higher score are shown higher in results; for example, a recipe page linked from BBC Good Food would outrank an identical page linked only from a small personal blog.
Question 8
- Level 3 A detailed and coherent discussion covering a range of relevant technologies for both data in transit and data at rest (e.g. TLS/HTTPS, hashing and salting of stored data, tokenisation, firewalls, two-factor authentication). The candidate evaluates the effectiveness and/or limitations of the measures discussed, recognising that a combination of techniques (defence in depth) is needed. Technical terminology is used accurately and the answer is well structured throughout.6-8
- Level 2 A reasonable discussion of some relevant technologies covering transit and/or storage, with some evaluation of effectiveness, but the range or depth is limited, coverage is one-sided (e.g. transit only), or there are minor inaccuracies. Some relevant technical terminology is used.3-5
- Level 1 Limited, mostly descriptive or list-like points are made, with little or no evaluation of effectiveness. The answer may contain inaccuracies and lacks coherent structure.1-2
- Level 0 No creditable response, or the response does not address the question.0
- Indicative content:
- TLS (HTTPS) encrypts data sent between the customer's browser and the server, preventing eavesdropping/interception in transit.
- Asymmetric encryption is used during the TLS handshake to securely exchange a symmetric session key, which then encrypts the bulk of the transmitted data.
- Passwords should be stored using a hash function (ideally with a salt) rather than in plaintext, so that even if the database is stolen, the original passwords are not directly readable.
- A salt prevents attackers from using precomputed rainbow tables to reverse common hashed passwords.
- Card/payment data at rest should be encrypted, and full card numbers are often replaced with tokens (tokenisation) so the retailer never stores the real, usable card number.
- Firewalls and intrusion detection systems help prevent unauthorised access to the servers/database that hold customer data.
- Two-factor authentication adds an extra barrier against an attacker who has obtained a password.
- Evaluation: TLS protects data only in transit, not once it is stored, so it must be combined with storage-level protection; hashing without a salt is vulnerable to rainbow table attacks; no single technique is sufficient on its own, so a combination (defence in depth) gives the strongest overall protection; measures such as PCI DSS compliance and regular security audits help ensure these technologies are implemented and maintained correctly.
Question 9
- (a) Sequence number (accept packet/fragment number)B1
- (a) Answer: Sequence number
- (b) Any correct logic, ignore minor syntax: outer loop correctly iterates through the array starting from the second element (index 1) to the last elementM1
- (b) Current element is stored in a variable before it is potentially overwrittenM1
- (b) Inner loop/comparison correctly compares seqNum of the stored element against seqNum of preceding elementsM1
- (b) Preceding elements with a greater seqNum are correctly shifted one place to the rightM1
- (b) The stored current element is correctly inserted at the resulting empty positionM1
- (b) Complete, logically correct algorithm that sorts the whole array into ascending order of seqNum for any valid input, using correct array index boundsA1
- (b) Answer:
PROCEDURE SortPackets(packets, n) FOR i <- 1 TO n - 1 current <- packets[i] j <- i - 1 WHILE j >= 0 AND packets[j].seqNum > current.seqNum packets[j + 1] <- packets[j] j <- j - 1 ENDWHILE packets[j + 1] <- current NEXT i ENDPROCEDURE - (c) Correct row for i = 1: current = 1, array shifts to [3, 3, 2] mid-pass then current inserted at index 0, giving array [1, 3, 2]M1
- (c) Correct value of j shown ending at -1 for the i = 1 passA1
- (c) Correct row for i = 2: current = 2, packets[1] (value 3) shifts right, j ends at 0, current inserted at index 1, giving array [1, 2, 3]M1
- (c) Final array fully correct and in ascending order cao: [1, 2, 3]A1
- (c) Answer: i=1: current=1, j finishes at -1, array becomes [1,3,2]. i=2: current=2, j finishes at 0, array becomes [1,2,3]. Final sorted array: [1,2,3]
Question 10
- (a) 192 correctly converted to 11000000, caoB1
- (a) 168 correctly converted to 10101000, caoB1
- (a) 1 correctly converted to 00000001, caoB1
- (a) 14 correctly converted to 00001110, caoB1
- (a) Answer: 11000000.10101000.00000001.00001110
- (b) States that the MAC address is a fixed/physical address built into the network interface (NIC) and does not change (oe)B1
- (b) States that the MAC address is used to deliver data to the correct device on the same local network/link (data link layer) (oe)B1
- (b) States that the IP address is a logical address that can be reassigned (e.g. by a router/DHCP) and identifies the network as well as the device (oe)B1
- (b) States that the IP address is used to route the data across different networks toward its destination (network layer), with the MAC address changing at each hop while the IP address stays the same (oe)B1
- (b) Answer: The MAC address is a fixed, hardware address used only for delivery within the local network. The IP address is a logical, changeable address used by routers to direct the data across different networks all the way to the destination.
- (c) States that the router examines the destination IP address of each packet (oe)M1
- (c) States that it uses a routing table to determine the best next hop toward the destination network (oe)A1
- (c) Explains that this allows the router to connect and forward data between different networks (e.g. from the home LAN onto the wider internet/WAN) (oe)A1
- (c) Answer: The router reads the destination IP address of each packet, consults its routing table to find the best next hop, and forwards the packet on toward the destination network, connecting the home LAN to the wider internet.
Mark your answers
Check answers without an account. Some answers can be checked automatically; use the mark scheme to mark the rest.