Section 4 - Exchanging Data Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

SQL

What does SQL stand for?

A

Structured Query Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SQL

What type of language is SQL and what is it used for?

A

A declarative
language used for querying and updating tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SQL

Name each statement used in SQL

4 statements

A
  • SELECT
  • FROM
  • WHERE
  • ORDER BY
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SQL

What does the SELECT statement do?

A

List the fields to be displayed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL

What does the FROM statement do?

A

List the table or tables the data will come from

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SQL

What does the WHERE statement do?

A

List the search criteria

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SQL

What does the ORDER BY statement do?

A

List the fields that the results are to be sorted on (default is Ascending order)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SQL

Name each condition used in SQL

A
  • Python conditions
  • IN
  • LIKE
  • BETWEEN…AND
  • IS NULL
  • AND
  • OR
  • NOT

Python conditions: =, >, <, !=, >=, <=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SQL

What does the IN condition do?

A

Equal to a value within a
set of values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SQL

What does the LIKE condition do?

A

Similar to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SQL

What does the IS NULL condition do?

A

Field does not contain
a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SQL

What does the BETWEEN…AND condition do?

A

Within a range, including
the two values which
define the limits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SQL

What does the AND condition do?

A

Both expressions must
be true for the entire
expression to be judged
true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

SQL

What does the OR condition do?

A

If either or both of the
expressions are true,
the entire expression is
judged true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

SQL

What does the NOT condition do?

A

Inverts truth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SQL

What does the JOIN statement do?

A

Provides an alternative method of combining rows from two or more tables, based on a common field between them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

SQL

How do you combine data with the JOIN statement?

A

SELECT Song.SongTitle, Artist.ArtistName, Song.MusicType
FROM Song
JOIN Artist
ON Song.ArtistID = Artist.ArtistID
WHERE Song.MusicType = “Art Pop”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

SQL

How do you combine data without the JOIN statement?

A

SELECT Song.SongTitle, Artist.ArtistName, Song.MusicType
FROM Song, Artist
WHERE (Song.ArtistID = Artist.ArtistID) AND (Song.MusicType = “Art Pop”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Compression, Encryption and Hashing

What are the two types of compression?

A

Lossy and Lossless

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Compression, Encryption and Hashing

What are the differences between lossless and lossy compression?

A
  • Data lost in lossy, none lost in lossless
  • Lossy compression cannot be done on text, but lossless compression can be on done any file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Compression, Encryption and Hashing

What are the two algorithms used for compression?

A
  1. Run Length Encoding
  2. Dictionary-Based Encoding
22
Q

Compression, Encryption and Hashing

What is Run Length Encoding?

A

A form of lossless compression that compresses data by specifying the number of times a character/pixel colour repeats followed by the value of the character/pixel

23
Q

Compression, Encryption and Hashing

What is Dictionary-Based Encoding?

A

A form of lossless compression that compactly represents repeated values to represent information without copying data

24
Q

Compression, Encryption and Hashing

What are the two types of encryption?

A

Symmetric and Asymmetric

25
Q

Compression, Encryption and Hashing

What is symmetric encryption?

A

Uuses the same key to encrypt and
decrypt data, which is sent with the encrypted data

26
Q

Compression, Encryption and Hashing

What is asymmetric encryption?

A

Uses different keys to encrypt and decrypt data - a public key and a private key respectively.

27
Q

Compression, Encryption and Hashing

What is hasing?

A

A mapping between an arbitrary length input and a usually fixed length or
smaller output
This is one way

28
Q

Compression, Encryption and Hashing

What is hasing used for?

A
  • Storing passwords in a database
  • Hash tables
29
Q

Database Concepts

What is a relational database?

A

Multiple linked tables

30
Q

Database Concepts

What is a flat-file database?

A

Single table

31
Q

Database Concepts

What are the advantages/disadvantages of a flat-file database compared to a relational database?

A
  • Takes longer to search
  • Bigger
  • Harder to maintain
32
Q

Database Concepts

What are the four key types?

A
  1. Primary key
  2. Secondary key
  3. Foreign key
  4. Composite key
33
Q

Database Concepts

What is a primary key?

A

Unique value/indentifier that identifies a particular record
(primary keys are always underlined in the entity description)

34
Q

Database Concepts

What is a foreign key?

A

Link to a different table’s primary key

35
Q

Database Concepts

What is a composite key?

A

A combination of two keys
(A foreign and primary combo is called a composite primary key)

36
Q

Database Concepts

Draw out an entity relationship diagram for:
* one-to-one
* one-to-many
* many-to-many

A

Check textbook page 84
(search 93)

37
Q

Database Concepts

What are the features of 1st Normal Form (1NF)?

A
  • Data is atomic
  • No repeated groups of attributes
38
Q

Database Concepts

What are the features of 2nd Normal Form (2NF)?

A
  • No partial dependencies
39
Q

Database Concepts

What are the features of 3rd Normal Form (3NF)?

A
  • No non-key dependencies
40
Q

Transaction Processing

What is referential integrity?

A

No foreign key in one table can reference a non-existent record in a related table

41
Q

Transaction Processing

What are the ACID principles?

A
  • Atomicity: each transaction must fully complete
  • Consistency: data stays consistent before and after the transaction (relates to referential integrity)
  • Isolation: one transaction will not interfere with another transaction (relates to record locking)
  • Durability: transactions saved after crashes
42
Q

Transaction Processing

What is record locking?

A

The prevention of simultaneous access to objects in a database in order to prevent updates being lost/overwritten
Anyone else attempting to retrieve the same record is denied access until the transaction is completed or cancelled

43
Q

Transaction Processing

What is redundancy in a database?

A

Repeated copies of database information to prevent the loss of data
If one system fails, the backup system automatically takes over and processing can continue

44
Q

Transaction Processing

What are the different ways of capturing data?

A
  • Web forms
  • Manually
  • Optical Character Recognition (OCR)
  • Magnetic Ink Character Recognition (MICR)
  • Smart card readers
  • Scanners
45
Q

Transaction Processing

What are the two ways of storing data?

A
  • XML
  • JSON

There are many other ways, but these two are the most memorable

46
Q

Database Concepts

What is a secondary key?

A

An identifier other than the primary key that identifies a record
* Useful for indexing commonly searched-for records (e.g. surname)
(secondary keys are always in italics in the entity description)

47
Q

Database Concepts

What is an entity?

A

A category of object, person, event, or thing of interest about which data needs to be recorded

An entity could be club members or concert venues

48
Q

Database Concepts

How do you write an entity description?

A

Entity (data1, data2, …)
Example: Customer (custID, title, forename, surname, email)

49
Q

Database Concepts

Which record is the primary key?
Product (productID, title, subject, level, price)

A

productID

50
Q

Database Concepts

Which records are the composite primary key?
OrderLine (OrderNumber, OrderLine, ProductID, ProductName)

A

OrderNumber, OrderLine

51
Q

Database Concepts

How is a relation formed between entities?

A

At least one entity must contain a foreign key for the other entity
A foreign key always goes on the “many” side of a relationship

e.g. custID from Customer in the entity description of Subscription

52
Q

Database Concepts

Can entities with a many-to-many relation be directly linked?

A

No
A link table must be placed between them
This link table is always on the “many” side of the relation, with the original two tables becoming a “one” side of this new relation