Please enable JavaScript.
Coggle requires JavaScript to display documents.
Comp Sci Paper 1 - Coggle Diagram
Comp Sci Paper 1
-
-
-
-
-
1.3.2 - Exchanging Data
- Primary key: Unique identifier for each record within a table.
- Foreign key: Links two tables together.
- Secondary key: Used to index the database as quicker to search for than primary key.
Database normalisation is carried out in an attempt to:
- Remove redundancies (by removing unnecessary duplicate data)
- Ensure data is consistent between tables.
- Ensure that records can be added and removed without issue.
- Allow for complex queries to be carried out.
1NF:
- Cells only contain a single piece of data. Data in a field is of the same type. Each row is unique.
2NF:
- No partial dependencies (all columns depend on the ENTIRE key).
- No transitive dependencies (entry depends on a non-primary attribute).
-
SQL
To select data from a database where we know exactly what we are querying for:
SELECT Attribute1 FROM table WHERE Attribute2 = "..."
To select data from a database where we what the cell we are querying for looks like:
SELECT ... WHERE Attribute1 LIKE "a%"
This will return entries if they start with a.
-
-
If we wish to insert a new record into a table:
INSERT INTO table (field1, field2, ...)
VALUES (attr1, attr2, ...)
-
-
-
A transaction is simply a single operation performed on data. Transactions must follow the rule ACID:
- Atomicity: A transaction must be processed fully or not at all.
- Consistency: A transaction must follow referential integrity rules.
- Isolation: Simultaneous transactions must cause the same result as the transactions carried out after one another.
- Durability: Once a transaction has been performed, it will remain so.
Referential integrity is the process of ensuring consistency. This ensures that information is not removed if it is required elsewhere within a database.
Record locking prevents simultaneous access to records in a database. It is used to prevent inconsistencies and loss of updates. This could cause deadlock.
-
1.3.3 - Exchanging Data
-
Types of topology:
- Physical Bus: All devices connected to a backbone which is connected to a terminator. As more devices are added, performance decreases.
- Star: Every device is connected to a central switch.
- Mesh: Every device connected to every other device.
TCP/IP Stack:
- Application: Defines the protocol.
- Transport: Uses TCP to establish end-to end communication. Packets get packet and port number.
- Network: Adds IP address to packet. IP and port combine to form a packet address.
-Link: Adds MAC address to packet. This either corresponds to the recipient computer or the recipient router.
Circuit Switching:
- Direct link of a fix bandwidth is established between the devices.
- Both devices must send and receive data at the same time.
- Packets arrive in a logical order and so data is reconstructed more quickly.
Packet Switching:
- Packets are sent down the quickest route.
- If one connection is broken then another route can be used.
- Packets can be transferred across very large networks.
- Time is spent reconstructing the data.
Pharming involves poisoning the DNS cache of a device to redirect it to a fake version of a website.
- A modem converts digital signals into analogue signals and vice verse so that data can be transmitted across a medium such as telephone lines.
- A router joins together two networks (connect a LAN to a WAN)
- A hub transmits incoming packets to all devices on the network.
- A switch only sends packets to the device they were intended for.
- Client-Server:
- Data stored in one location so more secure.
- Central backups carried out.
- Data and resources can be shared.
- Expensive (staff needed).
- Central weak point.
- Peer to Peer:
- Cheaper to set up.
- Easier to maintain.
- Poorer security.
- Cannot trace origin of files.
- Backups must be performed individually.
1.3.4 - Exchanging Data
HTML
-
If we wish to assign a title to our HTML file, we can use:<title>This is a title</title>
-
If we want to display an image then we can use:
<img src = "Image.jpeg" alt = "Text Replacement" width = "100" height = "100">
-
-
-
If we want to include a text box input (could be within a form):<input type = "text" name = "enter here">
-
-
If we want to create a numbered / ordered list:<ol><li>element</li>
</ol>
(Code uses ul for unordered)
-
-
CSS
-
-
-
CSS properties:
background-color
border-color
border-style
border-width
color
font-family
font-size
height
width
JS
If we want to edit a section of HTML:
elementtochange = document.getElementById("Example");
elementtochange.innerHTML = "this is the edit";
-
-
-
-
-
For loop:
for(let i = 0, i <= 5, i++)
Search engines make use of web crawlers. These web crawlers visit outgoing links on a webpage in order to collect data about it and then generate an index.
The page rank of a page depends on:
- The page rank of the pages that link to it.
- The number of incoming links.
Server-side processing:
- Can perform large calculations more quickly.
- More secure and not browser dependent.
- Examples are SQL and PHP.
Client-side processing:
- Will execute more quickly.
- Immediate response.
- Gives developers more control over the look and behaviour of a website.
- Js is one example.
-
-
1.3.1 - Exchanging Data
Run length encoding is a means of lossless compression in which multiple occurrences of a piece of data are replaced with the data followed by the number of occurrences of the data.
Dictionary encoding sees the data transferred with a dictionary. Occurrences of certain pieces of data are replaced with an index for the dictionary. In the best case, dictionary encoding will be better.
Symmetric encryption uses a single private key. Both the sender and receiver have a private key and obtain this in a key exchange.
Asymmetric encryption uses a public key and a private key. The public key can be used to encrypt the data. The private key can be used to encrypt is we want to verify authenticity.
Hash tables are used to find data in a constant time. A good hash algorithm for a hash table minimises collisions and decreases query time (hash should be smaller than key).