Introduction to SQL – Vocabulary Flashcards

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/46

flashcard set

Earn XP

Description and Tags

These vocabulary flashcards summarize key SQL terms, commands, data types, operators, and constraints covered in the lecture notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

47 Terms

1
New cards

SQL (Structured Query Language)

A portable, easy-to-learn language used to define, manage, and query relational databases.

2
New cards

Data Definition Language (DDL)

SQL component used to create, alter, or remove database structures such as schemas, tables, and indexes.

3
New cards

Data Manipulation Language (DML)

SQL component used to retrieve and modify data with statements like SELECT, INSERT, UPDATE, and DELETE.

4
New cards

SQL Identifier

A name for database objects (table, column, view) that starts with a letter, contains letters/digits/underscores, has no spaces, and is ≤128 characters.

5
New cards

Character Data Type (CHAR / VARCHAR)

Stores a sequence of characters; defined as CHARACTER VARYING.

6
New cards

Bit Data Type (BIT)

Holds a fixed-length binary string; defined as BIT VARYING.

7
New cards

Exact Numeric Data Type

Stores numbers in decimal notation using NUMERIC or DECIMAL (precision, scale), or integers with INTEGER/INT and SMALLINT.

8
New cards

Approximate Numeric Data Type

Represents real numbers without exact precision using FLOAT, REAL, or DOUBLE PRECISION.

9
New cards

Datetime Data Types

DATE (year-month-day), TIME (hour-minute-second), and TIMESTAMP (date & time) with optional precision and time zone.

10
New cards

Interval Data Type

Represents a period of time; defined with INTERVAL and specified start/end fields such as YEAR TO MONTH.

11
New cards

Schema

A named collection of related database objects such as tables, views, and domains.

12
New cards

CREATE SCHEMA

DDL command: CREATE SCHEMA [name | AUTHORIZATION creator]; creates a new schema.

13
New cards

DROP SCHEMA

DDL command that removes a schema; RESTRICT fails if not empty, CASCADE drops all contained objects.

14
New cards

CREATE TABLE

DDL command to define a new table with columns, constraints, keys, and referential actions.

15
New cards

ALTER TABLE

DDL command to add or drop columns or constraints, or change defaults in an existing table.

16
New cards

DROP TABLE

DDL command that deletes a table; RESTRICT prevents drop if dependent objects exist, CASCADE removes dependents.

17
New cards

PRIMARY KEY

A column or set of columns that uniquely identifies each row in a table.

18
New cards

UNIQUE Constraint

Ensures all values in the specified column(s) are distinct but allows one NULL unless NOT NULL is also specified.

19
New cards

FOREIGN KEY

A column or set of columns in one table that refers to the PRIMARY KEY of another table.

20
New cards

ON DELETE / ON UPDATE

Referential actions (CASCADE, SET NULL, SET DEFAULT, NO ACTION) executed when parent rows are deleted or updated.

21
New cards

CASCADE (Referential Action)

Automatically propagates delete or update operations from the parent table to child rows.

22
New cards

RESTRICT

Prevents a DROP or DELETE/UPDATE if dependent objects or rows exist.

23
New cards

SET NULL

Referential action that sets child foreign-key values to NULL when the parent row is removed or updated.

24
New cards

SET DEFAULT

Referential action that assigns a predefined default value to child rows when the parent row changes.

25
New cards

CHECK Constraint

Validates column or table data against a Boolean condition during insert or update operations.

26
New cards

CREATE INDEX

DDL command: CREATE [UNIQUE] INDEX name ON table (column [ASC|DESC] …); speeds up data retrieval.

27
New cards

DROP INDEX

DDL command that removes an existing index from a table.

28
New cards

CREATE VIEW

DDL command: CREATE VIEW name AS subselect … ; stores a virtual table based on a query.

29
New cards

DROP VIEW

DDL command that removes a view; RESTRICT fails if dependents exist, CASCADE removes them.

30
New cards

Literal

A constant used in SQL. Non-numeric literals are in single quotes; numeric literals are not.

31
New cards

Comparison Operator

=,

32
New cards

Logical Operator

AND, OR, NOT; combine or negate conditions in search predicates.

33
New cards

BETWEEN

[NOT] BETWEEN value1 AND value2; tests whether a value falls within an inclusive range.

34
New cards

IN

[NOT] IN (value1, value2, …); tests membership of a value in a specified list.

35
New cards

LIKE

[NOT] LIKE pattern; performs pattern matching using % (any string) and _ (single character).

36
New cards

IS NULL

Tests whether a column value is NULL; IS NOT NULL tests the opposite.

37
New cards

SELECT Statement

Retrieves data: SELECT [DISTINCT|ALL] columns FROM table WHERE … GROUP BY … HAVING … ORDER BY …

38
New cards

DISTINCT

Keyword in SELECT that removes duplicate rows from the result set.

39
New cards

GROUP BY

Clause that groups rows sharing common values so aggregate functions can be applied to each group.

40
New cards

HAVING

Filters groups produced by GROUP BY based on a condition, often involving aggregates.

41
New cards

ORDER BY

Specifies the ordering of the query result set by one or more columns.

42
New cards

Aggregate Function

Operates on a set of rows: COUNT, SUM, AVG, MIN, MAX; often used with GROUP BY.

43
New cards

INSERT Statement

Adds new rows: INSERT INTO table [(columns)] VALUES (data_values).

44
New cards

UPDATE Statement

Modifies existing rows: UPDATE table SET column = value [, …] WHERE condition.

45
New cards

DELETE Statement

Removes rows: DELETE FROM table WHERE condition; omitting WHERE deletes all rows.

46
New cards

Index (Database)

A separate data structure that improves the speed of row retrieval at the cost of extra storage and maintenance.

47
New cards

ASC / DESC

Keywords that specify ascending or descending order when creating indexes or using ORDER BY.