Lecture 9 Flashcards

1
Q

alias

A

An alias is created in SQL to give a column or a table a temporary name during a query (good for code readability)

SELECT column_name AS alias_name

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

two main issues normalisation reduces

A

Redundant data

Anomalies (delete, insert and update irregularity, that generates the inconsistent data)

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

When normalising a database you should achieve four goals:

A
  • Arranging data into logical groups (such that each group describes a small part of the whole)
  • Minimizing the amount of duplicated data
  • Access and manipulate the data quickly and efficiently (without compromising the integrity of the data storage)
  • Organising the data such that, when you modify it, you make the changes in only one place

NOTE: Database designers refer to these goals in terms such as data integrity, referential integrity, or keyed data access

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

Un-normalised data

A

repeating groups, inconsistent data, delete and insert anomalies

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

Can you have an M relationship in relational database?

A

Short answer: NO, you need to break it down => normalised

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

4 types of NoSQL databases

A
  • Key-value databases
  • Column oriented databases
  • Document oriented databases
  • Graphs databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Key-value DB

A

Amazon

store data in a simple <key> : <value> format</value></key>

where key is used to retrieve the value from the table

The table contains many key spaces and each key space can have many identifiers to store key value pairs

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

Column-oriented DB

A

Google

It extends the previous model by allowing adding more columns to have wider table

Since the table is going to be very broad, it supports to group the column with a family name, call it “Column Family” or “Super Column”

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

Document-oriented DB

A

supports storing semi-structured data

The unit of data is called a “Document”
The table which contains a group of documents is called as a “Collection

Each document might contain a XML or even a Word Document

Document databases are suitable for web-based applications

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

Graph DB

A

highlighting the connection between the data

storing and performing data manipulation operations on nodes, relations and attributes of nodes and relations

the more relations the better

no foreign keys needed

Advantages

  • Better Performance: if data volume increases in a relationship DB the data increases (e.g. more foreign keys), while in the graph DB the connections stay the same

Flexibility: no complete model needed, you can add as you go along

Agility: aligns well with agile software development as they are incremental

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

pros of NoSQL

A

highly scalable,

provide better performance,

designed to store and process a significant amount of unstructured data at a speed 10 times faster than SQL one,

high availability and strong fail over capabilities

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

cons of NoSQL

A

There is no standard with the API that comes with the DB and each vendor has its own (while SQL is more stable)

Not all NoSQL DB support JOIN operations, these are core commands only in SQL DB (e.g. MongoDB does not have JOIN)

Weak security - this is an issue in any type of DB, however NoSQL security is very weak, Authentication and Encryption are almost non-existant, or weakly implemented

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

scalability: NoSQL vs. SQL

A

SQL vertically scalable – performances can be increased on a single server by adding better hardware power, e.g. better CPU, more RAM

NoSQL horizontally scalable: need more servers to handle traffic

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

Choosing SQL or NoSQL:

  • matury
  • compatibilty
  • cost-effective
  • flexibility
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly