FlashKeepers

Databases · College · College and University

PostgreSQL Fundamentals

PostgreSQL data types, JSONB, indexes, MVCC, vacuum, extensions, psql commands, roles and replication basics.

About this set

39 basic cards for College Databases. It opens with "What is the SERIAL data type in PostgreSQL?" and "When should you use BIGSERIAL instead of SERIAL?". Study it alongside the other College sets below.

39 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is the SERIAL data type in PostgreSQL?
Show answerAn auto-incrementing integer, starting from 1 by default with each insert.
When should you use BIGSERIAL instead of SERIAL?
Show answerWhen you need auto-incrementing integers larger than SERIAL can handle, using 8 bytes instead of 4.
What is the difference between TEXT and VARCHAR in PostgreSQL?
Show answerTEXT has no length limit; VARCHAR(n) enforces a maximum length of n characters.
What is NUMERIC data type used for?
Show answerFixed-point decimal numbers with arbitrary precision, ideal for financial values.
When would you choose FLOAT over NUMERIC?
Show answerFor approximate values where speed matters more than exactness, like scientific calculations.
What boolean literal values does PostgreSQL accept?
Show answerTRUE/FALSE, YES/NO, ON/OFF, 1/0 (case-insensitive).
What does the DATE data type store?
Show answerOnly the year, month, and day without time information, occupying 4 bytes.
What is the difference between TIMESTAMP and TIMESTAMP WITH TIME ZONE?
Show answerTIMESTAMP stores local date and time; TIMESTAMP WITH TIME ZONE includes timezone offset.
How do you declare an array of integers in PostgreSQL?
Show answerUse INTEGER[] or INTEGER ARRAY syntax.
What is JSONB in PostgreSQL?
Show answerJSON data type stored in a decomposed binary format, allowing indexing and efficient querying.
What is the main difference between JSON and JSONB?
Show answerJSON stores text and preserves whitespace; JSONB stores binary format and allows indexing.
What does the @> operator do with JSONB?
Show answerTests whether the left JSONB contains the right JSONB as a subset.
How do you create an index on a JSONB column?
Show answerUse GIN index: CREATE INDEX idx ON table USING GIN (jsonb_column);
What does the jsonb_agg function do?
Show answerAggregates multiple values into a JSONB array.
Why are indexes important in PostgreSQL?
Show answerIndexes speed up data retrieval by allowing the database to find rows without scanning the entire table.

24 more cards in the app

Study this set free