sql Flashcards

1
Q

format of inner join

A

SELECT column1, column2 FROM “table1”
INNER JOIN “table2”
ON “table1”.”column” = “table2”.”column”
WHERE condition
GROUP BY column
ORDER BY column ASC/DESC;

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

sql vs nosql database

A
  • sql req FIXED predefined schema whras nosql DH predefined schema (more dynamic)
  • in sql, data stored in tables w FIXED data type for each field whras for nosql, data is stored as collections of documents with NO fixed data type (X enforce constraints on data types)
  • sql is ACID, nosql is flexible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

when to choose sql

A

if ACID (atomicity, consistency, isolation, durability) compliance impt + flexibility X crucial factor

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

when to choose nosql

A

if flexibility impt (in adding/rmving data, when requirements of apps change over t)
+ horizontal scalibility (adding more comp) is a criteria (whr addition of low cost servers desired compared to replacing existing server w btr one) (or startups fast growing, need database to scale as they grow)

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

challenges when using NoSQL

A

NoSQL X enforce constraints :. more code validation needs to be implemented

higher chance of code duplication / harder to normalise data using NoSQL bc collections cannot be joined using a query :. need be more careful to avoid breaking data integrity

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