Data Management - Foundations - D426

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/148

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

149 Terms

1
New cards

database application

software that helps business users interact with database systems

2
New cards

database administrator

  1. responsible for securing the database system against unauthorized users.

  2. enforces procedures for user access and database system availability.

3
New cards

query processor

  1. interprets queries, creates a plan to modify the database or retrieve data, and returns query results to the application.

  2. performs query optimization to ensure the most efficient instructions are executed on the data.

4
New cards

storage manager

  1. translates the query processor instructions into low-level file-system commands that modify or retrieve data.

  2. uses indexes to quickly locate data.

5
New cards

transaction manager

  1. ensures transactions are properly executed.

  2. prevents conflicts between concurrent transactions.

  3. restores the database to a consistent state in the event of a transaction or system failure.

  4. writes log records before applying changes to the database.

6
New cards

Metadata

data about the database, such as column names and the number of rows in each table.

7
New cards

relational database

  1. stores data in tables, columns, and rows, similar to a spreadsheet. All data in a column has the same format.

  2. All data in a row represents a single object, such as a person, place, product, or activity.

  3. are ideal for databases that require an accurate record of every transaction, such as banking, airline reservation systems, and student records.

8
New cards

MongoDB

  1. a NoSQL database designed for storing, retrieving, and managing large amounts of unstructured or semi-structured data.

  2. stores data in JSON-like documents, making it flexible and scalable.

  3. Open source

9
New cards

SQL CREATE TABLE statement

  1. creates a new table by specifying the table and column names.

  2. Each column is assigned a data type that indicates the format of column values. Data types can be numeric, textual, or complex

    • INT

    • DECIMAL

    • VARCHAR

    • DATE

10
New cards

analysis phase

  1. focuses on gathering, understanding, and documenting user requirements to ensure the system meets business needs.

  2. specifies database requirements without regard to a specific database system.

  3. Requirements are represented as entities, relationships, and attributes.

  4. An entity is a person, place, activity, or thing.

  5. A relationship is a link between entities, and an attribute is a descriptive property of an entity.

  6. has many alternative names, such as conceptual design, entity-relationship modeling, and requirements definition.

  7. Rectangles represent entities. Entity names appear at the top of rectangles.

11
New cards

logical design phase

  1. converts entities, relationships, and attributes into tables, keys, and columns.

  2. affects the query result

12
New cards

physical design phase

  1. focuses on how data is stored, accessed, and optimized for performance on the hardware and software platform.

  2. adds indexes and specifies how tables are organized on storage media.

  3. affects query processing speed but never affects the query result.

13
New cards

Data independence

  1. the ability to change the data storage structure or schema without affecting the applications or programs that use the data.

  2. It ensures that data access remains unaffected by changes in how data is stored or organized.

14
New cards

Application Programming Interface (API)

a library of procedures or classes that links a host programming language to a database.

15
New cards

MySQL Command-Line Client

  1. a text interface included in the MySQL Server download.

  2. allows developers to connect to the database server, perform administrative functions, and execute SQL statements.

16
New cards

MySQL Workbench

is installed with MySQL Server and allows developers to execute SQL commands using an editor.

17
New cards

database model

  1. a conceptual framework for database systems, with three parts:

    • Data structures that prescribe how data is organized.

    • Operations that manipulate data structures.

    • Rules that govern valid data.

18
New cards

set

  1. an unordered collection of elements enclosed in braces.

  2. Ex: {a, b, c} and {c, b, a} are the same, since sets are not ordered

19
New cards

tuple

  1. an ordered collection of elements enclosed in parentheses.

  2. Ex: (a, b, c) and (a, b, c)

20
New cards

Relational data structure

  1. A table has a name, a fixed tuple of columns, and a varying set of rows.

  2. A column has a name and a data type.

  3. A row is an unnamed tuple of values. Each value corresponds to a column and belongs to the column's data type.

  4. A data type is a named set of values, from which column values are drawn.

21
New cards

Synonyms

  1. Table, File, Relation

  2. Row, Record, Tuple

  3. Column, Field, Attribute

22
New cards

Relational operations

  1. “Select” - selects a subset of rows of a table

  2. Join - allows for the combination of information from two or more tables

  3. Union - selects all rows of two tables.

  4. Aggregate - computes functions over multiple table rows, such as sum and count.

23
New cards

Relational rules

  1. Rules are logical constraints that ensure data is valid

  2. Unique primary key. All tables have a primary key column, or group of columns, in which values may not repeat.

  3. Unique column names. Different columns of the same table have different names.

  4. No duplicate rows. No two rows of the same table have identical values in all columns.

24
New cards

Business rules

  1. are based on business policy and specific to a particular database.

  2. Ex: All rows of the Employee table must have a valid entry in the DepartCode column.

  3. Ex: PassportNumber values may not repeat in different Employee rows.

25
New cards

Structured Query Language (SQL)

  1. a high-level computer language for storing, manipulating, and retrieving data.

  2. is the standard language for relational databases, and is commonly supported in non-relational databases.

26
New cards

clause

groups SQL keywords like SELECT, FROM, and WHERE with table names like City, column names like Name, and conditions like Population > 100000.

27
New cards

Literals

  1. Explicit values that are string, numeric, or binary

  2. must be surrounded by single quotes or double quotes.

  3. Binary values are represented with x'0' where the 0 is any hex value.

    • ‘string’

    • “string"

28
New cards

keywords

  1. Words with special meaning

    • SELECT

    • FROM

    • WHERE

29
New cards

identifiers

  1. Objects from the database like tables, columns, etc.

    • City

    • Name

    • Population

30
New cards

Data Definition Language (DDL)

defines the structure of the database.

31
New cards

Data Query Language (DQL)

retrieves data from the database.

32
New cards

Data Manipulation Language (DML)

manipulates data stored in a database.

33
New cards

Data Control Language (DCL)

controls database user access.

34
New cards

Data Transaction Language (DTL)

manages database transactions, used to rollback database changes

35
New cards

Table

  1. has a name, a fixed sequence of columns, and a varying set of rows.

  2. must have at least one column but any number of rows. A table without rows is called an empty table.

  3. No row order. Rows are not ordered. The organization of rows on a storage device, such as a disk drive, never affects query results.

36
New cards

ALTER TABLE statement

  1. adds, deletes, or modifies columns on an existing table.

    • ADD - adds a column

    • CHANGE - modifies a column

37
New cards

TINYINT

  1. 1 byte (8 bits)

  2. Signed range: -128 to 127

  3. Unsigned range: 0 to 255

38
New cards

SMALLINT

  1. 2 bytes (16 bits)

  2. signed range: -32,768 to 32,767

  3. unsigned range: 0 to 65,535

39
New cards

MEDIUMINT

  1. 3 byes (24 bits)

  2. unsigned range: -8,388,608 to 8,388,607

  3. signed range: 0 to 16,777,215

40
New cards

INTEGER or INT

  1. 4 bytes (32 bits)

  2. signed range: -2,147,483,648 to 2,147,483,647

  3. unsigned range: 0 to 4,294,967,295

41
New cards

% (modulo)

  1. Divides one numeric value by another and returns the integer remainder

    • 5 % 2 = 1

42
New cards

^

  1. Raises one numeric value to the power of another

    • 5^2 = 25

43
New cards

INSERT statement

  1. The INSERT statement adds rows to a table. The INSERT statement has two clauses:

    • The INSERT INTO clause names the table and columns where data is to be added. The keyword INTO is optional

    • The VALUES clause specifies the column values to be added.

44
New cards

UPDATE statement

  1. The UPDATE statement modifies existing rows in a table.

  2. The UPDATE statement uses the SET clause to specify the new column values.

  3. An optional WHERE clause specifies which rows are updated.

45
New cards

DELETE statement

  1. The DELETE statement deletes existing rows in a table.

  2. The FROM keyword is followed by the table name whose rows are to be deleted.

  3. An optional WHERE clause specifies which rows should be deleted.

  4. Omitting the WHERE clause results in all rows in the table being deleted.

46
New cards

TRUNCATE statement

deletes all rows from a table.

47
New cards

MERGE statement

selects data from one table, called the source, and inserts the data to another table, called the target.

48
New cards

auto-increment column

  1. is a numeric column that is assigned an automatically incrementing value when a new row is inserted.

  2. MySQL allows insertion of a specific value to an auto-increment column. However, overriding auto-increment for a primary key is usually a mistake.

49
New cards

foreign key

  1. obey a relational rule called referential integrity. Referential integrity requires foreign key values must either be NULL or match some value of the referenced primary key.

  2. When a foreign key constraint is specified, the database rejects insert, update, and delete statements that violate referential integrity.

    • RESTRICT rejects an insert, update, or delete that violates referential integrity.

    • CASCADE propagates primary key changes to foreign keys.

