Data Management Flashcards

1
Q

Operating System

A

Intermediary between software and hardware, managing hardware allocation.

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

UNIX Philosophy

A
  1. Each program does 1 thing well
  2. Output of every program expected to be input of another
  3. Try software early, expect wasted effort
  4. Use tools to help program over unskilled help
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Linux Benefits

A
  1. Largely virus free as limited user system access + not many viruses are made for Linux
  2. Kernel separate from rest of OS preventing bugs elsewhere in OS from crashing whole system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Index Node (inode)

A

Describes a file-system object (file/directory). Stores attributes and location of data (metadata).

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

Inode number

A

References an inode. Associated with a file object name.

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

Separating metadata benefits.

A
  1. Allows for fast moving of files
  2. Can alter file while opened by another applicaiton.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

pwd

A

Gives the current absolute path.

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

ls

A

Lists the files at the current location.

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

cd

A

Move Directory

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

Meaning of UNIX files starting with a dot?

A

They are hidden.

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

man

A

man [cmd] - Gives help with command.

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

mkdir

A

mkdir [directory name] - Creates a directory(folder)

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

rmdir

A

rmdir [directory name] - removes a directory. Must be empty

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

touch

A

touch [filename] - creates empty file.

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

cat

A

displays the contents of entire file

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

less

A

Displays part of file allowing for forwards and backwards movement.

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

head

UNIX

A

Top (default) 10 lines of file

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

tail

A

Bottom (default) 10 lines of file

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

program to program piping

A

program1 | program2 (program 1 output goes to program2 input)

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

program to file piping

A

program > file - program output written to file. > > used to append (no space)

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

file to program piping

A

program < file - program takes input from file

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

filter

A

Program that accepts text and changes it

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

pipe

A

Connection between two filters

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

wc

A

Prints the number of lines, words and characters

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

uniq

A

Removes duplicate adjacent lines

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

Version Control System

A

Records changes to files over time so they can be undone and viewed

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

Local VCS

A

Database on your computer holds all the changes. Does not allow collaboration

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

Centralised VCS

A

Single server stores changes, with users checking out files. Allows for collaboration but single point of failure

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

Distributed VCS

A

Changes (repository) stored in server and locally, with changes copied to each other.

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

VCS add

A

put file in local repository

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

VCS commit

A

commit changes to file to local repository

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

VCS commit message

A

Message describing a commit

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

VCS check in/push

A

Upload local repository content to remote repository

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

VCS check out/pull

A

Download file from remote repository

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

Conflict

A

When changes made cannot be merged automatically, resolved by manually applying changes to latest version

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

reverse integration

A

Copies new features from a branch to main. keeps new code out of main

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

Forward Integration

A

Copies latest changes from main to branch, keeping branch up to date

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

ps

A

Views current processes

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

top

A

CPU usage of processes

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

kill | UNIX

A

kill <PID> PID is process ID
options:
SIGTERM - requests process to stop, time for graceful shutdown
SIGKILL - forces process to stop execution</PID>

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

bg/fg

UNIX

A

Moves a process to the background/foregorund

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

screen

UNIX

A

Allows for creation of screens to run processes in the background

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

Environment Variables

A

Accessible by all processes run in the shell

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

PATH

A

Ordered List of directories that store executables to be run

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

export

A

Sets environment variables export variableName=’value’. Gives all environment variables if no argument

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

grep

A

Searches for lines containg the given input. grep
[pattern] [input]

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

Special Characters

Regular Expressions (grep)

A

* - zero or more of previous
? - zero or one of previous
+ - one or more of previous
. - wildcard
[] - range of characters

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

sed

A

Takes in text and modifies it. sed [command] [file]. commands e.g. ‘s/Hello/Hi/g’ (replaces first Hello on each line with Hi, g means it affects every instance on a line), ‘/Run/d’ (deletes all lines that contain Run)

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

awk

A

Allows for processing of tables. awk [pattern] {action}. By default actions are run on every line. $number used to give column

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

BEGIN

for awk

A

action run once at the start

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

