Computing
Section 3- Fundamentals of data representation
Storage Units and Binary Numbers
-A single 1 or 0 is a binary digit or a ‘bit’ for short
-A group of 8 bits is called a byte
-4 bits is half a bite, called a ‘nibble’
Units:
1Kilobyte (kB) = 1000 BYTES
1Megabyte (MB) = 1000kB
1 Gigabyte (GB) = 1000MB
1 Terabyte (TB) = 1000GB
1 Petabyte (PB) = 1000TB
-Computer systems use the binary system to store numbers and perform binary arithmetic and logic operations
-Memory size is commonly measured in terabytes (TB)
Binary:
-Uses two digits 1 and 0
-Binary = base 2
-Order of: 128, 64, 32, 16, 8 , 4, 2 ,1
-In order to store larger numbers, computers use more bytes as units called words
-To convert a decimal to binary number, use the column headings to calculate where the 1 and 0s go
Binary Arithmetic and Hexadecimal
Binary Addition:
-Adding binary works like adding decimal numbers in column addition
-1 + 0 = 1
-1 + 1 = 10
-1 +1 +1 = 11
Overflow:
-The biggest number you can represent with 8 bits is 255
-If an answer results in a number bigger than 255 or more than 8 bits, then an overflow occurs
-An overflow error occurs
Binary Shifts:
-A binary shift to the left is equivalent to multiplying a number by 2n (n= number of shifts)
-A binary shift to the right is equivalent to dividing a number by 2n (n = number of shifts)
Hexadecimal System:
-We can represent a nibble (4 bits) with a single digit
-Hexadecimal digits are from 1-0 then A-F (so F is 15)
-FF is the largest value = 255
-Split the binary number in half and work out the value of each nibble and write the hexadecimal equivalent
-Multiply the first character by 16 then add the second character
Uses of hexadecimal:
-Easier to understand so are used more than binary numbers
-Colours are a common use of hexadecimal
-Used in assembly language instructions such as ADD and 4F3A
ASCII and Unicode
-Every time a character is typed on a keyboard a code number is transmitted to the computer
-The code numbers are stored in binary
-PCs sometimes use a character set called ACII (American Standard Code for Information Interchange)
-ASCII uses 7 bits to code each character
-The biggest number that can be held is 7 bits is 127 in decimal so 128 characters can be represented
Extended ASCII code
-Uses 8 bits which give an additional 128 characters
Unicode:
-New standard for representing the characters of all the language of the world
-Unicode uses between 8, 16, or 32 bits per character and has the advantage that it can represent many more unique characters than ASCII
Images
-A drawing you create in PowerPoint is a vector graphic
-A vector graphic is made of lines and shapes with specific properties such as line style, colour, fill, start point, end point, etc… The computer stores all data about each shape in binary
-A photograph on a digital camera image is broken down into its smallest elements called pixels
-A pixel is a single point in an image which can have its colour set independently
-The size of an image is expressed directly as the width in pixels by the height in pixels
-If the size of a picture is increased, then more pixels will need to be stored- this increases the size of the image file (a bitmap image)
Colour Depth:
-Number of bits per pixel is referred to as the colour depth
-To work out the minimum required colour depth from the number of colours in the image, convert the number of colours to a power of 2:
-2 = 21 so 1 bit is required
-256 = 28 so 8 bits are required
-If the colour depth is increases, more bits are used to represent each pixel and the overall file size will increase
Effect of colour depth and image size:
-The higher the number of colours, the more faithful the image will be but the bigger the file size is
-We have monochrome (black and white), grey scale (usually 256 shades of grey), 16-bit colour and 32-bit colour (known as true colour), etc…
-The size of an image is the number of pixels or dots that make up an image
-The greater the number of pixels per inch, the sharper the image will be, and the larger the file size of the image
-Pixel density, measured in pixels per inch (PPI) is used to describe the resolution of a computer screen, camera or scanner
-An image from the Internet is typically 72PPI, which is a low resolution
-If you try to enlarge the image on the screen, the software makes up for the pixels which do not exist and you get a blurry image
Calculating the file size:
-Size in bits= image width x image height x colour depth
Sound
-Sound waves are analogue, which means continuously changing
-Anything stored in a computer must be stored in a digital format as a series of binary numbers
-To store sound on a computer, the wave form must be converted into a numerical representation
-The device that takes real-world analogue signals and converts them into a digital representation is called an Analogue-to-Digital Converter (ADC)
Analogue sound is received by a microphone
This is converted into an electrical analogue signal
The signal amplitude (height of the wave) is measured at regular intervals (sampled)
The values are rounded to a level 9quantisation)
The values are stored as a series of binary numbers
-A sample is a measure of amplitude at a point in time
-The accuracy with which an analogue sound wave is converted to a digital format depends on two things, sample resolution and sample rate
-The sample resolution is the number of bits used to store each sample
-The sample rate is the frequency with which you record the amplitude of the sound (i.e. number of samples per second)
-Sample rate is usually measured in hertz where 1 hertz = 1 sample per second
-The more frequently the sound is sampled, the better the quality and smooth the playback will sound
Compression
-When data is transmitted across the Internet, it will go through many different physical links between routers
-The connections from a computer or a LAN into the Internet is likely to be the slowest part of this route
-One way of speeding up the rate at which files can be transmitted across the Internet is to compress them to make them smaller- smaller files take less time to transmit over a network
-The final use of the file will dictate how much you can compress the files and still have a file that is useable
-Compression is used in order to:
-Reduce the amount of storage needed on a computer to save files
-Allow large files to be transmitted as an email attachment; many email servers limit the size of a file that can be sent and compression can reduce the file size to allow users to send it
-Allow a file to be transmitted in less time, owing to the smaller file size
Lossy Compression
-A data encoding method where files are compressed by removing some of the details
-Photographs can be stored using few colours so fewer bits are needed per pixel
-This type of compression is used to compress images, audio files and video files
Lossless Compression
-A data encoding method where files are compressed but no data is lost- an essential factor for text and data files
-Bank records must keep all the data; you cannot transmit a bank statement and miss out a few 0s
-It could be used to compress data files before attaching them to an email
Type | File Suffix | Compression Type | Explanation |
Bitmap | .bmp | - | Uncompressed still image file |
JPEG | .jpg | Lossy | Good for photographs. Colour depth= 24 bit, PGB , 16.7 million different colours |
Graphic Interchange Format | .gif | Lossless | Colour dept = 8 bits (256 colours), good for images with large areas of solid colour and ideal web graphics |
MP3 | .mp3 | Lossy | Audio files: designed for downloading music from the Internet. In MP3 format, you could fit 120 songs on a CD |
Run Length Coding (RLE)
-A simple form of lossless data compression in which runs of data (sequences of data all having the same value) are stored using frequency/data pairs
-For example, a black and white image below in uncompressed form would occupy 64 bits, with 1 representing white and 0 representing black:
-11111111 10111111 00000011 00000011 00000000
-Using RLE, the first row of pixels could be represented as 8 1, meaning that there are 8 pixels each having a value of 1
-Second row can be represented as 1 1 1 0 6 1 representing 1 white pixel, 1 black pixel, 6 white pixels
⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬛⬜⬜⬜⬜⬜⬜
⬛⬛⬛⬛⬛⬛⬜⬜
⬛⬛⬛⬛⬛⬛⬜⬜
⬛⬛⬛⬛⬛⬛⬛⬛
-RLE is not as useful with files that do not have many runs, and can increase the file size
-Most useful on simple images such as icons that contain many pixels of the same colour
Huffman Coding
-A compression technique used to reduce the number of bits used to represent each letter
-The more frequently a letter appears in the text, the fewer bits are used to represent it in a text file
Section 5- Fundamentals of Computer Networks
Computer Networks
-A series of computer and other devices that are connected together and can share data and resources
-Advantages of networking:
-Sharing resources- users can be given access to data, printer and applications
-Saves money- not as many printers need to be bought and applications can use a site licence
-Easy communication- users can use email/messaging across the network
-Data easy to backup- stored centrally on servers
-Easy access- can access networked resources from any attached computer or device
-Disadvantages of networking:
-High setup cost- money must be invested in buying network hardware
-Management of a large network requires training and skilled staff- technical complex
-A virus on one computer could spread to others- all connected on the network
Types of network?
Type | Scope | Characteristics |
PAN | Immediate vicinity | Personal devices connected by Bluetooth |
LAN | Single location (building or campus) | Connected via cable or Wi-Fi Often owned and controlled/managed by a single person or organisation |
WAN | Spans across multiple locations | Involves a number of LANs connected by routers Often under collective or distributed ownership |
-Networks can be combined together to form inter-networks
-Internet is the largest collection of networks all round the world
-AQA defines the Internet as a WAN
LAN
-Local Area Network
-Operates on a single site such as a school or office
-AQA refer to LANs as wired and Wireless LANs (using Wi-Fi) as WLANs
Wired LAN topologies
-Wired networks can use different types of cable such as fibre and copper
-Copper used for most LANs connecting computers to the network as is widely available and relatively easy to set up
-Fibre used where high bandwidth is needed or environment is prone to electrical interference. More expensive and difficult to set up than copper
Wireless networks
-Connect using Wi-Fi
-Broadcast using radio waves
-Wi-Fi networking protocols
-Family of related protocols
-Wi-Fi is a trademark using to describe a Wireless LAN or WLAN
Wireless transmission
-Commonly uses radio waves for communication
-Susceptible to interference from objects and other nearby electronic or radio devices
Wireless access point
-A wireless Access Point )AP) is a device that allows wireless devices to connect to a wired network using Wi-Fi
-AP usually connects to a router (via cabled network) as a standalone device, but can also be an integral component of the router itself
Wireless NICs
-Built into every networked device capable of connecting to a wireless network
-These include:
-PCs
-Smart phones
-Wireless speakers
Cabled or Wireless?
Wired Benefits:
-Faster connection as little interference with the signal
-High bandwidth- wired technologies transmit signal faster
-Greater security- device must be connected by a cable to receive packets
Wired Cons:
-Hazardous and unsightly cables
-Not all devices can connect via a cable such as a phone
-Can be expensive to set up as cable must be put through all networked rooms
-Cannot be used in some historical buildings
Wireless Benefits:
-Easy to connect new devices- no need for a cable to plug into
-Can be used feely within range- not tired to where you plug the cable in
Wireless Cons:
-Connection can be slower- technology cannot run as fast
-Subject to interference from walls, object and other electronic devices- signal could be weakened by them
-Less secure- anyone with a Wi-Fi enabled device can connect (if not secure password)
Wireless Security Risks
-Theft of bandwidth from neighbouring users within range
-Compromised confidentiality without adequate encryption
-Easier or intercept data or ‘hack’
Network Protocols
-Set of rules to allow communication between devices on a network
Ethernet
-Common method for connecting devices in a LAN using wired connections
-Allows computers, printers and other devices to communicate and share data quickly and reliably over physical cables
Wi-Fi (Wireless Fidelity)
-Wireless technology that allows devices to connect to a LAN and access internet without the use of cables
-Uses radio waves to transmit data between devices and a router
TCP (Transmission Control Protocol)
-Ensures data sent over a network arrives completely and in the correct oder
-Breaks data into packets and check all packets are received properly, requesting any missing ones to be resent
UDP (User Datagram Protocol)
-Fast, lightweight protocol for sending data over a network without checking if it arrives correctly
-Doesn’t confirm delivery or order of data packets and it is connectionless, meaning that it sends data packets without establishing a prior connection
IP (Internet Protocol)
-Responsible for addressing and routing data packets across networks
-Ensures data packets can find their way form the sender to the correct destination computer using IP addresses
HTTP (Hypertext Transfer Protocol)
-Protocol used for transferring web pages and other content between web servers and browsers
-Defines how web browsers request pages and how web servers respond with the requested content
HTTPS (Hypertext Transfer Protocol Secure)
-Secure version of HTTP than encrypts the data being transferred between web browsers and servers
-Protects sensitive information such as passwords and credit card details from being understood if intercepted by hackers
FTP (File Transfer Protocol)
-Used to transfer files between computers over a network such as the internet
-Allows users to upload or download files to and from a remote server, often used for managing files on websites
SMTP (Simple Mail Transfer Protocol)
-Used for sending emails from one email server to another across the internet
-Handles the delivery of outgoing emails from you email client to the recipient’s email server
IMAP (Internet Message Access Protocol)
-Allows users to access and manage their emails stored on a remote email server
-Enables emails to read and organised from multiple devices whilst keeping them synchronised on the server
Network Security
-Many organisations rely on networks to store and transfer sensitive information, such as personal details, financial records and business secretes
-Without proper security, this data could be stolen, deleted or altered by hackers, leading to serious consequences like identity theft, fraud or disruption of services
-Methods of network security include authentication, encryption, firewalls and MAC address filtering
-Above methods can be work together to provide a greater level of security
Authentication
-Checking the user is who they purport to be (i.e. the user is who they say they are)
-Common example is entering a username and password to log in to an account
-More secure systems may use two-factor authentication, which combines something the user knows (e.g. password) with something they have (like a code sent to them)
-Used in almost all online surfaces to ensure only authorised users can access private information
Method of Authentication
-Biometrics
-Unique physical features like finger prints or a retina scan will uniquely identify a person
-CAPTCHA
-Completely Automated Public Turing test to tell Computers and Humans Apart
-Type of security measure known as challenge-response authentication, typically users must select objects shown in a picture
-Email/SMS text verification
-Part of a two-way authentication
-Typically you log in with an email and password then get set a link to follow or a number to enter
Encryption
-Method of converting data into a coded format so only authorised users with correct decryption key can understand it
Encryption Terminology:
-Plaintext→ original message to be encrypted
-Ciphertext→ encrypted message
-Encryption→ process of converting plaintext into ciphertext
-Key→ sequence of numbers used to encrypt of decrypt, often data using a mathematical formula
-Encryption algorithm→ formula for encrypting the plaintext
Encryption Techniques
-Symmetric encryption
-A single key is used to encrypt and decrypt a message and must be given to the recipient of the message to decrypt the data
-Asymmetric encryption (Public Private key pairs)
-Two key used- a public one to encrypt and the other private one to decrypt data
-More secure as it means you never have to send or reveal decryption key
Caesar shift cipher
-Earliest known substitution cipher was attributed to Julius Caesar
-Each letter is replaced by the letter n positions further on in the alphabet
-n is the key and used to encrypt and decrypt the message
-Example of symmetric encryption
-Most basic type of encryption and most insecure
Cryptoanalysis
-Objective is to decode the ciphertext- typically by finding out the secret key
-Two general approaches:
-Brue-force attack
-Non-brute-force attack (cryptanalytic attack)
Brute-force attack
-Every possible key is tried
-On average, half all possible keys need to be tries so the longer the key, the more time it takes to find it
-Caesar Cipher uses a shift of between 1 and 26 assuming only uppercase letters of the used so there are 26 possible keys requiring an average of about 14 tries to crack the code
Key Strength
-5 bits would enable 25 key combinations; one for each letter so it could be said that Caesar was using 5-bit encryption
-Increasing the number of bits used for a key increases the strength of the encryption
Non brute-force attack
-At Bletchley Park, during WWII, a team of code breakers decoded German ciphers. The cipher key was changed every day
-An important clue was some messages always started with ‘Heil Hitler’
-This gave code breakers a starting point
Frequency analysis
-Letters not used equally often
-In English, E is the most common letter whilst letters like Z are fairly rare
Modern ciphers
-Created using two very large prime numbers multiplied together
-The larger the prime number, the more difficult it is to find the two numbers needed to break the code
Algorithmic security
-Ciphers are based on computational security
-Keys determined using a computer algorithm
-Key derived from an algorithm can also be unpicked
-Given enough ciphertext, computer power and time, a key can be determined and the message cracks
Strong and weak encryption
-Relative terms but:
-Encryption can be considered to be ‘strong’ when useful lifetime of encrypted data is less than the time taken to break the code
-With weak encryption, code may be broken in time to use the information, but it wouldn’t be worth the effort trying
Wireless encryption standards
-Most common wireless security standards are:
-WEP (Wired Equivalent Privacy)
-WPA (Wi-Fi Protected Access)
-These also prevent network data from being understood as it is transmitted
-WPAv2 is the latest and most secure standard
Firewalls
-A network device that monitors incoming and outgoing network traffic
-Decides whether to allow or block specific traffic based on a set of security rules
-Placed at the boundary between an organisation’s private network and the public network it is connected to
-Can filter specific protocols
-e.g. some organisations will block FTP so files cannot be downloaded
-Can filter DNS names
-Can filter IP addresses
-Some firewalls can look at the content of data packets and filter on that
-e.g. filtering email for unacceptable content
A firewall:
-Prevents unauthorised access into the network (by checking IP/MAC address/packet content)
-Prevents unauthorised transmissions from inside the network to external locations
-Monitors network traffic
-Ensures only authorised traffic is allowed
-Opens/closes ports as necessary
MAC address filtering
-A MAC (Media Access Control) address is a unique 32 it number assigned to all Network Interface Controllers (aka Network cards or NICs)
-Typically presented in Hexadecimal numbers
-Firewall can be configured to block or allow access to specified devices identified by their MAC addresses
-Wireless Access Points (i.e. the wireless router) can be configured to use MAC address filtering
The 4 layer TCP/IIP model
-Used to transmit data over a network
-Made up of four ordered layers, each with specific functions
Application layer→ where the network applications such as web browsers or email programs, operate
Transport layer→ sets up the communication between the two hosts and they agree settings such as the size of packets
Internet layer→ addresses and packages data for transmission. Routes the packets across the network
Link layer→ where the network hardware such as the NIC (network interface card) is located. OS device drivers also sit here
Different protocols operate at each later:
-HTTP, HTTPS, SMTP, IMAP and FTP protocols operate at the application layer
-TCP and UDP protocols operate at the transport layer
-IP protocol operates at the internet layer
Section 6- Cyber Security
-Cyber Security consists of the processes, practises and technologies designed to protect networks, computers, programs and data from attack, damage or aunauthorised access
Cyber Security Threats
-Social engineering is the art of manipulating people so they give up condifidential information
-Blagging
-Phishing
-Shouldering
-Malware is an umbrella term used to refer to a variety of forms of hsotile or intrusive sofware
-Computer virus
-Trojan
-Spyware
-Pharming→ a cuber attack intended to redirect a website’s traffic to a fake website
-Weak and Default Passwords→ allows hackers a way in to attack the computer or network
-Misconfigured Access Rights→ can lea dto data being accidently deleted or changed by people who should not have access to it
-Removable Media→ can introduce malware into a computer or network. Also a way of taking unauthorised data out of an organisation
-Upatched/ Outdated Software→ allows hackers to exploit security loop holes to get into the system
Penetration Testing
-The process of attempting to gain access to a resource without knowledge of usernames, paswords and other normal means of access
-Two types of penetratoin tesing:
-When the person or team testing the system has knowledge of and possibly basic credentials for the target system, simulating an attack from inside the system (a malicious insider)
-When the person or team testing the system has no knowledge of any credentials for the target system, simulating an attack from outside the system (an external attack)
Social Engineering
Social Engineering Techniques
-The art of manipulating people so they give up confidential information
-Blagging is the act of ceatin gand using an invented scenario to engage a targeted victim in a manner that increases the cahnge the victim will divulge information of perform actions that would be unlikely in ordinary circumstances
-Phishing is a technique of frauduntly obtaining private information, often using email or SMS (texts)
-Shouldering is observing a person’s private information over their shoulder. e.g. cahspoint machine PINs
Malware
Malicious Software (Malware)
-An umbrella term used to refer to a variety of forms of hostile or intrusive software
-Forms of malware include:
-Computer virus→ a peice of code that is capable of copying iteself and typically has a detrimental effect, such as corrupting the software or destroying data
-Trojan→ malware that disguises itself as a standard program so that attackers are able to carry out any action that a legitamate user could perform, such as exporting files, modifying data or deleting files
-Spyware→ malware on a person’s computer that gathers personal information and sends it to another person
Methods to detect and prevent cyber security threats
-Biometric measured (particularly for mobile devices)
-Facial recognition
-Fingerprint scanning
-Iris or retina recognition
-Voice recognition
-Finger and hand vein recognition
-Biometrics advantages:
-Accurate
-Cannot be easily faked/hacked
-Faster authentication
-Convenient
-Biometric disadvantages:
-Costs→ significant investment needed in biometrics for security
-Trackin gand data→ can limit privacy for users (e.g. facial recognition data)
-Password Systems advantages:
-Easy to set up for new users
-Easy to manage
-Do not need additional hardware
-Password Disadvantages
-Passwords can be hacked/guessed relatively easily
-Passwords can be shared
CAPTCHA
-Typically asks the user to select parts of an image
-CAPTCHA advantages:
-Prevents automated bots and scripts accessing system intended for human use only
-Accessible to users with disabilities as can provide alternative audio or tactile challenges
-Some can generate revenue by serving as an advertising platform or selling user-generated data
-CAPTCHA disadvantages
-Can be difficult for some users not proficient in English or with cognitive or motor disabilities
-Some can be vulnerable to attacks such as brute-force attacks where hackers use automated scripts
-Costs→ developing and implementing can be costly, particularl for small or medium-sized businesses that may not have the resources to invest in robust anti-spam or ani-block measures
-Ethical concerns as some may require users to perform repetitive or tedious tasks or may exploit user data for profit without adequate compensation or consent
Using email confirmations to confirm a user’s identity
-When setting up 2-step verification a PIN or code will be sent to you
-This PIN is needed to prove it is really you when you enter it
Automatic software updates
-Advantages
-Newly discovered security or performance issues are updated as soon as a fix is available
-No action required on your part
-Hackers cannot exploit any known security loop holes
-Disadvantages
-Automatic updates may not be compatible with all software. As not tested before update, may lead to some things not working properly
-Can create a false sense of security→ automatic updates do not mean you are immune to security breaches
-Updates take time to download and install and can cause interruptions int normal working day and lead to loss of producivity
Section 7 - Relational Databases and SQL
Databases
-A database is a structured collection of data
-A database is typically modelled in rows (records) and columns (fields) in tables
-Makes processing and finding (querying) data efficient
-Data can be easily accessed, managed, modified, update, controlled and organised
-Most use Structured Query Language (SQL) for writing and extracting data
How is data laid out in a database
-Data in a database stored in a table
-Each table has a number of key elements:
-Field→ single element of data
-Record→ A number of related pieces of information grouped together (e.g. customer contact details)
-Every record in a table will have the same fields within it
-Records are rows, fields are columns
Types of Database
-Flat file databases→ where data is stored in a single table
-Relational databases→ where data is stored in multiple linked tables
Relational Databases
-A collection of table of related data which can be linked together by means of key fields
Benefits of a relational database
Data is stored only once.
-Reduces data redundancy: data not unnecessarily duplicated
-Reduces data inconsistency: no multiple record changes needed
-More efficient storage as less space is needed as no duplicated data
-Uses SQL; simple to select, insert, delete or update details
-The duplication of data within a database is referred to as data redundancy
Data can be retrieved easily with SQL queries. SQL developed to allow programmers to manage data using commands such as:
-Select
-Insert
-Update
-Delete
-DropExample:
SELECT * FROM Customer WHERE ID = 0024
-Gives data for customer 0024 from Customer tableBetter security- splitting data into table means certain tables can be made confidential, when a person logs onto the system they can be limited to the tables they can view
-E.g. a receptionist would be able to view employee contact details but not salaryFuture proofing- having data held is separate tables means it is simple to add records that are not yet needed but may be in the future
-E.g. city table could expand to include every city and town in the country, even though no other records are using hem all as yet. A flat file database cannot do this
Key Fields

