SQL & PostgreSQL Flash Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

flashcard set

Earn XP

Description and Tags

These flashcards are designed to cover key vocabulary and concepts related to SQL and PostgreSQL to aid in exam preparation.

Last updated 7:58 AM on 10/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

Relational Database

A database structured to recognize and manage relationships between data in tables.

2
New cards

Relational vs Non-Relational Databases

Relational databases (SQL) use structured data with tables and fixed schema, while Non-Relational databases (NoSQL) can store unstructured data like JSON and documents.

3
New cards

psql Command: \l

Lists all databases in PostgreSQL.

4
New cards

Creating a Table Command

CREATE TABLE table_name (…); Used to create a new table in SQL.

5
New cards

Foreign Key

A key that creates a relationship between two tables, linking a child table to a parent table.

6
New cards

Add a Column to a Table Command

ALTER TABLE tablename ADD COLUMN columnname data_type; Used to add a new column to an existing table.

7
New cards

One-to-Many Relationship (1-m)

A relationship where one record in Table A corresponds to multiple records in Table B.

8
New cards

What is a Query?

A request for specific data from a database, such as SELECT * FROM employees;.

9
New cards

Delete a Column Command

ALTER TABLE tablename DROP COLUMN columnname; Used to remove a column from a table.

10
New cards

PRIMARY KEY Constraint

Ensures that column values are unique, not NULL, and used to identify each row.

11
New cards

psql Command: \c

Connects to a specified database, such as \c mydatabase.

12
New cards

Composite Key

A key made of multiple columns that together uniquely identify a record, such as (CustomerID + OrderID).

13
New cards

Insert Data into a Table Command

INSERT INTO table_name VALUES (…); Used to add new data into a table.

14
New cards

Rename a Column Command

ALTER TABLE tablename RENAME COLUMN oldname TO new_name; Used to change the name of a column.

15
New cards

Delete All Records in a Table Command

DELETE FROM employees; Removes all rows from a table while keeping the table itself.

16
New cards

UNIQUE Constraint

Ensures all values in a column are unique, allowing NULLs unlike PRIMARY KEY.

17
New cards

Common Relational Databases

PostgreSQL, MySQL, SQLite.

18
New cards

One-to-One Relationship (1-1)

A relationship where one record in Table A corresponds to exactly one record in Table B.

19
New cards

List Tables in PostgreSQL Command

\d; Lists tables/relations in the current database.

20
New cards

Self Join

Joining a table with itself, such as relationships within an employee table.