Databases Flashcards

1
Q

What would happen without an index?

A

Index is a data structure that optimizes search. Absence of index make search engine do a plain scan of all elements of the table to find rows matching the predicate

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

Delete duplicate values in a SQL table

A

Self join + delete where fields are equal and right id is greater the left
or
Use row_number over partition by target fields

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