The flashcards below were created by user
esmenikmati
on FreezingBlue Flashcards.
-
-
Database
Organizational data in a central location
-
DBA
Installs, Administers, Maintains DB's
-
Database Apps
Interface that allows users to interact wtih the DB
-
DBMS
Handles all routine operations
-
Entity
Object about which you want to store data
-
1st Normal Form (1NF)
Data organized to have a primary key and no repeating groups
-
-
Key Fields
Establish relationships among records in different tables
-
N:M Relationships
An instance can occur multiple times in each entity
-
1:M Relationship
Instance can appear once in one entity, and multiple times in another
-
1:1 Relationship
Instance can occur once in each entity
-
Personal DB
DBMS and apps run on the same workstation and appear as a single application
-
Primary Key
Column that must be unique for each row, identifies that row
-
Relational Database
Stores data in a tabular format
-
Relationship
Link that shows how different records are related
-
Second Normal Form (2NF)
1NF + No partial Dependencies
-
Sequence
Lists of numbers the DB automatically generates, guarantees each PK is unique
-
Surrogate Key
Artifical PK, made just to be a PK
-
Third Normal Form (3NF)
2NF + No Transitive Dependencies
-
CHAR
fixed-length up to 2,000 characters
-
Constraint
Rules that restrict data values that you can enter into a column
-
Data Definition Language (DDL)
- Create new objects
- Modify/Delete existing objects
-
Data Manipulation Language (DML)
Insert/Update/Delete/View Database data
-
DATE
Stores dates from 12/31/4712 BC to 12/31/4712 AD
-
Fixed-Point Number
- Contains specific number of decimal places
- (Floating point contains variable number of decimal places)
-
Integer
whole number, no digits
-
Integrity Constraint
Define Primary, Foreign keys
-
NUMBER
- stores negative/positive/fixed/floating numbers between
- 10^-130 and 10^125
- Precision up to 38 decimal places
-
Restricted Action
can only modify the table in certain situations
-
SQL
Query language for relational databases
-
TIMESTAMP
stores fractional seconds, century, year, month, day, hour, minute, second
-
User Schema
- User's area of the DB
- Stores all user-created objects
-
Value constraints
Specific to the column
-
VARCHAR2
Stores variable-length characters up to 4,000 characters
-
View
- Object based on an actual table
- Enables DBMS to present the table in different formats
-
Action Query
- DML command
- inserts/updates/deletes data
-
Alias
alternate name for a column
-
Complex Search Condition
combines AND, OR, NOT
-
Group Function
Performs operation on a group of rows and returns single result
-
Inner Join
Joins two tables based on values in one table being equal to those of another
-
Join
Combines data from multiple tables using foreign key references
-
Linesize
- Specifies how many characters appear on display line
- Property of SQL*Plus
-
Nested Query
Main query and one or more subqueries
-
Outer Join
Returns all the rows from one table, plus matching rows from a second table
-
Pagesize
How many lines appear on an SQL*Plus page
-
PseudoColumn
acts like a column, is actually a command
-
Query
DML command that allows users to view data
-
Savepoint
- Designates beginning of an individual section of a transaction
- is a bookmark
-
Single-Row Functions
Built-In functions that return a single result for each row of data retrieved
-
Table alias
Alternate name that you assign within the FROM clause
-
Transaction
Series of actions that represent a logical unit of work
-
Truncate
Removes all of a table's data without saving any rollback info
-
Composite Variable
References a data structure that contains multiple scalar variables
-
Concatenating
joins two separate strings
-
Cursor
Points to a memory location on the database server that the DBMS uses to process a query
-
Data Structure
Object containing multiple elements
-
Declaration section
begins with DECLARE
-
Exception
an unwanted event
-
Execution Section
Begins with BEGIN
-
Explicit Cursor
Retriesves/Displays data in PL/SQL programs for a query that might receive multiple records or none at all
-
Function
- Receives one or more parameters
- Returns single output value
-
Implicit Cursor
points to a context area and parsed representation of the query
-
Logic Error
Doesn't stop program, but produces incorrect result
-
Output Buffer
Area on the server that stores output values before they're displayed to the user
-
Parse
- Separate a single string into two separate strings
- Using commas or spaces
-
Posttest Loop
- Executes one or more program commands
- THEN evaluates exit condition
-
Predefined Exception
most common errors
-
Procedural Programming Language
uses detailed, sequential instructions
-
Scalar Variables
reference a single value
-
Reference Variables
Directly reference a specific column/row and assume its data type
-
Strongly-Typed Language
Language in which each variable must be declared before it can be used
-
Syntax error
Occurs when command does not follow the guidelines of the programming language
-
Undefined Exceptions
- Less common
- Do not have predefined names
-
Anonymous PLSQL programs
do not interact with other program units
-
Composite Index
- table that contains multiple sorted columns to identify row location
- contains up to 16 columns
-
DB Objects node
- Top-level node within object navigator
- not associated with a specific form
-
DB Table Index
Contains data values along with corresponding column that specifies physical locations of records
-
Triggers
Program units that execute in response to insert/update/delete events
-
Package
Code library containing related program units and variables
-
Package body
contains commands to create program units that are declared
-
Package Specification
Declares package objects: variables, cursors, procedures, functions
-
Parameter Mode
Specifies how the program unit can change the parameter value (IN OUT)
-
PL/SQL Library
Operating System file that contains code for multiple related procedures and functions
-
Procedure
Program unit that can receive multiple parameters and return many or no values
-
Public Variables
visible to many programs
-
Row-Level triggers
Fire once for each row affected by the triggering statement
-
ROWID
specifies internal location of the record in the database
-
Server-side program units
stored on server, execute on server
-
Statement-level trigger
- Fires once
- either before or after trigger statement executes
-
Stored program units
- other PL/SQL programs can reference them
- other database users can execute
-
Trigger Level
Whether trigger fires once for each row or for the statement
-
Trigger Statement
- Defines type of SQL statement that causes a trigger to fire
- can be on INSERT, UPDATE, or DELETE
-
Trigger Timing
Defines whether trigger fires before or after SQL statement executes
-
Column constraints can be called
- a. during each column declaration
- b. at the end of the CREATE table command
-
Column Constraint declaration
CONSTRAINT constraint1 PRIMARY KEY
or at end of create table:
- CONSTRAINT constraint1 PRIMARY KEY (column1)
- PRIMARY KEY (column 1, column2)
-
Foreign Key declaration
FOREIGN KEY (column1) references table (constraint)
-
DROP TABLE syntax
DROP TABLE table1 CASCADE CONSTRAINTS;
-
RENAME TO syntax
RENAME table1 TO table2;
-
Add Columns syntax
- ALTER TABLE table1
- ADD (column NUMBER PRIMARY KEY);
-
Rename Columns syntax
- ALTER TABLE table1
- RENAME COLUMN column1 TO column2;
-
Change column data declaration syntax
- ALTER TABLE table1
- MODIFY (column1 CHAR);
-
Delete Column
- ALTER TABLE table1
- DELETE column column1;
-
Add or remove constraints syntax
- ALTER TABLE table1
- ADD CONSTRAINT name;
- [DROP CONSTRAINT name];
-
CURSOR declaration
- CURSOR cursor1 IS
- SELECT *
- FROM
- ;
-
Function/Procedure Declaration
- CREATE OR REPLACE FUNCTION[PROCEDURE]
- (parameter1 IN varchar2)
- RETURN number
- IS
- cnumber number;
- BEGIN
- RETURN;
- END;
-
Using cursors
- Open cursor1;
- Fetch cursor1 into variable1;
- If cursor1%NOTFOUND then exit;
- endif;
- close cursor1;
-
Creating a view
- CREATE VIEW view1 AS
- SELECT *
- FROM table;
DROP VIEW view1;
-
You can not use triggers on views
true
-
Creating Triggers
- CREATE OR REPLACE TRIGGER orders_before_insert
- BEFORE INSERT
- ON table
- FOR EACH ROW
-
Dropping a trigger
DROP TRIGGER trigger1;
-
Disabling/Enabling a trigger
- ALTER TRIGGER trigger1 DISABLE;
- ALTER TRIGGER trigger1 ENABLE;
-
Enabling all triggers for a table
ALTER TABLE table1 ENABLE ALL TRIGGERS;
-
GROUP BY
cannot use WHERE, must use HAVING
-
Creating an index
CREATE INDEX index1 ON table1 (column1);
|
|