Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
31 Cards in this Set
- Front
- Back
PRIMARY KEY |
Key that uniquely defines data in a table. Some times system-generated, synthetic or surrogate key. |
|
COMPOSITE PRIMARY KEY |
Primary key that uses more than one column, also called concatenated primary key. |
|
FOREIGN KEY |
Key that links tables together where one table it is the Primary Key and another it is not. |
|
NORMALIZATION |
to eliminate redundancy in tables, therefore avoiding any future data manipulation problems |
|
1st Normal Form |
All repeating groups must be removed and placed in a new table. |
|
2nd Normal Form |
All nonkey columns must depend on the entire primary key. |
|
3rd Normal Form |
Every non key column must be a fact about the primary key |
|
One to Many Relationship(1:M) |
Most common type. |
|
One to One Relationship(1:1) |
Exist but not typical |
|
Many to Many Relationship(M:M) |
Exists.. example is a book can have more than one author and an author can write more than one book. |
|
WHERE |
The WHERE clause, also called the predicate, provides the power to narrow down the scope of data retrieved. In fact, most SQL statements you write will probably contain a WHERE clause. |
|
SQL Comparison Operators |
=....................EQUAL !=,<>..............NOT EQUAL >,>=....................Greater than, Great than or Equal <,<=....................LESS than, LESS than or Equal Between/AND...Inclusive of two values LIKE....................Pattern matching with wildcard charaters % and_ IN (...)..................List of Values IS NULL...............Test for null values |
|
FUNCTIONS |
They can transform data in a way that is different from the way it is stored in the database. function_name(input_parameter) |
|
SYNTAX SYMBOLS |
[]...Square brackets enclose syntax options {}...Braces enclose items of which only one is required |....A vertical bar denotes options ... Three dots indicate that the preceding expression can be repeated Delimiters>>Delimiters other than brackets, braces, bars, or the three dots must be entered exactly as shown in the syntax. Commas, (). CAPS... Words in all capital letters indicate the Oracle keywords that identify the individual elements of the SQL command or function. UNDERLINE... Default values are underlined. |
|
LOWER FUNCTION |
The LOWER function transforms data into lowercase. Select state, LOWER(state),Lower('State') FROM zipcode; |
|
UPPER and INITCAP Functions |
The UPPER function does the opposite of the LOWER function. The INITCAP function capitalizes the first letter of every word and lower cases the rest of the word. |
|
LPAD and RPAD |
Places spaces or characters before or after. LPAD(char1, n [, char2]) RPAD(char1, n [, char2]) SELECT RPAD(city, 20, '*') City Name |
|
LTRIM, RTRIM, TRIM |
Opposite of LPAD AND RPAD, removes padding, characters, symbols from left, right, or both sides. LPAD(char1, n [, char2]) RPAD(char1, n [, char2]) TRIM([LEADING|TRAILING|BOTH] char1 FROM char2) |
|
SUBSTR Function |
Transforms a string, returning a substring or subset of a string. SUBSTR(char1, starting_position [, substring_length]) If the third parameter is not used, the default is to display the remainder of the string. If starting_position is negative start count from the end of the string. |
|
INSTR Function |
Looks for the occurance of a string inside another string, returning the starting position of the search string with the target string. It returns a number. INSTR(char1, char2 [,starting_position [, occurrence]]) INSTR can take two optional input parameters. The third parameter allows you to specify the start position for the search. The fourth parameter specifies which occurrence of the string to look for. When these optional parameters are not used, the default value is 1. |
|
LENGTH Function |
determines the length of a string |
|
USE of Function WHERE clause |
The use of functions is not restricted to the SELECT list; they are also used in other SQL clauses. In a WHERE clause, a function restricts the output to rows that only evaluate to the result of the function. |
|
REPLACE |
Replaces one string with another string REPLACE(char, if, then) |
|
TRANSLATE |
Unlike REPLACE, which replaces an entire string, the TRANSLATE function provides a one-for-one character substitution. TRANSLATE(char, if, then)Rischert, Alice (2009-08-12). |
|
SOUNDEX |
The SOUNDEX function allows you to compare differently spelled words that phonetically sound alike. |
|
ABS |
Computes the absolute value of a number, measuring magnitude. |
|
SIGN Function |
The SIGN function tells you the sign of a value, returning a number 1 for a positive number, –1 for a negative number, or 0 for zero. SIGN(value) |
|
ROUND and TRUNC Functions |
two useful functions that round and truncate (or cut off) values, respectively, based on a given number of digits of precision. ROUND(value [, precision]) TRUNC(value [, precision]) |
|
FLOOR and CEIL Functions |
The CEIL function returns the smallest integer greater than or equal to a value; the FLOOR function returns the largest integer equal to or less than a value. These functions perform much like the ROUND and TRUNC functions, without the optional precision parameter. FLOOR(value) CEIL(value) |
|
MOD Function |
MOD is a function that returns the modulus, or the remainder of a value divided by another value. MOD(value, divisor) |
|
REMAINDER Function |
The REMAINDER function calculates the remainder, according to the IEEE specification. REMAINDER(value, divisor) |