1.3 Exchanging data Flashcards
What is compression?
the process used to reduce storage space required by a file
What is the purpose of compression? (4)
-reduce file sizes
-reduce download times
-reduce storage requirements
-make best use of bandwidth (amount of data sent at a time)
What are the two categories of compression?
-lossy
-lossless
What do we mean by lossy compression?
a type of compression that reduces sizes of files by removing some of its information e.g. a more pixelated image/less clear audio recording
What type of files are used for lossy compression?
-sound files
-image files
What do we mean by lossless compression?
a type of compression where the original file can be recovered
What type of files are used for lossless compression?
-text files
-executable files
What are the two methods to use lossless compression?
-run length encoding
-dictionary encoding
What is run length encoding?
a form of lossless compression where repeated values are removed and replaced with the single data item followed by the number of times it should be repeated
e.g. AAAAABCCC would give A5B1C3
What is an inefficiency when using run length encoding?
-relies on consecutive pieces of data being the same
- little repetition = little reduction in file size
What is dictionary encoding?
a form of lossless compression which replaces commonly repeated data with an index and saves the compressed data together with a dictionary that links the frequently repeated data to their corresponding index
e.g. I 1
went 2
to 3
the 4
park 5
. 6
[space] 7
this dictionary would then help decode 17273747576
What is something to remember about dictionary encoding?
if the compressed data isn’t transferred alongside its dictionary, the data cannot be used
What do we mean by encryption?
the process of encoding a message so it can be read only the sender and the intended recipient
What do we mean by encoding a message?
converting the message from plain text to cyphertext
What are the two types of encryption?
-symmetric
-asymmetric
How does symmetric encryption work?
-both sender and receiver share the same private key
- key is used for both encrypting and decrypting data
How can symmetric encryption by intercepted? (2)
-interception of the key
-duplicating the key to have a copy
How does asymmetric encryption work?
-two keys used: public & private
-public key can be published anywhere but private must be secret (together known as a key pair)
-messages encrypted with public key can only be decrypted with the corresponding private key
What is hashing?
a process where an input (called a key) is turned into a fixed sized value (a hash)
How are keys turned into a hash?
uses algorithms called hash functions
What is something to know about hashing?
-one way process: the output of a hash function cant be reversed to form the key
-the key cant be reversed to gain the passwords
What are hash tables?
a data structure which holds key-value pairs
What do we mean by a collision?
when two keys produce a same hash
How can we overcome collisions?
-storing items in a list under a new hash value
-using a second hash function to generate a new hash
What would a good hashing function consist of? (4)
-low chance of collisions
-minor changes in data causing large changes to the hash
-quick to calculate
-provides smaller output compared to the input
What is a database?
an organised collection of data
What is an entity?
an item of interest about which information is stored
What is an attribute?
characteristics of an entity
What is a relational database?
a database which recognises the differences between entities by creating different tables for each entity
What is a table?
an entity/file
What is a record?
a row of data within a table
What is a field?
a column of data within a table
What is a flat file?
a database that only contains a single table
How are flat files written out?
Entity1(attribute1, attribute2, attribute3…)
What is a primary key?
a unique identifier for each record (row) in the table
What is a composite key?
a primary key composed of more than one attribute
What is a foreign key?
an attribute which links two tables together
- exists in one table as the primary key, acts as the foreign key in another
What does a secondary key do?
allows a database to be searched quickly
What are the different entity relationships possible? (3)
-one to one
-one to many
-many to many
Draw a diagram showing the entity relationships
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN0AAADkCAMAAAArb9FNAAABIFBMVEX///+j2XeZ0vL/j4Cm3Xmc1vf/lITZ3Nyal5xOUFDPzdCrqKaWk5HqgnRqMyuNwGNpk0Zhi6Nwn7gAAACCgoLv7++IiIjFxcWxsbGbn5+fnZtvcm10bm73iXred2md03FvcnOBtdKLS0JkQj5IWDxQcoVXdjxFVmDx8fG+vr7m5uaQwGk+Pj7f399eXl41NTVZWVmFsWElJSVISEhhgUctLS2fWVBoOjS/a2DSdmp3QjtskE95oVhMZTh8qsRfgpaPxeMUFBSYVUyvY1jGb2NYMSw4SylDWTErOR9OaDlIY3LFb2N/SUFJKSQ3Hhs+Ix9jKSArAABTFwtDYid0o0tpi00eKBaLuWUoNR0nQwRReSwqNz4kQVAiLjU4TVmm5P8oUfC8AAAI+klEQVR4nO2dC3uaSh6Hx6hQEbZHh1vdmKDnWEERvCtqFMXExprutSe729Z+/2+xg2lteyQmTkisOf83ahjgYX6vDIM+YQJCAAAAAAAAAAAAAAAAAPCEGBnj1mVcRn3CJI+AVZdtE+mopCNUKvlzqsSoIvlTIpYTWCfLSEmq7DcnFSwmRpizEvYYvbLNDEIKtkuNxpgo6phDqK7KDROXjHpC3HfW3VEweRmrlkwU66Lsl+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UGQqZrVvWjuK0FEOzK1BnyN1lR0uodrQhwA7swA7swA7swA7swA7swA7sHmgX/1bZlmrDs5OC7L6EiG8PQWE3HK6rGAYs/rrs43E4f+hgE0F26Zuq0/Ejd3i73s528WJ6NEqn3SPykyuSZ9x1c0dFd3M9rqE93I9NWMqmXXxJQvhVfsi5R7l4zo2T10IuBLv5KBefp4rx1HCZ/pSbj1KFwnL4KcAOIeL3sIt92KpVCWqZ8SIJUXDT6Q+pZa4wShXdYmq03NyJu7fMeG40T+WIXbrwuTiaFwqkluEyIACncKyMtQcML6ziJMspakDLjOdW9aaXn0fp0YfCPFWIf55vZt3drujmlqn0PLccLt1P6VEuN3fJbtzcd0tVVQ0ZWyo1SRNnDFXNBNiREMVRupD+4M6Ho3ku7RbJex5Gy3RHKddNuaOhO0wN4+kROepcd7jRKvyWWbGsh/1tfzV2Ug9omTk/xE0Et3A0SpMZbi4dQstcdcZx/zUev/l19MNZYm1XqVYfft2CYmrcbWeEmwiF4ZccAaeGxzubfwzB7cZv+9l88419CrvHPZvfjwOwg8+ZYAd2YAd2YAd2YAd2YAd2YPdUds/6apw0NeFdSbWkzpDabmfw1Gzf8A7o9Bn47XcQAAAAAAAAAADgT87/AeRJLmL4vsrtAAAAAElFTkSuQmCC
Describe the one-to-one entity relationship
each entity can only be linked to one other entity and vice versa
Describe the one-to-many entity relationship
one table can be associated with many other tables and vice versa
Describe the many-to-many entity relationship
when one or more items in one table can have a relationship to one or more items in another table and vice versa
What do we mean by normalisation?
the process of coming up with the best possible layout for a relational database
What are some things normalisation does?
-remove unnecessary duplicates
-consistent data throughout linked tables
-records can be added and removed without issues
-complex queries can be carried out
What are the types of normalisation?
-1NF (1st normal form)
-2NF (2nd normal form)
-3NF (3rd normal form)
What does 1NF do?
makes sure there’s no attribute that contains more than a single value
What does 2NF do?
makes sure that the relational database:
-hasno partial dependencies
-is in 1NF
What does 3NF do?
makes sure the relational database:
-is in 2NF
-contains no non-key dependencies (attributes which depend of value of primary key only)
What is indexing?
a method used to store the position of each record when ordered by a certain attribute
What is indexing used for?
to look up and access data from the database quickly
What is something to remember when indexing records?
the primary key is automatically indexed
How is data entered into databases?
-manually entered
-scanned
What is SQL?
a declarative language used to manipulate databases
- stands for structured query language
What are all the SQL commands? (9)
SELECT
FROM
WHERE
ORDER BY
JOIN
DELETE
INSERT INTO
DROP
CREATE