Relational Database Management System - Advanced SQL & PL/SQL

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

1/49

flashcard set

Earn XP

Description and Tags

Comprehensive vocabulary flashcards covering Relational Database Management Systems (RDBMS) Unit 1 through Unit 4: Advanced SQL, PL/SQL block architecture, packages, database triggers, procedures, functions, exception handling, transaction management, cursor lifecycle, locking modes, and deadlock resolution.

50 Terms

1
New cards

PL/SQL

A block-structured procedural language extension to Structured Query Language (SQL) developed by Oracle Corporation in the early 1990s to add programming logic such as loops, conditions, and modular subprograms.

2
New cards

DECLARE Section

An optional starting section of a PL/SQL block used to declare local memory variables, constants, cursors, and user-defined exceptions.

3
New cards

BEGIN Section

A mandatory section of a PL/SQL block that contains the executable SQL statements and procedural code to perform the required operations.

4
New cards

EXCEPTION Section

An optional section within a PL/SQL block dedicated to catching and handling runtime errors that arise during code execution.

5
New cards

%TYPE Attribute

A PL/SQL declaration attribute used to define a variable with the exact data type of a database table column or another declared variable, ensuring automatic synchronization if the column definition changes.

6
New cards

BLOB (Binary Large Object)

An Oracle Large Object (LOB) data type that stores unstructured binary data, such as images, audio, video, PDFs, and executable files, up to 128 TB.

7
New cards

CLOB (Character Large Object)

An Oracle Large Object (LOB) data type that stores single-byte character text data, such as books, articles, and large documents, up to 128 TB.

8
New cards

NCLOB (National Character Large Object)

An Oracle Large Object (LOB) data type that stores large blocks of multilingual Unicode character data up to 128 TB.

9
New cards

BFILE (Binary File)

A read-only Oracle Large Object data type used to reference and access binary files stored outside the database operating system up to 8 TB.

10
New cards

DBMS_OUTPUT.PUT_LINE

An Oracle package procedure that outputs text messages to the screen during PL/SQL execution when SERVEROUTPUT is set to ON.

11
New cards

GOTO Statement

A sequential control statement that unconditionally transfers program execution to a specific labeled point enclosed in double angle brackets (<>).

12
New cards

View

A virtual logical table created from one or more base tables via a SELECT statement that stores no physical data itself and reflects updates to underlying tables dynamically.

13
New cards

Simple View

A view based on a single base table containing no DISTINCT keywords or group functions, allowing standard DML operations (INSERT, UPDATE, DELETE).

14
New cards

Complex View

A view based on multiple tables or joins that can contain group functions (SUM, AVG, COUNT, MAX, MIN) and DISTINCT, through which direct DML operations are not permitted.

15
New cards

Package

A schema object that groups logically related PL/SQL types, variables, constants, cursors, exceptions, procedures, and functions into a single named compilation unit.

16
New cards

Package Specification

The public interface component of a package that declares all items visible and callable from external PL/SQL blocks or applications.

17
New cards

Package Body

The implementation component of a package that defines the code for public subprograms declared in the specification and contains optional private subprograms hidden from external callers.

18
New cards

Public Objects

Package elements declared in the package specification that are globally visible and accessible to any external program unit with execute privileges.

19
New cards

Private Objects

Package components declared exclusively within the package body that encapsulate internal logic and cannot be seen or called outside the package.

20
New cards

RAISE_APPLICATION_ERROR

A built-in PL/SQL procedure that terminates the subprogram, rolls back database changes, and returns a custom error number (between -20000 and -20999) along with a user-defined message up to 2048 bytes.

21
New cards

Database Trigger

A stored PL/SQL block that automatically executes in response to a specific database event occurring on a table, such as an INSERT, UPDATE, or DELETE operation.

22
New cards

Row Trigger

A trigger declared with FOR EACH ROW that fires once for every individual row affected by the triggering DML statement, providing access to :OLD and :NEW values.

23
New cards

Statement Trigger

A trigger that executes once per DML statement regardless of how many rows are affected, lacking access to :OLD and :NEW qualifiers.

24
New cards

BEFORE Trigger

A trigger that executes prior to the triggering DML statement, primarily used to enforce business constraints, validate data, or alter :NEW values before insertion or update.