50
New cards

constraint

  1. a rule that governs allowable values in a database. Constraints are based on relational and business rules

  2. The UNIQUE constraint ensures that values in a column, or group of columns, are unique.

  3. The CHECK constraint specifies an expression on one or more columns of a table.

  4. Constraints are added and dropped with the ALTER TABLE TableName followed by an ADD, DROP, or CHANGE clause.

51
New cards

LIKE operator

  1. when used in a WHERE clause, matches text against a pattern using the two wildcard characters % and _.

  2. % matches any number of characters

    • Ex: LIKE 'L%t' matches "Lt", "Lot", "Lift", and "Lol cat".

    • _ matches exactly one character. Ex: LIKE 'Lt' matches "Lot" and "Lit" but not "Lt" and "Loot".

52
New cards

ORDER BY clause

  1. orders selected rows by one or more columns in ascending (alphabetic or increasing) order.

  2. The DESC keyword with the ORDER BY clause orders rows in descending order.

53
New cards

ABS(n)

  1. Returns the absolute value of n

    • SELECT ABS(-5); will return 5.

54
New cards

LOWER(s)

  1. Returns the lowercase s

  2. SELECT LOWER('MySQL');

  3. returns 'mysql'

55
New cards

TRIM(s)

  1. TRIM(s) Returns the string s without leading and trailing spaces

  2. SELECT TRIM(' test ');

    returns 'test’

56
New cards

aggregate function

  1. processes values from a set of rows and returns a summary value.

  2. Common aggregate functions are:

    • COUNT() counts the number of rows in the set.

    • MIN() finds the minimum value in the set.

    • MAX() finds the maximum value in the set.

    • SUM() sums all the values in the set.

    • AVG() computes the arithmetic mean of all the values in the set.

57
New cards

HAVING clause

The HAVING clause is used with the GROUP BY clause to filter group results.

58
New cards

join

  1. is a SELECT statement that combines data from two tables, known as the left table and right table, into a single result.

  2. The tables are combined by comparing columns from the left and right tables, usually with the = operator.

  3. The columns must have comparable data types.

59
New cards

INNER JOIN

selects only matching left and right table rows

60
New cards

FULL JOIN

selects all left and right table rows, regardless of match.

61
New cards

LEFT JOIN

selects all left table rows, but only matching right table rows.

62
New cards

RIGHT JOIN

selects all right table rows, but only matching left table rows.

63
New cards

outer join

any join that selects unmatched rows, including left, right, and full joins.

64
New cards

UNION

combines the two results into one table.

65
New cards

equijoin

  1. combines rows from two tables where the values in the specified columns are equal.

  2. compares columns of two tables with the = operator.

  3. Most joins are equijoins.

  4. A non-equijoin compares columns with an operator other than =, such as < and >.

66
New cards

cross-join

  1. combines two tables without comparing columns.

  2. A cross-join uses a CROSS JOIN clause without an ON clause.

  3. As a result, all possible combinations of rows from both tables appear in the result.

67
New cards

subquery

sometimes called a nested query or inner query, is a query within another SQL query.

68
New cards

materialized view

  1. is a view for which data is stored at all times.

  2. Whenever a base table changes, the corresponding view tables can also change, so materialized views must be refreshed.

69
New cards

WITH CHECK OPTION

the database rejects inserts and updates that do not satisfy the view query WHERE clause.

70
New cards

entity-relationship model

  1. a high-level representation of data requirements, ignoring implementation details.

  2. includes three kinds of objects:

    • Entity - person, place, product, concept, or activity

    • Relationship - a statement about two entities

    • Attribute - a descriptive property of an entity

71
New cards

reflexive relationship

the relationship is between two instances of the same entity.

72
New cards

entity-relationship diagram

  1. a schematic picture of entities, relationships, and attributes.

  2. Entities are drawn as rectangles.

  3. Relationships are drawn as lines connecting rectangles.

  4. Attributes appear as additional text within an entity rectangle, under the entity name.

73
New cards

entity type

is a set of things. Ex: All employees in a company.

74
New cards

relationship type

a set of related things. Ex: Employee-Manages-Department is a set of (employee, department) pairs, where the employee manages the department.

75
New cards

attribute type

