Database Management Hell

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/85

flashcard set

Earn XP

Description and Tags

UGHHHHHHhHhh i just need to pass

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

86 Terms

1
New cards

database

a collection of data in a structured format. modern databases are invariably stored on computers.

2
New cards

database management system (DBMS)

software that reads and writes data in a database. ensures that data is secure, internally consistent, and available at all times. large & complex.

3
New cards

query

a request to retrieve or change data in a database.

4
New cards

data

numeric, textual, visual, or audio information that describes real-world systems.

5
New cards

format

data may be produced as numbers, text, images, audio, or video.

6
New cards

query language

a specialized programming language, designed specifically for database systems. they read and write data efficiently.

7
New cards

transaction

a group of queries that must be either completed or rejected as a whole.

8
New cards

architecture

describes the internal components and the relationships between components in a database system.

9
New cards

log

a file containing a complete record of all inserts, updates, and deletes processed by the database.

10
New cards

data dictionary/glossary

documents additional detail in text format. includes names, synonyms, and descriptions of entities, relationships, and attributes.

11
New cards

relational database

stores data in tables, columns, and rows, similar to a spreadsheet.

12
New cards

SQL

Structured Query Language and includes statements that read and write data, create and delete tables, and administer the database system.

13
New cards

CRUD operations

four common queries: Create, Read, Update, and Delete data

14
New cards

SQL statement

a complete, executable database command.

15
New cards

INSERT INTO table

VALUES (new values)

adds a new row

16
New cards

SELECT column

FROM table

WHERE column <=> value

retrieves based on your set parameters

17
New cards

UPDATE table

SET column <=> new value

WHERE column <=> row

change something based on parameters

18
New cards

CREATE TABLE table (

column datatype,

column datatype,

);

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

19
New cards

data type

indicates the format of column values. numeric, textual, or complex.

20
New cards

INT

stores integer values.

21
New cards

DECIMAL

stores fractional numeric values.

22
New cards

VARCHAR

stores textual values.

23
New cards

DATE

stores year, month, and day.

24
New cards

VARCHAR(10)

indicates ten characters size.

25
New cards

DECIMAL(10, 3)

indicates ten significant digits, including three after the decimal point.

26
New cards

database design

a specification of database objects such as tables, columns, data types, and indexes.

  1. Conceptual design

  2. Logical design

  3. Physical design

27
New cards
  1. conceptual design (aka analysis/modeling)

phase that specifies database requirements without regard to a specific database system.

28
New cards

conceptual design steps

  1. Discover entities, relationships, and attributes

  2. Determine cardinality

  3. Distinguish strong and weak entities

  4. Create supertype and subtype entities

29
New cards

ER diagrams

entities, relationships, and attributes are depicted in a diagram.

30
New cards

ER diagram format

  • Rectangles with round corners represent entities. Entity names appear at the top of rectangles.

  • Lines between rectangles represent relationships.

  • Text inside rectangles and below entity names represent attributes.

<ul><li><p>Rectangles with round corners represent entities. Entity names appear at the top of rectangles.</p></li><li><p>Lines between rectangles represent relationships.</p></li><li><p>Text inside rectangles and below entity names represent attributes.</p></li></ul><p></p>
31
New cards
  1. logical design

phase that implements database requirements in a specific database system.

32
New cards

key

a column used to identify individual rows of a table. created with CREATE TABLE statements

33
New cards

table diagram

ER diagrams but more detailed.

34
New cards

table diagram format

  • Rectangles with square corners represent tables. Table names appear at the top of rectangles.

  • Text within rectangles and below table names represents columns.

  • Bullets (●) indicate key columns.

  • Arrows between tables indicate columns that refer to keys. The tail of the arrow is aligned with the column and the arrow points to the table containing the key.

<ul><li><p>Rectangles with square corners represent tables. Table names appear at the top of rectangles.</p></li><li><p>Text within rectangles and below table names represents columns.</p></li><li><p>Bullets (●) indicate key columns.</p></li><li><p>Arrows between tables indicate columns that refer to keys. The tail of the arrow is aligned with the column and the arrow points to the table containing the key.</p></li></ul><p></p>
35
New cards
  1. physical design

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

36
New cards

data independence

principle where physical design affects query processing speed but never affects the query result.

37
New cards

API (application programming interface)

a library of procedures or classes that links a host programming language to a database. host language calls library procedures, which handle details such as connecting to the database, executing queries, and returning results.

38
New cards

CREATE DATABASE IF NOT EXISTS name;

creates database only if it doesn’t exist (duh)

39
New cards

stored procedure

a named collection of one or more SQL statements that are pre-compiled and stored within the database. a single stored procedure can perform a defined set of operations.

40
New cards

schema

a logical container or namespace within a database used to organize and group related database objects.

41
New cards

entity-relationship model

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

<p>a high-level representation of data requirements, ignoring implementation details. </p>
42
New cards

entity

a person, place, product, concept, or activity. usually nouns, but not all nouns are entities.

43
New cards

relationship

a statement about two entities. usually verbs.

44
New cards

attribute

a descriptive property of an entity used in both entity-relationship and relational models. in the relational model, attribute is a formal term for column. usually nouns that denote specific data, such as names.

45
New cards

type

a set in entity-relationship modeling, ex. set of employees

46
New cards

instance

an individual thing in entity-relationship modeling. ex: the employee Sam Snead.

47
New cards

cardinality

refers to maxima and minima of relationships and attributes.

48
New cards

relationship maximum

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

49
New cards

singular entity

when the maximum is one

50
New cards

plural entity

when the maximum is many.

51
New cards

crow's foot notation

a graphical technique used in ERDs to visualize cardinality

<p> a graphical technique used in ERDs to visualize cardinality</p>
52
New cards

chen notation

visualizes ERD structure. includes include rectangles for entities, diamonds for relationships, and ovals for attribute.

<p>visualizes ERD structure. includes&nbsp;include rectangles for entities, diamonds for relationships, and ovals for attribute.</p>
53
New cards

unique attribute

an attribute in which it’s value is distinct for every entity instance.

54
New cards

strong entity

has one or more identifying attributes. each strong entity = one table. one of the identifying attributes may become the primary key. independent.

<p>has one or more identifying attributes. each strong entity = one table. one of the identifying attributes may become the primary key. independent.</p>
55
New cards

identifying attribute

unique, singular, and required. identifying attribute values correspond one-to-one to, or identify, entity instances.

56
New cards

weak entity

an identifying attribute. usually has a relationship, called an identifying relationship, to another identifying entity. dependent. weak entities become weak tables.

57
New cards

identifying entity

must be singular and required in an identifying relationship.

58
New cards

identifying relationship

relationship with identifying entity. ERD has a diamond next to the identifying entity.

<p>relationship with identifying entity. ERD has a diamond next to the identifying entity. </p>
59
New cards

subtype entity

a subset of another entity type, called the supertype entity. ex. Manager is a subtype entity of the Employee supertype entity.

60
New cards

supertype entity

has several subtypes. attributes of the supertype apply to all subtypes. attributes of a subtype do not apply to other subtypes or the supertype.

<p>has several subtypes. attributes of the supertype apply to all subtypes. attributes of a subtype do not apply to other subtypes or the supertype.</p>
61
New cards

partition

a group of mutually exclusive subtype entities in a supertype entity.

<p><span style="font-size: medium;"><span>a group of mutually exclusive subtype entities in a supertype entity.</span></span></p>
62
New cards

partition attribute

optional, corresponds to a partition of the supertype entity. indicates which subtype entity is associated with each supertype instance.

63
New cards

IsA relationship

identifying relationship of supertype entity that identify its subtype entities.

<p>identifying relationship of supertype entity that identify its subtype entities.</p>
64
New cards

primary keys

must be unique and required (not NULL). also should be stable, simple, meaningless.

65
New cards

artificial key

a simple primary key created by the database designer. usually artificial keys are integers, generated automatically by the database as new rows are inserted to the table.

66
New cards

1-1

one-one relationship becomes a foreign key. the foreign key can go in the table on either side of the relationship. aka 1:1

67
New cards

foreign key

unique, refers to the table on the opposite side of the relationship. name is the name of the referenced primary key, with an optional prefix.

68
New cards

many-many

becomes a new weak table, contains two foreign keys, referring to the primary keys of the related tables.  primary key of the new table is the composite of two fks. aka M:N

69
New cards

required attribute

an attribute or relationship that is mandatory, with no null values allowed

70
New cards

NOT NULL

specified for required columns after data type (ex. Name VARCHAR(10) NOT NULL)

71
New cards

UNIQUE

specified for unique columns after data type (ex. Number INT UNIQUE)

72
New cards

PRIMARY KEY

specified for primary key columns after data type (ex. Passenger INT PRIMARY KEY)

73
New cards

functional dependence

dependence of one column on another. 'A depends on B' is denoted B → A.

74
New cards

redundancy

the repetition of related values in a table, ex. “222, Elvira Yin” not just “222”

<p>the repetition of related values in a table, ex. “222, Elvira Yin” not just “222”</p>
75
New cards

normal forms

rules for designing tables with less redundancy.

76
New cards

first normal form

each column must contain atomic, single-valued data, and each row must be unique. fix: separate repeating attributes into a new table

<p>each column must contain atomic, single-valued data, and each row must be unique. fix: separate repeating attributes into a new table</p>
77
New cards

second normal form

in 1NF, and no partial dependency on part of a composite key. fix: move attributes that depend only on part of the key to another table

<p>in 1NF, and no partial dependency on part of a composite key. fix: move attributes that depend only on part of the key to another table</p>
78
New cards

third normal form

further extends 2NF by eliminating transitive dependencies, meaning no non-key attribute should be dependent on another non-key attribute. fix: remove attributes that depend on non-key attributes.

<p>further extends 2NF by eliminating transitive dependencies, meaning no non-key attribute should be dependent on another non-key attribute. fix: remove attributes that depend on non-key attributes.</p>
79
New cards

boyce codd

each attribute must represent a fact about the key, the whole key, and nothing but the key. stricter 3NF.

80
New cards

types of attributes

  • simple: cannot be divided (first name)

  • composite: can be divide (full name)

  • multivalued: multiple values (phone numbers)

  • derived: caluclate (age from birthdate)

  • optional: may be null (middle name)

81
New cards

tuple

order of elements in a tuple matters, and once a tuple is created, it cannot be changed.

82
New cards

1-many

many side get’s the foreign key, foreign key refers to the primary key of the one side. aka 1:

83
New cards

insertion anomaly

normalization anomaly that occurs when you cannot add a new piece of data to a table without also adding unnecessary or unrelated data.

84
New cards

update anomaly

normalization anomaly where redundant data requires multiple updates for a single change, risking inconsistency if not all instances are updated correctly.

85
New cards

deletion anomaly

normalization anomaly for the unintended loss of data when a record is deleted.

86
New cards

normalization steps

1. No normal form

2. First normal form

3. Second normal form

4. Third normal form

5. Boyce-Codd normal form

6. fourth normal form

7. fifth normal form

Explore top flashcards

Nisäkkäät
Updated 773d ago
flashcards Flashcards (47)
31-35
Updated 79d ago
flashcards Flashcards (69)
BIOL 375 Exam 2
Updated 1026d ago
flashcards Flashcards (76)
MB3
Updated 191d ago
flashcards Flashcards (37)
Tema 6: Contexto 2
Updated 970d ago
flashcards Flashcards (30)
Emotions and moods
Updated 187d ago
flashcards Flashcards (114)
Nisäkkäät
Updated 773d ago
flashcards Flashcards (47)
31-35
Updated 79d ago
flashcards Flashcards (69)
BIOL 375 Exam 2
Updated 1026d ago
flashcards Flashcards (76)
MB3
Updated 191d ago
flashcards Flashcards (37)
Tema 6: Contexto 2
Updated 970d ago
flashcards Flashcards (30)
Emotions and moods
Updated 187d ago
flashcards Flashcards (114)