Bazy danych

 0    14 flashcards    pablojakub
download mp3 print play test yourself
 
Question Answer
Jaki operator służy do przepisywania zmiennej w PLPG SQL?
start learning
:=
Jaką klauzulą kończy się tworzenie funkcji w PLPG SQL?
start learning
$$ LANGUAGE PLPGSQL;
Jak wywołać zadeklarowaną funkcję "dodaj" z parametrem cena z tabeli filmu?
start learning
SELECT DODAJ(CENA, 10) FROM FILMY;
Jak usunąć perspektywę?
start learning
DROP VIEW nazwa_perspektywy
Jak dobrać kolejność kolumn w indeksie?
start learning
Najpierw kolumny z WHERE, potem z ORDER BY
Co daje dodanie DESC w indeksie
start learning
Pozwala uniknąć sortowania przy ORDER BY ... DESC.
Czym jest partial index?
start learning
Indeks z warunkiem WHERE, obejmuje tylko część danych.
Kiedy używać partial index?
start learning
Gdy filtr w zapytaniu jest stały (np. status = 'active').
Kiedy używać expression index?
start learning
Gdy w WHERE lub ORDER BY używasz funkcji (np. lower(email)).
Czym jest indeks haszowany?
start learning
CREATE INDEX idx_users_email_hash ON users USING HASH(email);
Korzysta się z niego tylko dla porównań równości.
Jak pobrać aktualną datę i czas w postgreSQL?
start learning
now()
Jak pobrać aktualną datę bez czasu w PostgresQL?
start learning
current_date
Jak wyciągnąć konkretną część daty w postgrę SQL?
start learning
EXTRACT(YEAR from now());
Kiedy indeks ma sens?
start learning
Only with high selectivity. For example, if the query you are asking for has 1 to 10 percent of data.
Otherwise you can do sequential scan.

You must sign in to write a comment