-Above, the role in the film links to a particular artist to a particular film and the tables reflect this
-Primary key in tblArtist is ArtistID
-ArtistID is a foreign key in tblRole_in_Film
-ArstisID link the two tables tblArtist and tblRole_in_Film
Primary Key
-Uniquely identifies each record in a table (entity), it must follow the following characteristics:
-Each table in the relational database must contain only one primary key
-Primary key cannot contain a null value
-Primary key must be unique
Foreign Key
-Used to create a relation between two tables
-Exists as a primary key in another table
-Links a record in the primary table to a record in the link table
Structured Query Language (SQL)
-A language used for querying and updating database tables in a relational database
-A SELECT statement is used to extract a collection of fields from one or more tables in a database
-Syntax of the statement is:
-SELECT→ list of fields to be displayed
-FROM→ list the table or tables where the data will come from
-WHERE→ list of search criteria
-ORBER BY→ list the fields that the results are to be sorted on (default is ascending)
Example 1
SELECT PetName, Type, Gender, Breed
FROM Animal
WHERE (Type=”dog” OR Type = “rabbit”) AND (Gender = “M”)
ORDER BY Breed
Will return male those a dog or a rabbit, male and show their name, type, gender and breed
-To display all fields in the records that satisfy given criteria, use an asterisk instead of displaying each field:
SELECT *
FROM Animal
WHERE(Type = “dog” OR Type = “rabbit”) AND (Gender = “M”)
ORDER BY Breed DESC
Conditions in SQL
Symbol | Meaning | Example |
= | Equal to | Type = “dog” |
> | Greater than | Cost >3000.00 |
< | Less than | Distance <2.5 |
<> | Not equal to | Type <> “dog” |
>= | Greater than or equal to | DateOfBirth>=#01/01/2019# |
<= | Less than or equal to | DateOfBirth<=#31/12/2018# |
IN | Equal to a value within a set of values | TypeIn(“dog”,”cat”,”rabbit”) |
BETWEEN…AND | Within a range, including the two values which define the limits | DateOfBirth BETWEEN #01/01/2019# AND #31/12/2018# |
IS NULL | Field does not contain a value | DateOfBirth IS NULL |
AND | Both expressions must be true for the expression to be judged true | Type = “dog” AND gender= “M” |
OR | If either or both expressions are true, the expression is judged true | Type= “dog” OR Type = “rabbit” |
NOT | Inverts truth | Type NOT IN (“dog”,”cat”) |
Retrieving data from two tables
-Using SQL, you can combine data from two tables by specifying which data the table is held in
-SQL uses the syntax tablename.fieldname to specify the field
-Example: Write an SQL query to find the Title, Initial, Surname and phone number each cat owner, together with the names of the cats that belong to each owner.
SELECT Title, Initial, Surname, Phone, PetName
FROM Owner, Animal
WHERE (Owner.OwnderID=Animal.OwnerID) and (Type = “cat”)
-Example: Write an SQL statement to find the name and type of each animal owned by Mr Fell, who has an owner ID of C177 Display Mr Fell’s title, surname and phone number, pet name and type in the results table. Records should be displayed in ascending order of type of pet
SELECT Title, Surname, Phone, PetName, Type
FROM Owner, Animal
WHERE (Owner.OwnerID = Animal.OwnerID) and (Animal.OwnerID= “C177”)
ORDER BY Type
Using SQL to insert data into a relational database
-SQL INSERT INTO statement is used to insert a new record into a database table. The syntax is:
INSERT INTO tableName (column1, column2,…)
VALUES (value1, value2,…)
-Example: Insert a record for a new owner, ID C200, Mrs Khama, 6 Birch Avenue, Ipswich into the Owner table of the database, Mrs Khama’s initial and telephone number are not known
INSERT INTO Owner (OwnerID, Title, Surname, Address1, Address2)
VALUES(“C200”, “Mrs”, “Khama”, “6 Birch Avenue”, “Ipswich”)
-Note if all fields are being added in the correct order, it is not necessary to specify the field names
Using SQL to update data in a relational database
-SQL UPDATE satement is used to amend a record in a database table. The syntas is:
UPDATE tableName
SET column1= value1, column2= value2,…
WHERE column = value
-Example: Update the record for OwnerID C177, Mr Fell who has changed his address to 3 Cobbold Lane and his phone number to 21443 917612
UPDATE Owner
SET Address1 = “3 Cobbold Lane”, Phone= “ 21443 917612”
WHERE OwnerID= “C177”
Using SQL to delete data in a relational database
-The SQL DELETE statement is used to delete a record from a database table. The syntax is:
DELETE FROM tableName
WHERE column = value
-Example: delete the record for AnimalID 1456, Maddie the rabbit
DELETE FROM Animal
WHERE AnimalId= 1456
Section 8- Ethical, Legal and Environmental Impacts of Digital Technology
Ethical impacts of technology on society
Social Media:
-Social media apps such as Facebook, Twitter, YouTube and Pinterest have hundreds of millions of active followers, typically using a smartphone or other mobile device to log on and hundreds of thousands post regularly for the benefit of their followers with many earning money in the process
-People of all ages use social media apps to keep in touch with friends and family, order good or taxis, book holidays, tickets to events or hotel rooms, etc…
Trolling of public figures
-Online abuse has become increasingly common, causing depression, fear and suicide
-Trolls often target public figures such as pop stars, campaigners and Members of Parliment with cruel, threatening homophobic or sexist comments
Computers in healthcare:
-As well as the administrative tasks that computers perform, they are used for example to monitor patients, administer drugs, and diagnose illnesses
-165,000 health-related apps which run on one or both of the two main smart-phone operating systems, Apple’s iOS and Google’s Android
-As these apps are becoming more popular, there are concerns that some health apps may be sharing patients’ health data without their knowledge
Computer-based implants
-Used in many different fields of medicine:
-Cochlear implants have been successful in restoring partial hearing to profoundly deaf people
-Heart implants may include electrodes for regulating heartbeat, warn of heart attacks and monitor the effects of treatment
-A quadriplegic man, Erik Sorto, had electrodes implanted in his brain which enables him to control a robotic arm, getting it to bring a cup to his mount simply by thinking about doing it
Risks of computer-based implants:
-Many implanted devices need to be capable of being reprogrammed, and they have to collect monitoring data from the patients which can be read by medical staff
-Theoretically, it is possible for a malicious person to hack into an implanted device and collect data illegally, or even reprogram it to harm or jill the patient
Wearable Technologies:
-Dozens of different fitness and health monitoring devices on the market today which can measure calories burned, blood pressure, heart rate, sleep patterns and more
-Many fitness trackers’ privacy policies are vaguely stated in phrases such as “We respect your privacy…… We may share your information with third parties….” and under current legislation, it would not be illegal for them to do so
-Debate over who owns the data- the wearer or the business that compiles the data?
-By default, privacy setting are frequently set to ‘public’, allowing profiles to be found in search results so users should take care to reset the privacy settings unless they wish to share info with others
-Latest wearable technologies include items that can:
-Be worn as a wristwatch and monitor your movements, number of steps, time spent sleeping, sitting or standing and the advise you ‘how to live better’
-Be worn by a swimmer, attached to swimming goggles on the back of the head and measure kick- turn times, breath counts and stroke efficiency
-Tighten your trainers around your feet automatically at the touch of a button, like Nike’s replica Marty McFly’s MAG trainers
-Some of these devices, as well as your mobile phone, enable your movements to be tracked by your friends and family, or by complete strangers without your knowledge
Autonomous Vehicles
-Robots are being used to replace humans in many occupations
-Driverless cars are already being tested on Britain’s roads
-Car manufactures claim that these vehicles could improve road safety, ease traffic and improve fuel efficiency but they also raise important legal and ethical dilemas
Ethical dilemmas in programming autonomous vehicles
-If someone is hurt or killed by a driverless car, is it the manufacturers, owners or person in charge of the cars’ fault?
-These vehicles must be programmed to act in a certain way for the numerous scenarios they may face
-Car companies have carried out surveys involving millions of people to find out what people regard as the most ethical decision and the general responses are:
-Save a person rather than an animal
-Save a group of two or more people rather than a single person
-In world wide surveys, researchers found that Westerners generally prioritised the lives of children whereas Eastern countries such as Japan prioritised old people
-One cluster of respondents showed a preference for saving women over men
-In answer to a different question, respondents in another group were asked to choose between saving a homeless person or an executive:
-People from countries such as Colombia, with significant economic difference, prioritised executives over homeless people
-People from Finland, with a small economic difference, showed little preference for either option
-It appears morals change across cultures
-Another survey response indicated people would want an autonomous vehicle to prioritise pedestrians, even if it meant sacrificing its passengers, but they would not personally buy a vehicle that acted like that
Mobile Technologies:
-Refers to technology that is portable. Examples include:
-Laptop and tablet computers
-Smartphones
-GPS devices
-Wireless debit/credit card payment terminals
-Wearable technologies
-Uses of laptop and tablet computers can increase productivity in a work environment
-Ideal for delivering presentations or for keeping in touch via email while away from the office
-Development of cloud storage has led to greatly increased usage of mobile devices, since software, data and services can be accessed wherever there is an Internet connection
Issues
-A laptop may be stolen, or left somewhere by accident
-A hacker may be able to gain access to sensitive data on a laptop
-If public Wi-Fi connection is used, communications may be hacked
-A laptop owner is responsible for managing passwords, anti-virus and anti- malware protection and other safety measures
-Holding personal data and apps on the same machine as business applications may result in malware being unwittingly downloaded from an insecure or unreliable website
Environmental impacts of technology on society
Computers
-Include carbon footprint and waste products that result from manufacturing computer systems
-The negative effects are often outwieghed by the positive effects on the environment of using computerised systems to manage processes that might otherwise generate more pollutions
-Coniderations may include:
-Does a comouter system mean people can work from home and therefore drive less?
-Has computer technology led to a ‘throw-away society’, with huge waste dumps of unwnated products which are thwon away rather than repaired or upgraded?
-Is working at home more environmentally friendly friendly than everyone working in a big office, in terms of shared heating and lighting?
-Do computer-managed engines work more efficiently, create less pollution and use less fuel?
Waste
-Many devices are now only desirable for a few short years before being discared for the latest tech
-Are they recyclable or turning into a huge pile of waste containing dangerous chemicals which could leach into the ground of water supplies?
-Computer-aided manufacturing can result in more and cheaper products but does this mean more waste?
-Disposable cofee cups are cheap to make due to modern technology but are largely unrecyclable
Monitoring the Environment
-Computers are widely used for monitoring the environment including factors such as quality water quality and air quality and also radiation monitoring and warnings
-Dat a collected about weather, volcanic activity and movement beneath the earth’s surface, people can be warned about impending disasters such as hurricanes and earthquakes and move to safety
Cloud Storage
-Uses vast amounts of energy to keep its storage equipment running and cooling systems also use massive amounts of water and energy
-Generally much more energy efficient than storing all data in an organisations own data storage centre
-An organisation’s data centre must be up and running 24/7 while its actual usage may be 15%
-Large-scale cloud providers allow organisation to use fewer servers and therfore less energy
-Specially designed cloud data centres use optimsed equipment and sophisticated cooling equipment, making them more efficient and can result in significant energy savings
-Cloud storage enables many employees to work from home part time, saving carbon emissions arising from commuting daily to work
-Many cloud providers are committed to reducing the environmental impacts of usign their technology
-Data centres may be powered by wind and solar power alongside non-renewable energy sources
-Google and Amazon purchase almost 100% renewable energy
-Microsoft has reduced the huge amount of water used in cooling systems by designing air cooling systems
Wireless networking
-Local area network can be either wired or wireless
-Using wireless network means there is no need for cabling and people can log on from any device
-Wireless networks are less secure and the danger of being hacked is increased as messages can be intercepted by a hacker or a ‘worm’ (type of malware) can infiltrate your computer from another device connected to the same network
Smart Cities
-Wireless networking is being used in the development of ‘smart cities’, with technology being used to improve the running of urban areas
-Includes everything from identifying
Legislation and Privacy
-The law can affect the way that computer systems are developed, used, disposed of, etc…
General Data Protection Regulation (GDPR)
-In 2018, thes regulations replaced the Data Protection Act 1998 and contain a set of key principles that must be followed by all organistion holding personal data and is designed to protect people’s personal data
-These are the principles of the Act:
-Fair, lawful and transparent processing. Personal data must be processed lawfully and fairly fro the purpose it was acquired, and with the individual’s consent
-Purpose limitation. Data must only be collected for specified, explicit and legitimate purposes
-Data minimization. Data must be adequate, relevant and not excessive, and must not be retained longer than necessary
-Accuracy. Data must be accurate and up-to-date
-Data retention periods. Data must not be retained longer than necessay. In addition, if a person asks for it to be erased, it must be securely deleted or destroyed
-Data security. Data must be kept secure. This, including protection against unauthorised or unlaqful processing and against accidental loss, destrution or damage.
-Accountability. Data controllers must be able to prove that their data protection measures are suficient. Appropriate technical and and organisational measures must be in place
-Must conside the implications of this legislation
-Organisations must make sure that the data they hold is accurate. Inaccurate data about a person’s credit rating , for example, can have very serious consequences for an individual
The Computer Misuse Act 1910
-Has 3 main principles, primarliy designed to prevent unauthorised access or ‘hacking’ or programs or data
-Recognises the following new offences:
-Unauthorised access to computer material
-Unauthorised access with intent to commit or facilitate a crime
-Unauthorised modification of computer material
-Making, supplying or obtaining anything which can be used in computer misuse offences
Privacy Issues
-Predicted that small computers will become embedded in everything from clothes to beermats.
-We will be interfacing with computers in everuthing we do, from meeting chip-wearing strangers to entering smart buildings or sitting on a smart sofa, and each of these interfaces will end up on a database
-Google collects and stores data about millions of emails every day
-Oranisations including governments and security agencies, collect hige amounts of data about private citizens, often supplied by Internet companises such as Googole, as well as telephone companies
-Qith the aim of detecting terrorists or othe illegal activities, the US Government collects, stores and omitors metadata about all electronic communications in the US.
-Metadata includes imformation such as the telphone number called, date, time and duration of the cll
-In one month in 2013, the unit collected data on more than 97 billion emailsand 124 billion phone calls from around the world
-Edward Snowden is a famous ‘whistle-blower’ who informed the world about these pracctices
Hacking
-Unauthorised access to a computer system, private network or communcations over the Internet for an illicit purpose such as stealing or destroying personal data
-May be caried out through a phishing attack, or planting malware on a compuer
-Using information gained in this awy, a hacker may be able to:
-access your usernames and passwords
-access your bank account and steal money
-make purchases using stolen credit card details
-sell your information to other criminals who intend to use it for illicit purposes
-use your identity to apply for other credit cards, loans and bank accounts, etc…
Data privacy issues
-Cyber-attacks sometimes result in the personal data of millions of people being compromised
-Under GDPR, companies with comuter systems that store any personal data must have processes and security mechanism in place desined to meet this requirement
-Found that personal data has been compromised, companies can be fined up to 4% of their annual global turnover
Encrypted Communications
-Bnaks and many other organisations use the HTTPS protocol to esnure that communications to and form customers or othe annot be understood even if it is hacked
-WhatsApp is free and seay to used and isused by 1.5 billion worldwide
-WhatsApp used end-to-end encryption to ensure that during transmission, only, and the person you are communicating with, can read what is sent. Currently in Russia and China
-Ability to send encrypted texts may be particularly important to prominent citizens such a politicians, musicians, film starts and royalty whose communications have on many occasions been hacked by newspapers and details of their private lives splashed acoss the headlines
-Governments and security services in many countries, including UK, are concerned with keeping their citizens safe from terroist attacks and criminal activity so they need a ‘backdoor’ so that it can monitor people’s cnoversation
-Current Home Secretary stated: “The use of end-toend encryption in this wa has the potential to have serious consequences for the vital work which companies already undertake to identify and remove child abuse and terroirst content”
-Tech companies rejet this, arguing providng a backdoor woudl potentially enable it to be opened by anyone
Logic Gates
Boolean Gates Symbols:




Boolean Expressions:
-AND = ‘.’ (mulitiplication)
-OR = ‘+’ (addition)
-XOR = ‘⊕’
-NOT gate = “Ā” (an overbar)
-E.g. b.c+ā means b OR c AND NOT a
Syntax and Logic Errors
-A syntax error is an error that breaks the grammatical rules of a programming language and stops it from running
-Examples inlcude:
-Typos and spelling errors
-Missing or extra brackets and quotes
-Incorrectly nested loops
-A logic error is where the incorrent code is used that causes the program to run, but produces an incorrect output or result
-One way to identify logic erros is through the use of trace tables
-Examples include:
-Incorrect use of operations (such as using < instead of >)
-Looping too many times
-Indexing arrays incorrectly
Fundamentals of Algorithms
Representing Algorithms
-Alogrithms are step by step instuctions in order to produce a solution to a problem
-Decompostion is the process of breaking down large problems into a set of smaller, more manageable promblems
-Abstraction is the process of removing unecessary data from a problem
AQA Pseudocode common syntax’s:
-Output = OUTPUT("Hello")
-Input = Fname ← USERINPUT
-Selection = IF num = 2 THEN … ELSE IF num < 4 THEN … ENDIF
-For Loops = FOR i ← 1 to 10 … ENDWHILE
Algorithm Inputs, Processes and Outputs:
-An input is data or information being entered/ taken into the program before it is processed into the algorithm
-A process is a doing action performed in the algorithm which transforms inputs into desired outputs. The CPU (Central Processing Unit) executes this process
-An output is the result of processing in an algorithm and displays something to the user
Tracing Algorithms
—A trace table is used to trace through and algorithm and test algorithms and programs for logic errors