END

for awk

A

action run once at the end

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

applying conditions

for awk

A

(condition){action}, action only run on lines that meet condition

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

LaTeX benefits over Word

A
  1. Easily allows for displaying of complex equations
  2. Can compile large documents easily
  3. Placement of figures and tables is easy
  4. Automatic referencing
  5. OS independant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

Creating LaTeX documents

A

Typed as a .tex file and the LaTeX engine compiles to .pdf

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

Math Mode

LaTeX

A

Open and close with $. Allows for mathematical symbols

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

Wildcards

UNIX

A

Allows for operating on multiple files at once
* Any characters
? Any singular character
[] One character out of those given

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

chmod

UNIX

A

Changes permssions for files/directories. If using number each number represents 3 digit binary

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

ls -l permission information

A

first column shows permission infromation as 10 character string. First character shows directory/file, then split into 3 character chunks for each accessor (owner, group and other). The three characters represent whether the file/directory is readable/writable/executable.

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

Directory Permissions

UNIX

A

Executable directories can be opened

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

TSV

A

Tab Seperated values, form of structured data

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

Benefits of machine readable data

A
  • Searching
  • aggregation and summation
  • Prediction
  • Linking - links info from different sources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

Relationship Modelling

A

A way to make human data machine readable. Involves creating a model that shows relationships between elements

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

Hierarchical

Ralationship Modelling

A

Entities are connected with each other and attributes in a tree structure

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

Network

Relationship Modelling

A

Entities and attributes are connected in a directional graph.

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

Object Oriented

Relationship Modelling

A

Entities and attributes are connected in a directional graph. Additionally, Entities are classes, with attributes values coming with a pointer to the attribute

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

Entity Relational

Relationship Modelling

A

Entites are now tables. They are linked by a key property

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

Markup

A

Addition of metadata to document. Allows for structure and additional meaning to text. Allows for machine to gleam meaning from text

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

YAML

A

Uses whitespace for structure to allow for easy reading but harder writing. Written with key-value pairs, i.e. variableName: data

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

Uses of YAML

A
  • Config Files
  • Passing data between application
  • Storing simple application states
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

Issues with YAML

A

The syntax can be ambiguous, so may get different results with different parsers (code that splits up text). Not widely used

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

JSON

A

Stores objects. Subset of YAML. Can be read by most languages. Contains:
* Objects
* Values - “object”: “value”
* Lists - “object”: [value1, value2]

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

JSON uses

A

Sending data on the web/between programs. Sometimes used for config data

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

HTML

A

A markup language used for documents with hypertext (links). Tags say how to display data i.e. <text> TEXT HERE <\text>

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

Liquid | structured data

A

Markup language for Shopify

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

SGML

Markup

A

Standard Generalised Markup Language - A standard for defining markup languages. Super set of all markup languages e.g. XML, HTML

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

SGML issues

Markup

A
  • complex
  • no strict structure
  • Requires a definition of structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
77
Q

XML benefits

Markup

A
  • Easier to parse
  • Simplifies SGML
  • Don’t need to define structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
78
Q

XML

Markup

A

eXtensible Markup Language - Hierarchical with only tags, attributes and content. Made to carry data not display data. No defined tags

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

XML Syntax

Markup

A

Defines how it is written:
* closing tags for all tags
* case sensitive
* must have root element
* attributes are quoted

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

Schema

XML

A

Used as a template to ensure an XML file is written in a certain way

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

SimpleType

XML element

A

Only contains text

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

ComplexType

XML element

A

Can contain attributes and children

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

Namespaces

XML

A

Gives a prefix to tags with the same name, allowing for distinguishing between tags with the same name. xmlns:<localname>=”someurl”. Then all tags in the namespace have <localname>:tag

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

XML + CSS

A

Can apply a stylesheet to add presentation to the XML file

85
Q

XPath

A

XML path language. The way to query data from an XML file

86
Q

/path/to/element

XPath

A

Gives the node at the path given

87
Q

//

XPath

A

Gets all nodes with that match

88
Q

