SQL Data Definition and Manipulation Concepts

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

1/42

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards defining fundamental SQL concepts, database objects, data types, constraints, and referential actions based on the lecture notes.

43 Terms

1
New cards

SQL

Structured Query Language: the standard query language for relational databases.

2
New cards

Fourth-generation language (4GL)

A language where you describe what you want, not how to get it.

3
New cards

Transform-oriented language

A language that uses relations to transform inputs into required outputs.

4
New cards

DDL (Data Definition Language)

Creates database objects (tables, indexes, views) and defines access rights to them; acts on structure.

5
New cards

DML (Data Manipulation Language)

Inserts, updates, deletes and retrieves data in tables; acts on rows.

6
New cards

DCL (Data Control Language)

Controls access to database objects (includes commands like GRANT and REVOKE).

7
New cards

TCL (Transaction Control Language)

Commands run within a transaction (includes commands like COMMIT and ROLLBACK).

8
New cards

Transaction

A logical unit of work made of one or more SQL statements, defined by business rules.

9
New cards

Reserved words

SQL command words, which you should avoid using as names (such as order).

10
New cards

Schema

A logical container for database objects such as tables, views and triggers, created for a user or set of users.

11
New cards

dbo

The default schema for database objects in SQL Server (for example, the schema prefix in dbo.DH_Branch).

12
New cards

SSMS

SQL Server Management Studio, the program used to work with SQL Server.

13
New cards

Server roles

Privileges such as creating or deleting databases and tables, and disk administration.

14
New cards

Backup devices

Configured database backup destinations listed under Server Objects in SSMS.

15
New cards

Linked servers

Other database servers connected to the current database server.

16
New cards

Table

The primary object in a relational database, and the implementation of a relation from the relational model.

17
New cards

CHAR(n)

Fixed-length text, used when every value has the same length (such as a two-letter state code CHAR(2)).

18
New cards

VARCHAR(n)

Variable-length text up to n characters, such as last_name VARCHAR(15).

19
New cards

VARCHAR(max)

Text up to 2312^{31} characters, used for long comments.

20
New cards

DECIMAL(L, D)

Exact decimal numbers, also called NUMERIC, where L is precision and D is scale (e.g., DECIMAL(7,2)).

21
New cards

Precision (L)

In DECIMAL(L, D), the total number of digits on both sides of the decimal point.

22
New cards

Scale (D)

In DECIMAL(L, D), the number of digits to the right of the decimal point.

23
New cards

INT

Data type for whole numbers, such as person_id INT.

24
New cards

DATE

Data type that stores a date without time, formatted as YYYY-MM-DD.

25
New cards

DATETIME

Data type that stores both a date and a time, such as a timestamp.

26
New cards

BIT

Boolean data type where 0 = false and 1 = true, such as an active flag.

27
New cards

Null

A special value for data that is unknown or does not exist (not the same as blank).

28
New cards

NOT NULL

A constraint that excludes nulls from a column; SQL Server rejects any attempt to store one.

29
New cards

Entity integrity

The rule that a primary key must hold a unique, non-null value in every record.

30
New cards

Required data constraint

An integrity constraint ensuring a column must have a value; enforced using NOT NULL.

31
New cards

Domain constraint

An integrity constraint ensuring column values fall within a valid set; enforced using CHECK.

32
New cards

Entity integrity constraint

An integrity constraint ensuring each row has a unique, non-null identifier; enforced using PRIMARY KEY.

33
New cards

Referential integrity constraint

An integrity constraint ensuring a foreign key matches a primary key in another table; enforced using FOREIGN KEY … REFERENCES.

34
New cards

General (other) constraints

Integrity constraints enforcing additional business rules such as uniqueness; uses UNIQUE and DEFAULT.

35
New cards

Column constraint

A constraint written with the column's definition that covers just one column.

36
New cards

Table constraint

A constraint written after all columns are defined that covers one or more columns (required for composite keys).

37
New cards

NO ACTION

The default referential action where deleting or updating a parent key is rejected if child rows still match it.

38
New cards

CASCADE

A referential action that deletes or updates the parent and automatically applies that operation to matching child rows down the chain.

39
New cards

SET NULL

A referential action that deletes or updates the parent and sets the child table's foreign key values to NULL (requires the foreign key to allow nulls).

40
New cards

SET DEFAULT

A referential action that deletes or updates the parent and sets the child table's foreign key to its defined default value.

41
New cards

UNIQUE

A constraint that ensures uniqueness across a column or set of columns, accommodating values that must not repeat outside the primary key.

42
New cards

DEFAULT

A constraint that automatically sets a column's value when none is specified in an INSERT statement.

43
New cards

Bridge table

An intermediary table whose composite primary key combines the primary keys of two parent tables to resolve a many-to-many (M:N\text{M:N}) relationship.