Practice Test 3 Flashcards

1
Q

Logical Constraints

A

rules of relational databases that ensure data is valid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A syntax error and error occurs when…

A

SQL is syntactically incorrect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

INT

A

Whole integer value such as age

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

MySQL Command line interface

A

Text-based interface included in mySQL server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Data Transaction Language (DTL)

A

Can be used to roll back database changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Database Control Language (DCL)

A

Used to manage/control database access (Grant, Revoke)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which Database includes the world database during its installation?

A

MySQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Manipulation Language (DML)

A

Used to manage data within databases (Select, Insert, Update, Delete)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Definition Language (DDL)

A

Used to manage and define database structures (Create, Alter, Drop, Truncate)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Query Language (DQL)

A

Used to query and retrieve data from a database (Select)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Operation order precedence

A
  1. exponentiation
  2. multplication/div
  3. add/sub
  4. comparison (=,<=,>=,etc)
  5. Between, when, case, then, else
  6. Not
  7. and
  8. OR
  9. SET =
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Self Join

A

Table joins itself
Useful for comparing rows within the same table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Compares columns from left table to right table

A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Outer Join

A

Left/right outer join will return all the rows from the left/right table and only the matching rows from the other table.

Full outer join will return all rows if matching and Null values for the non matching rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

EquiJoin

A

combines rows that have equivalent values in specified columns

Used to combine rows form two or more tables based on a related column

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cross Join

A

Combines rows from both tables all into one new table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Outer query

A

Main query that can contain one or more subqueries(Nested queries)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Nested Query

A

Sub query that is a query within a query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Correlated Query

A

Sub query that references columns from the outer query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

IN

A

allows you to specify multiple values in a WHERE clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

BETWEEN

A

Selects values within a given range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

LIKE

A

used in a where clause to search for a specified value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

OR

A

Used to combine multiple conditions in a WHERE clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

%

A

Used to represent zero or more characters when searching for a specified pattern using a LIKE operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

TRIM

A

Removes leading and trailing spaces from a string

18
Q

REPLACE

A

Replaces all occurrences of a specified substring within a string with another substring

19
Q

SUBSTRING

A

Extracts a part of a string, starting at a specificized position and for a specified length

20
Q

ORDER BY

A

Sorts the entire result set.
Can be used with any columns in the result set.
Does not change the number of rows in the result set.

21
Q

GROUP BY

A

Groups rows into summary rows.
Must be used with aggregate functions like COUNT, SUM, AVG, etc.
Reduces the number of rows in the result set to one per group.

22
Q

Virtual view

A

Virtual table that provides a result set of query but doesnt store data itself

23
Q

Snapshot View

A

Read only, static view of a database at a specific point in time

24
Q

Denormalized View

A

Includes redundant data to improve read performance. Combines data from multiple tables into a single view to reduce the need for joins

25
Q

Materialized View

A

Stores results of a query physically and periodically refreshes to stay up to date with the underlying data

26
Q

TRUNCATE

A

Removes all rows from a table but doesn’t delete the actual table or remove data from a temp table

27
Q

DELETE

A

Removes specific rows from a table

28
Q

Auto-increment

A

Allows SQL to auto insert a field value

29
Q

CHECK constraint

A

used to specify an expression that must be true for each row

30
Q

RESTRICT

A

Used with foreign key constraints to prevent actions that would violate referential integrity

31
Q

CASCADE

A

Specifies that changes made in the parent table propagate to the child table

32
Q

Junction Table

A

Used to establish a many to many relationship between two tables using foreign keys

33
Q

In a relational database what type of relationship is established using foreign keys?

A

A one to Many

34
Q

What statement may be rejected due to a foreign key constraint?

A

Insert

35
Q

Candidate Keys

A

Unique columns that aren’t technically primary keys

36
Q

Trivial dependency

A

A functional dependency A→B, is considered trivial if B is a subset of A

EX: Table with attributes (StudentID, Name, AGE)
Trivial: (StudentID, Name) → StudentID
Non-Trivial: StudentID → Name

37
Q

Merging tables

A

process of denormalization

38
Q

Normalization

A

eliminates redundancy by decomposing a table into two or more tables in a higher normal form

39
Q

Boyce-Codd normal form

A

optimal normal form for frequent inserts, updates, and deletes of data

40
Q

ER Diagram symbols

A
  1. Rectangle or square - An entity
  2. Double rectangle - Weak entity
  3. Oval/circle - Attribute
  4. Diamond - Relationship between entities
  5. Crow’s foot - many (0 or more)
  6. single line - represents 1 or single (Optional)
  7. Double line - Represents one and only one (Mandatory)
  8. Circle with a line across - Represents zero or 1 (Optional)
41
Q

IsA relationship

A

relationship or association between a supertype entity and its subtype entities

42
Q

Entity

A

Real world object that can be identified and grouped

43
Q

Attribute Maximum

A

represented on the relationship or outside the parenthesis.
Max number of relationships an entity can have with another

44
Q

Attribute Minimum

A

Shown inside the the parenthesis or part of the relationship line
Min amount of instances two entities can have

45
Q

Trend analysis

A

evaluating historical data to identify patterns or tends

46
Q

Unique Identifier Analysis

A

Special Code or number assigned to object, person, thing to ensure each entry in a DB is unique.
Used for identifying primary keys

47
Q

Dense Index

A

Index record for every key value

48
Q

Sparse Index

A

Index record for only some of the key values

49
Q

Multi-Level Index

A

indexing method that uses a hierarchy of indexes to manage large data sets

50
Q

Secondary Index

A

Not the primary index and can contain duplicates

51
Q

Bitmap Index

A

Grid of bits where each indexed row corresponds to a unique row

52
Q

Hash index

A

Uses a hash function and key and buckets