*

XPath

A

Matches any node

89
Q

@attribute

XPath

A

Gets nodes with the given attribute. i.e. //tag[@attribute = ‘value’]

90
Q

text()

XPath

A

Gets the text directly inside of the node

91
Q

node[n]

XPath

A

Gets the nth occurence of that node

92
Q

node[last()]

XPath

A

Gets the last occurence of that node

93
Q

node1[node2]

XPath

A

Gets node1s that contain a node2

94
Q

node1[@attribute=”value”]

XPath

A

Gets node1s with the given attribute being equal to the given value

95
Q

..

XPath

A

Gets the parent of the current node

96
Q

and/or/not

XPath

A

used in square brackets, also use brackets

97
Q

|

XPath

A

Gets both the nodes returned from the query on the left and right

98
Q

contains(location, “text”)

XPath

A

Used in square brackets, true for nodes containing the given text in the given location. location examples: @attribute, text()

99
Q

string-length(string)

XPath

A

Gets the length of the given string

100
Q

starts-with(location, “text”)

A

True if the location (attribute/text) starts with the text.

101
Q

ends-with(string, “text”)

A

True if the string ends with the text.

102
Q

DBMS

A

Database Managment System - Collection of software that manages a database

103
Q

Data Independance

A

Idea that other applications and users should be insulated from data structure (logical independace) and storage (physical independance).

104
Q

Logical Independance

A

Protection from changes to logical structure of data i.e. the schema of it

105
Q

Physical independance

A

Protection from changes to physical storage of data i.e. whether it’s stored on a hard drive

106
Q

Data Model

A

Defines how data is represented, organised and structured. Relational model is most widely used. Has a data language containing DDL and DML

107
Q

Data Language

A

used to modify and retrieve data. Contains data definition language (DDL) and data manipulation langage (DML)

108
Q

DDL

A

Data definition language - syntax for describing database templates. Includes creating tables and defining keys e.g. XML schema

109
Q

DML

A

Data manipulation language - used for querying data e.g. XPath

110
Q

Relation

Relational Database Model

A

A table, formally defined in set theory R ⊆ P(S1 × S2)

111
Q

k-tuple

relations

A

ordered sequence of k elements

112
Q

k-ary relation

relations

A

unordered subset of cartesion product of k sets(attributes). Contains many k-tuples. An instance of a k-ary relation schema

113
Q

k-ary relation schema

relations

A

An ordered sequence of k-attributes. A template for a k-ary relation

114
Q

relational database schema

relations

A

set of relation schemas

115
Q

relational database instance

relations

A

set of relations, each of which being an instance of a relation schema. Called a database

116
Q

Intension

relations

A

schemas. Changes rarely

117
Q

Extension

relations

A

instances i.e. relations

118
Q

Key

A

A set of attributes which is unique for all tuples. Can be made by combining attributes

119
Q

Functional Dependancy

A

A relation r satisfies a functional dependancy A -> B if all tuples in r with the same value for attributes in A have the same value for attributes in B. Allows deduction of value of B for a given value of A

120
Q

Determinant

Functional Dependancy

A

The set of attributes on the left hand side of a functional dependancy

121
Q

Dependant Set

Functional Dependancy

A

The set of attributes on the right hand side of a functional dependancy

122
Q

Splitting/Combining Rule

Functional Dependacy

A

A -> B is equivalent to A -> every element of B

123
Q

Trivial Dependancy

Functional Dependancy

A

If B ⊆ A then A -> B

Obvious as e.g. if height and weight known, then height known

124
Q

Implication

Functional Dependancy

A

Some functional dependancies S ⊨ (implies) A -> B if every relation instance that satisfies S also satisfies A -> B. A relation that fits the requirements for all of S also follows A -> B

125
Q

Equivalence

Functional Dependancy

A

S is equivalent to T if S ⊨ T and T ⊨ S

126
Q

superkey

A

If the attribute(s) are the determinant for every attribute. The set of all attributes is always a superkey

127
Q

Surrogate Key

Database

A