is a set of values. Ex: All employee salaries

76
New cards

entity instance

is an individual thing. Ex: The employee Sam Snead.

77
New cards

relationship instance

is a statement about entity instances. Ex: "Maria Rodriguez manages Sales."

78
New cards

attribute instance

is an individual value. Ex: The salary $35,000.

79
New cards

Analysis steps

  1. Discover entities, relationships, and attributes

  2. Determine cardinality

  3. Distinguish strong and weak entities

  4. Create supertype and subtype entities

80
New cards

Logical design steps

  1. Implement entities

  2. Implement relationships

  3. Implement attributes

  4. Apply normal form

81
New cards

cardinality

  1. refers to maxima and minima of relationships and attributes.

  2. Attribute Minimum – The least number of values an attribute can have.

  3. Attribute Maximum – The most number of values an attribute can have.

    • Phone_Number (1,3)

    • 1 → Minimum value (must have at least one phone number).

    • 3 → Maximum value (can have up to three phone numbers).

82
New cards

Relationship maximum

  1. the greatest number of instances of one entity that can relate to a single instance of another entity.

  2. A relationship has two maxima, one for each of the related entities.

  3. Maxima are usually specified as one or many.

  4. A related entity is singular when the maximum is one and plural when the maximum is many.

83
New cards

Relationship minimum

  1. the least number of instances of one entity that can relate to a single instance of another entity.

  2. A relationship has two minima, one for each of the related entities.

  3. Minima are usually specified as zero or one.

  4. A related entity is optional when the minimum is zero and required when the minimum is one.

  5. appears in parentheses.

84
New cards

One-to-One (1:1)

  1. each record in Table A is related to at most one record in Table B, and vice versa.

  2. Example: A person and their passport; each person has only one passport, and each passport is issued to only one person.

85
New cards

One-to-Many (1:N)

  1. one record in Table A can be related to multiple records in Table B, but each record in Table B is related to only one record in Table A.

  2. Example: A department and its employees; one department can have many employees, but each employee belongs to only one department.

86
New cards

Many-to-One (N:1)

  1. multiple records in Table A can be related to one record in Table B.

  2. Example: Many employees can work in the same department, but each employee belongs to exactly one department.

87
New cards

Many-to-Many (M:N)

  1. multiple records in Table A can be related to multiple records in Table B and vice versa.

  2. Example: Students and courses; each student can enroll in multiple courses, and each course can have multiple students.

88
New cards

Supertype Entity

  1. identifies its subtype entities. The identifying relationship is called an IsA relationship.

  2. Example:

    • A Person supertype might include common attributes such as name, address, and phone number, which are shared by its subtypes like Employee and Customer.

  3. A partition of a supertype entity is a group of mutually exclusive subtype entities.

89
New cards

Subtype Entity

  1. a subset of another entity type, called the supertype entity.

  2. Example: In the previous example, the Employee and Customer subtypes of Person would inherit name, address, and phone number from Person, but each would also have specialized attributes such as employee_id for Employee or customer_since for Customer.

  3. On ER diagrams, subtype entities are drawn within the supertype.

90
New cards

strong entity

has one or more identifying attributes.

91
New cards

weak entity

does not have an identifying attribute. Instead, a weak entity usually has a relationship, called an identifying relationship, to another entity, called an identifying entity. Cardinality of the identifying entity is 1(1).

92
New cards

crow's foot notation,

depicts cardinality as a circle (zero), a short line (one), or three short lines (many).

93
New cards

intangible entity

is documented in the data model, but not tracked with data in the database.

94
New cards

artificial key

  1. a single-column primary key created by the database designer when no suitable single-column or composite primary key exists.

  2. Usually artificial key values are integers, generated automatically by the database as new rows are inserted to the table.

  3. are stable, simple, and meaningless.

95
New cards

functional dependence

dependence of one column to another

96
New cards

Normal forms

rules for designing tables with less redundancy.

97
New cards

Trivial dependencies

When the columns of A are a subset of the columns of B, A always depends on B.

98
New cards

Normalization

  1. a process in database design that eliminates redundancy and improves data integrity by organizing data into a series of normal forms (NF).

  2. Each normal form builds upon the previous one by addressing specific anomalies.

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

99
New cards

Boyce-Codd normal form

is ideal for tables with frequent inserts, updates, and deletes.

100
New cards

Denormalization

means intentionally introducing redundancy by merging tables.