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
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