Database Relational Model & SQL Advanced Flashcards -L4

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

1/38

flashcard set

Earn XP

Description and Tags

Flashcards for database lecture review.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

39 Terms

1
New cards

Data Definition Language

Defines the tables in a database.

2
New cards

Data Manipulation Language

Queries/updates the tables in a database.

3
New cards

1:M Relationship Foreign Key Placement

Place the PK of the '1' side (parent entity) as a Foreign Key in the 'M' side (child entity).

4
New cards

1:1 Non-Recursive Relationship (Optional Side)

Place FK on the optional side of the relationship.

5
New cards

Fan Trap

One entity in two 1:M relationships to other entities, leading to a link between the other two entities.

6
New cards

SQL OR Operator

The entire condition is true if either one of the conditions is true.

7
New cards

SQL AND Operator

The entire condition is true only if both conditions are true.

8
New cards

SQL NOT Operator

Opposite of a condition - true becomes false; false becomes true.

9
New cards

SQL IS NULL

Check whether an attribute value is null.

10
New cards

SQL IS NOT NULL

Check whether an attribute value is NOT null.

11
New cards

SQL BETWEEN

Define range limits.

12
New cards

SQL LIKE

Check for similar character strings.

13
New cards

SQL IN

Check whether an attribute value matches a value contained within a subset of listed values.

14
New cards

SQL Date Function: SYSDATE

Today’s current date, as per your computer system.

15
New cards

SQL Date Function: TO_DATE

Convert a character string to DATE type by a certain format.

16
New cards

SQL Date Function: MONTHS_BETWEEN

Months difference between two dates.

17
New cards

SQL Date Function: ADD_MONTHS

Add a set number of months to a date field.

18
New cards

SQL Date Function: NEXT_DAY

The next given weekday after the given date.

19
New cards

SQL Numeric Function: ROUND

Round numeric fields to the stated precision.

20
New cards

SQL Numeric Function: TRUNC

Delete numeric points to the stated precision.

21
New cards

SQL Numeric Function: MOD

Remainder of a division operator.

22
New cards

SQL Conversion Function: CASE

Different operations depending on conditions.

23
New cards

SQL Conversion Function: TO_NUMBER

Convert a string to a number field (useful for arithmetic calculations).

24
New cards

SQL Conversion Function: TO_CHAR

Use to format values (e.g., convert dates and numbers).

25
New cards

SQL String Function: LOWER

Returns a string with all characters converted to lowercase.

26
New cards

SQL String Function: UPPER

Returns a string with all characters converted to uppercase.

27
New cards

SQL String Function: INITCAP

Converts the first letter of every word to uppercase, and every other letter to lowercase.

28
New cards

SQL String Function: SUBSTR

Extract a portion of the string.

29
New cards

SQL String Function: INSTR

Return the numeric position of a substring within the string.

30
New cards

SQL String Function: LENGTH

Number of characters in the character string.

31
New cards

SQL String Function: LPAD

Left-pad a string with another string, to a certain length.

32
New cards

SQL String Function: RPAD

Right-pad a string with another string, to a certain length.

33
New cards

SQL String Function: TRIM

Removes leading & trailing spaces from both ends.

34
New cards

SQL String Function: LTRIM

Remove leading spaces from left side only or Remove all occurrences of selected characters from the left-hand side of the string.

35
New cards

SQL String Function: RTRIM

Same as LTRIM, but from the right-hand side.

36
New cards

SQL String Function: REPLACE

Substitute a string with another string.

37
New cards

SQL String Function: SOUNDEX

Use to find values based on their “sound”.

38
New cards

SQL Function: NVL

Substitute a value for any NULLS; valid values stay as they are.

39
New cards

SQL Function: NVL2

Substitute a value for any NULLS, and a value for any fields that are not null.