Uniquely identifies each attribute, created for this purpose

128
Q

Candidate Key

A

A superkey that has no other superkey included in it. e.g. if {height, weight} and {height} were superkeys, only {height} would be a candidate key

129
Q

Closure Algorithm

Functional Dependancy

A

Determines if a set of attributes is a superkey. Steps:
1. Get a dependant set that can be reached with the current attributes
2. If there are no new attributes in any dependant sets, the original attributes are not a superkey so stop
3. Else, union the current attributes with the dependant set
4. Repeat 1-3 until the current attributes is the set of all attributes

130
Q

Poor Relation

Functional Dependancy

A

Poor relation if X -> A and X is not a super key as it can lead to redundant data

131
Q

Anomalies

Databases

A

Issues that can happen in a bad database:
* Redundancy - same data in multiple places
* Updates - updates can cause data to be inconsistent
* Inserts - Forced to fill in extra irrelevant attributes
* Deletion - Extra data that wasn’t intended to be deleted deleted

132
Q

0th Normal Form

Databases

A

Unormalised, all data stored in one table

133
Q

1st Normal Form

Databases

A
  • Cannot have multiple values for one attribute
  • Cannot have the same attribute in multiple columns
134
Q

Minimal Set of Functional Dependancies

A
  • Each FD has 1 attribute on the right hand side
  • Minimal amount of attributes on the left hand side
  • No redundant FDs, i.e. implied by other FDs
135
Q

Partial Key Dependancy

Normalisation

A

Where an attribute only depends on part of any candidate key

136
Q

2nd Normal Form

Databases

A
  • 1st Normal Form
  • All attributes not part of any candidate key are dependant on all parts of all candidate keys
137
Q

1st Normal Form Creation

Databases

A

Take the illegal data and place it in a new table using the key

138
Q

2nd Normal Form Creation

Databases

A

If values (not part of any candidate keys) only depend on (need to be determined) part of the candidate keys then split into tables with the key being the depended on attributes

139
Q

3rd Normal Form

Databases

A
  • 2nd Normal Form
  • All non-key attributes are only determined by the keys, not anything else
140
Q

3rd Normal Form Creation

Databases

A

If a non-superkey attribute depends on non-super key attribute(s) place the depended on attribute as the key for a new table with the attributes that depend on it

141
Q

Boyce-Codd Normal Form

Databases

A
  • 3rd Normal Form
  • Every determinant is a candidate key
142
Q

Boyce-Codd Normal Form Creation

Databases

A

If a functional dependancy exists with the determinant being non-key, a new table is made with the key being the non-key determinant

143
Q

Normalisation Benefits

A
  • Less Redundancy, so less storage
  • More efficient to query
  • No duplication so no inconsistency
144
Q

Relation

Databases

A

A collection of tuples. Visually represented as a table

145
Q

Relationship

Databases

A

A link between relations

146
Q

Conceptual Modelling

Databases

A

Type of modelling that Identifies entity names and relationships, sometimes attributes. Made from requirements directly. No database design.

147
Q

Logical Modelling

Databases

A

Type of modelling that identifies attributes and attribute types(e.g. int)

148
Q

Physical Modelling

Databases

A

Type of modelling Aiming to represent database structure. Has actual tables and attributes. Implements relationships, i.e. keys, join tables, indexes

149
Q

SQLite Benifits

A
  • Serverless
  • No configuration
150
Q

SQLite issues

A
  • Not multi-user
  • No concurrency
  • Just a file
151
Q

creating a table

SQL

A

CREATE TABLE table
(
column TYPE (NOT) NULL,

PRIMARY KEY (column,…)
)

152
Q

types

SQL

A

INTEGER
REAL
TEXT
BLOB - any uninterpretable data, e.g. image
NULL

153
Q

Renaming a table

SQL

A

ALTER TABLE oldTable
RENAME TO newTable

154
Q

Deleting a table

SQL

A

DROP TABLE table

155
Q

Retrieving data

SQL

A

Done with SELECT column,… followed by FROM tables and then any number of optional further constraints.

