Database Flashcards

1
Q

Sql vs no sql

A

SQL databases are relational, offer strong consistency, and are suitable for structured data with fixed schemas.
* like a excel sheet

NoSQL databases are non-relational, provide scalability and flexibility, and excel with unstructured data or when scalability is a priority.
* document base, like analytics, logging

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

to write sargable queries

A

Search ARGument ABLE queries: (allow db engine use its ability to search)

1- avoid using functinos on indexed columns in where

2- use direct comparisons instead of wrapping into function

3- try to use computed column or function-based index instated of wrapping column into a function

non-sargable
~~~
WHERE YEAR(order_date) >= 2023
~~~

sargable
~~~
WHERE order_date >= ‘2023-01-01’
~~~

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

what’s elastic db and why we need it

A

it’s a text/json db

  • it writes data like a query (faster query)
  • it’s distributed , horizantly scalable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly