Database Concepts: Data, Models, Keys, and Normalization

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/72

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.

73 Terms

1
New cards

Data

Raw facts; typically text or numbers lacking context. 35, Smith, 10:30 AM**

2
New cards

Information

Processed, structured data presented in context to make it meaningful. Employee ID 35, Customer Smith, Appointment at 10:30 AM**

3
New cards

Knowledge

Ability to understand information and make inferences or decisions. Understanding that employee 35 has a consistent tardiness issue.

4
New cards

End-user data

The raw facts of interest to the user (the actual values). The value *'iPhone 15'* in a product name field.

5
New cards

Metadata

Data about data; describes the characteristics and structure of the data. The field name *'CUST_LNAME'* is defined as `VARCHAR(20)`.

6
New cards

DBMS

Database Management System; programs that manage the database structure and control access. *MySQL, Oracle, SQL Server*

7
New cards

Data dictionary

An automatically updated storehouse of *metadata* describing the database structure. A record stating `Product_ID` is an `INTEGER` and the Primary Key.

8
New cards

Relational algebra

Theoretical set of operations used to manipulate relations (tables). Operations like *SELECT (Restrict), PROJECT, JOIN*.

9
New cards

DB design operations

The processes of structuring the data, relationships, and constraints for a specific environment. Steps like *Conceptual, Logical, and Physical Design*.

10
New cards

Data redundancy

Duplication of data, which wastes space and leads to anomalies. Storing the *Department Manager's name* in every employee's row.

11
New cards

Data anomalies

Problems resulting from data redundancy (Insert, Delete, Update). Deleting the last employee in a department removes the only record of the department's name (Deletion Anomaly).

12
New cards

Data model

A conceptual tool used to represent data structures, relationships, and constraints graphically. The *Entity-Relationship Model (ERM)*.

13
New cards

Entity

A person, place, thing, or event for which data is collected (a table). *CUSTOMER, PRODUCT, ORDER*

14
New cards

Attribute

A characteristic of an entity (a column). For `CUSTOMER`: *CUST_ID, CUST_LNAME, CUST_PHONE*

15
New cards

Relationship

An association between entities A *CUSTOMER places an ORDER*.

16
New cards

Constraint

A restriction placed on the data to ensure data integrity. `ORDER_DATE` must be a date on or after the current date.

17
New cards

Relationship types

Classification of relationships based on cardinality. *1:1 (One-to-One), 1:M (One-to-Many), M:N (Many-to-Many)*

18
New cards

Business rules

Precise descriptions of policies or procedures that help define data requirements.

19
New cards

An employee must be assigned to one department.

An example of a Business rule

20
New cards

ERD (Chen - Crow's Foot)

digram a graphical representation of the database model. Chen uses diamonds for relationships; Crow's Foot uses a specific symbol for 'many.'

21
New cards

Naming conventions

Established guidelines for naming database objects for clarity and consistency. Using UPPERCASE for table names and singular nouns.

22
New cards

Data model evolution

The historical development of data models (e.g., Hierarchical → Network → Relational → Object-Oriented). Moving from the Hierarchical Model to the current Relational Model.

23
New cards

Connectivity

The classification of the relationship between entities. Expressed as 1:M (One-to-Many).

24
New cards

Cardinality

The minimum and maximum number of entity occurrences associated with another entity. A customer can place (0, N) orders.

25
New cards

Relationship strength

Determined by whether the Foreign Key is part of the dependent entity's Primary Key. Identifying (Strong) vs. Non-identifying (Weak).

26
New cards

Relationship degree

The number of entities participating in a relationship. Unary (recursive), Binary, or Ternary.

27
New cards

Multivalued attributes

Attributes that can have more than one value for a single entity occurrence (violates 1NF). An employee's list of Skills.

28
New cards

Characteristics of a relational table

Properties like: distinct column names, atomic values, and order independence. Every row represents a unique entity occurrence.

29
New cards

Dependencies

The relationship where one attribute's value determines another's (Functional Dependency). ---> SSN --->Employee Name

30
New cards

Keys

An attribute or set of attributes that uniquely identifies an entity.

31
New cards

Primary Key (PK)

An attribute (or combination) that uniquely identifies any given row; must be unique and NOT NULL (Entity Integrity). CUST_ID.

32
New cards

Foreign Key (FK)

An attribute in one table that links to the Primary Key of another table (ensures Referential Integrity). DEPT_ID in the EMPLOYEE table.

33
New cards

Candidate Key

An attribute (or combination) that could serve as the PK (unique and non-redundant). Social Security Number or Driver's License Number.

34
New cards

Surrogate Key

A system-assigned, auto-incremented integer PK that has no business meaning. An Auto_ID field.

35
New cards

Composite Key

A Primary Key composed of two or more attributes. (ORDER_NUM, PROD_CODE) in a LINE_ITEM table.

36
New cards

Integrity rules

Rules that maintain the quality and consistency of data.

37
New cards

Entity Integrity

Rule stating that the Primary Key cannot contain null values. → The `CUST_ID` field cannot be blank.

38
New cards

Referential Integrity

Rule stating that a Foreign Key value must either match a PK value in the related table or be NULL. → An employee's `DEPT_ID` must exist in the `DEPARTMENT` table.

39
New cards

Normalization

Process of structuring tables to minimize data redundancies and eliminate anomalies. → Decomposing a table with anomalies into two or more well-structured tables.

40
New cards

Normal forms

States of a table achieved through normalization. → *1NF, 2NF, 3NF* (the most common goal).

41
New cards

1NF

_________ Eliminates repeating groups and ensures all attributes are atomic.

42
New cards

2NF

In 1NF and no non-key attribute is dependent on only part of a composite PK (eliminates *partial dependencies*).

43
New cards

3NF

In 2NF and no non-key attribute is dependent on another non-key attribute (eliminates *transitive dependencies*).

44
New cards

Post normalization improvements

Steps taken after full normalization to fine-tune performance, often involving denormalization.

45
New cards

Denormalization

Purposefully introducing *redundancy* to a table to improve query performance. → Adding the `DepartmentName` to the `Employee` table.

46
New cards

Atomic attributes

Attributes that cannot be further subdivided. → `CUST_PHONE` is atomic; `CUST_ADDRESS` is not (should be broken into Street, City, State, etc.).

47
New cards

Granularity

The level of detail represented by the data. → *Fine-grained (every transaction) vs. Coarse-grained* (monthly sales totals).

48
New cards

Entity supertypes - entity subtypes

A hierarchy where a general entity (Supertype) is subdivided into specific entities (Subtypes). → *PERSON (Supertype) is divided into EMPLOYEE and CUSTOMER* (Subtypes).

49
New cards

Inheritance

The property where subtype entities automatically share all attributes and relationships of their supertype. → Both `EMPLOYEE` and `CUSTOMER` inherit the `Name` and `Address` attributes from `PERSON`.

50
New cards

Disjoint constraint

An entity occurrence can belong to *only one of the subtypes (mutually exclusive). → A `PERSON` is either an `HOURLY_EMPLOYEE` OR* a `SALARIED_EMPLOYEE`.

51
New cards

Overlapping constraint

An entity occurrence can belong to *multiple subtypes. → A `PERSON` can be both a STUDENT and an EMPLOYEE*.

52
New cards

Completeness constraint

Specifies whether every supertype occurrence must be a member of at least one subtype. → *Total (must be a subtype) vs. Partial* (doesn't have to be a subtype).

53
New cards

Entity clustering

A virtual entity used to represent multiple entities and relationships to simplify a complex ERD.

54
New cards

What type of relationship 1:1

from one table becomes FK in the other table (with a UNIQUE constraint).

55
New cards

What type of relationship 1:M

from the 'One' side becomes the FK in the 'Many' side table.

56
New cards

What type of realationship M:N

Resolved by a Junction Table, whose PK is the composite of the FKs from both original tables.

57
New cards

What defines an identifying relationship in databases?

An identifying relationship exists when the Foreign Key (FK) of the dependent entity is part of its Primary Key (PK).

58
New cards

What is a key characteristic of an identifying relationship?

The dependent entity cannot exist without the entity it references (the parent).

59
New cards

How is the Foreign Key implemented in an identifying relationship?

The FK from the parent table becomes part of the Composite Primary Key of the child table.

60
New cards

Give an example of an identifying relationship.

A Line Item cannot exist without its parent Order.

61
New cards

What is the Primary Key of the Order Table?

Order_ID

62
New cards

What is the Primary Key of the Line Item Table?

Composite PK: (Order_ID as FK, mandatory part of PK), Item_Number.

63
New cards

What defines a non-identifying relationship in databases?

A non-identifying relationship exists when the Foreign Key (FK) of the dependent entity is NOT part of its Primary Key (PK).

64
New cards

What is a key characteristic of a non-identifying relationship?

The dependent entity can often exist independently or is uniquely identified by its own attributes.

65
New cards

How is the Foreign Key implemented in a non-identifying relationship?

The FK from the parent table is simply a non-key attribute in the child table.

66
New cards

Give an example of a non-identifying relationship.

An Employee is assigned to a Department.

67
New cards

What is the Primary Key of the Department Table?

Dept_ID

68
New cards

What is the Primary Key of the Employee Table?

Emp_ID (its own unique key).

69
New cards

What is the Foreign Key in the Employee Table?

Dept_ID (just a regular column).

70
New cards

Unary

Relationship between instances of the same entity. → 1 entity.

71
New cards

Binary

Relationship between two distinct entities. → 2 entities.

72
New cards

Ternary

Relationship between three distinct entities. → 3 entities.

73
New cards

Relationship Degree

The number of entities participating in a relationship.