156
Q

ORDER BY

SQL

A

ORDER BY column ASC/DESC

157
Q

LIMIT

SQL

A

LIMIT x. Result only shows the frist x results

158
Q

WHERE

SQL

A

WHERE condition. Result only shows the rows that match the given condition. At most basic level is column = value. Can use AND, OR and NOT, comparison(>), !=.

159
Q

LIKE

SQL

A

Used in a WHERE condition when using % is a string as a wildcard. e.g. WHERE id LIKE ‘%1%’

160
Q

(NOT) IN

SQL

A

Used in a WHERE condition when checking if the column values is in a given list. e.g. WHERE id NOT IN (1,3,5)

161
Q

JOIN

SQL

A

Allows for selecting data from multiple tables. Done with: JOIN table2 ON table1.foreignkey=table2.primarykey. If primary key composite must use ON for every column in the primary key

162
Q

LEFT JOIN

SQL

A

Returns all combined rows and the rows from the first table that do not match a row in the second table. e.g. first table people and second table banks, if a person has a bank not in the second table still display that persons row

163
Q

using multiple tables in SQL statement

SQL

A

must reference columns by their table. e.g. table1.column

164
Q

AS

SQL renaming

A

SELECT table.column1 AS column1, table2.column2 AS column2. Allows for renaming of columns for a query

165
Q

INSERT

SQL

A

INSERT INTO table (column,…)
VALUES (value,…)
Adds an entry to the table. The list of columns can be omitted if the entry has values for all columns. Can use a SELECT query in place of VALUES

166
Q

View

SQL

A

Acts as a virtual table. Is a query allowing for data to be seen from tables in a specific way but does not store any data it self

167
Q

View Commands

SQL

A

CREATE VIEW view AS SELECT …
DROP VIEW view

168
Q

UPDATE

SQL

A

Specifies new values for columns in the table.
UPDATE table
SET column=value…
WHERE conditions
WHERE statement determines which rows the changed will be applied to but is optional

169
Q

DELETE

SQL

A

DELETE FROM table
WHERE conditions
WHERE statement determines which rows will be deleted but is optional

170
Q

functions

SQL

A

Allows for applying many different opertaions to a database. Replaces a column after SELECT.i.e. SELECT function(column) FROM table

171
Q

GROUP BY

SQL

A

Allows for function output for rows with the same given column value to have the function applied to separately. e.g. SELECT student, avg(mark) FROM scores GROUP BY student gives the average mark of each student rather than the total average mark

172
Q

defining foreign keys

SQL

A

In CREATE TABLE:
FOREIGN KEY (column) REFERENCES table(column)
This ensures that any values in the current table in the foreign key column is in the other table

173
Q

Ensuring Referential Integrity

SQL

A

Add actions when doing CREATE TABLE after a FOREIGN KEY
ON DELETE action - happens when parent record deleted
ON UPDATE action - happens when parent key updated

174
Q

actions

SQL foreign key referencing

A

CASCADE - delete/update happens to current table
RESTRICT - prevent delete/update
SET DEFAULT - change value to default
SET NULL - change value to NULL

175
Q

Index

SQL

A

Data structure associated with a table to improve query speed. Ordered by value of a key accessed regularly (think of it being stored in a binary tree). Increases table modifaction time

176
Q

CREATE

SQL Index

A

CREATE (UNIQUE) INDEX index
ON table(column,…)
UNIQUE ensures only 1 entry of each value will be in the index, is optional

177
Q

Relational Databases Limitations

A
  • Inflexible - changing requirements are tough and e.g. lists are hard to do
  • ACID costs - limits performance and scalability
  • JOINs complexity - creates complex queries
  • Structure issues - Optional data makes bad tables
178
Q

Vertical Scaling

Databases

A

Add more capacity to the server, not great as has a limit and is expensive. Relational databases have to mainly use this

179
Q

Horizontal Scaling

Databases

A
  • Replication - duplicate data to be stored on many server, expensive and has synchronisation issues
  • Partitioning - store parts of the database on many server, prevents joins across tabls in different servers
  • Both not good
180
Q

NoSQL

Databases

A

Not Only SQL. Can use SQL languages on their databases. Less strict schemas.

181
Q

Document

Type Of NoSQL

A

Typically JSON/BSON. Schema free (mostly?). Structured as a tree with nodes being documents

182
Q

Key-Value

Type Of NoSQL

A

Contains keys that are linked to values. Often contains partition keys, splits data into partitions, and sort key, gives a single entry

183
Q

Column

Type Of NoSQL

A

A row represents an entry but only has columns where there is data for it. Like RDBMS and Key-Value

184
Q

Graph

Type Of NoSQL

A

Entries represented as nodes with edges connexting the data together

185
Q

Sharding

NoSQL

A

Distributing data across multiple nodes, allows for easy scaling

186
Q

Hot Partition

NoSQL

A

When one databse is overloaded with traffic while others are underused

187
Q

Consistency Levels

Databses

A

strict/strong - all reads must wait for writes to be consistent
sequential - all writes happen in order
causal - opertations that can change the outcome of each other happen in order
eventual - data will eventually be stored correctly

188
Q

CAP

databases

A

consistency - all users see the same data
availabilty - all users can always get a response
partition tolerance - the database works if communication breaks between nodes

189
Q

CAP theorem

databases

A

For databases with data split across multiple servers only 2 of the three attributes of CAP can be met

190
Q

NoSQL Advantages

A
  • fast and simple
  • Flexible structure choices
  • Easily scale horizontally infinately
191
Q

NoSQL Issues

A
  • Design has to be done right early
  • Can only access data in the way it’s designed
  • Functions are very difficult to use
  • Changes later on get very expensive
192
Q

MongoDB

NoSQL

A

Document-based using JSON/BSON documents. The documents are key value pairs, but MongoDB is not a key-value type database. Can have schema

193
Q

MongoDB relationships

NoSQL

A

Can add sections to certain documents referencing another document

194
Q

MongoDB Indexes

NoSQL

A

Needed to allow for searching by certain fields and/or sorting by them

195
Q

DynamoDB

NoSQL

A

AWS key-value based serverless NoSQL database. Everything stored in 1 table

196
Q

DynamoDB issues

NoSQL

A
  • Only allows basic lookups
  • The data has to be modelled specifically for this purpose, so difficult to leave
197
Q

DynamoDB secondary indexes

NoSQL

A

Replace the partition and/or sort key automatically with a secondary index allowing for entries to be searched by some of it’s data.

198
Q

DTD

XML

A

Document Type Definition - Defines the structure of an XML document. (kinda like a schema)

199
Q

XSD

XML

A

XML Schema Definition - Using XML defines a structure for an XML document.

200
Q

XML Suite

XML

A

Syntax - How XML is written
Namespaces - Gives IDs to tags to make them unique
Schema - Defines how an XML document is structured
XPATH - Finds data in an XML document

201
Q

Schema Benefits

XML

A
  • Ensures valid file
  • Can be used as template
  • Identifies errors
  • Eases Parsing
202
Q

Normalisation Issues

A
  • More Complex
  • More tables/relationships
  • Longer Queries
203
Q

Denormalisation

A

Improves query speed by adding data to uneeded location but increases operation complexity

204
Q

Identifying/non-identifying

Databases

A

When a foreign key is/is not part of the primary key of a child table

205
Q

Cardinality

Databases

A

Maximum number of times an entity can be related to another entity

206
Q

Modality

Databases

A

Minimum number of times an entity can be rated to another

207
Q

Turning on foreign key constraints

SQL

A

PRAGMA foreign_keys = ON;
Ensures that values in a foreign key must be in the table that it is referencing

208
Q

OS Potential Features

A
  • Multi-user - Allows for multiple people to use a computer concurrently/at different times
  • Multi-processing - Utilizing multiple processors
  • Multi-tasking - Running multiple processes at the same time
209
Q

~

UNIX

A

Used in a file path to go to the home directory e.g. ~/downloads