25
New cards

AFTER Trigger

A trigger that executes after the triggering DML action finishes successfully, commonly utilized for audit trails, logging, and secondary operations where :NEW values cannot be modified.

26
New cards

Stored Procedure

A standalone or packaged subprogram stored in the database that performs a specific action without directly returning a single scalar value, supporting IN, OUT, and IN OUT parameters.

27
New cards

Stored Function

A named PL/SQL subprogram stored in the database that executes a task and must return a single value to the calling environment via the RETURN statement.

28
New cards

IN Parameter

A parameter mode that passes a read-only constant value into a procedure or function that cannot be modified by the subprogram.

29
New cards

OUT Parameter

A parameter mode that returns an updated or computed value from a procedure back to the caller.

30
New cards

IN OUT Parameter

A parameter mode that passes an initial value into a procedure and returns a modified value back to the caller upon completion.

31
New cards

Predefined Exception

A standard error condition implicitly handled and recognized by Oracle with an internal number and system-assigned name, such as NO_DATA_FOUND, TOO_MANY_ROWS, or ZERO_DIVIDE.

32
New cards

PRAGMA EXCEPTION_INIT

A compiler directive used in the DECLARE section to associate an Oracle internal error number with a user-defined exception identifier.

33
New cards

Transaction

A logical unit of database work consisting of one or more related SQL statements treated as an indivisible unit ensuring Atomicity, Consistency, Isolation, and Durability (ACID).

34
New cards

COMMIT

A TCL statement that makes all data modifications in the current transaction permanent on disk, ends the transaction, and releases acquired locks.

35
New cards

ROLLBACK

A TCL command that undoes all pending changes made in the current transaction, cancels transaction modifications, and releases locks held.

36
New cards

SAVEPOINT

A designated milestone established inside a transaction allowing selective partial rollbacks to that marker without concluding the overall transaction.

37
New cards

Cursor

A temporary private work area allocated in memory by Oracle to parse and process SQL statements and hold active query result sets.

38
New cards

Active Data Set

The collection of rows satisfying a cursor's SELECT query, populated into server memory when an explicit cursor is opened.

39
New cards

Implicit Cursor

A cursor automatically generated and managed by Oracle whenever a single-row SELECT INTO or DML statement (INSERT, UPDATE, DELETE) is executed.

40
New cards

Explicit Cursor

A custom cursor declared, opened, fetched from, and closed by the programmer in PL/SQL to handle multi-row result sets row by row.

41
New cards

SQL%ROWCOUNT

An implicit cursor attribute that returns the total count of rows affected by the most recently executed DML command or query.

42
New cards

SQL%FOUND

A cursor attribute that evaluates to TRUE if the most recent SQL statement affected or returned at least one row, and FALSE otherwise.

43
New cards

Cursor FOR Loop

A looping structure that automates cursor handling by implicitly declaring a %ROWTYPE record, opening the cursor, fetching all rows one by one, and closing it when done.

44
New cards

Parameterized Cursor

An explicit cursor declared with formal parameters, allowing different argument values to be passed to its query filter each time the cursor is opened.

45
New cards

Shared Lock

A table lock mode associated with reading operations (SELECT) that allows concurrent reading by multiple sessions while restricting unauthorized modifications.

46
New cards

Exclusive Lock

The most restrictive lock mode acquired during DML write operations (INSERT, UPDATE, DELETE) or explicit table locks, completely barring conflicting modifications by other transactions.

47
New cards

SELECT FOR UPDATE

A SQL clause that queries specific table rows and locks them immediately to secure exclusive access until a COMMIT or ROLLBACK is issued.

48
New cards

FOR UPDATE NOWAIT

A locking option specifying that Oracle should check immediately for available row locks; if any requested row is locked, it aborts instantly with error ORA-00054 instead of queueing.

49
New cards

FOR UPDATE SKIP LOCKED

A concurrency mechanism for queue processing that evaluates rows dynamically and filters out locked rows, retrieving only unlocked records without waiting.

50
New cards

Deadlock

A concurrent execution impasse where two or more transactions hold resources that the other requires, resulting in an unresolvable circular wait detected by Oracle with error ORA-00060.