Database Management Midterm

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/92

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:52 AM on 10/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

93 Terms

1
New cards

Database

its purpose is to help people keep track of things of interest to them

2
New cards

Tables

Data is stored here, they have rows and columns like a spreadsheet

3
New cards

instance

Each row in a table stores data about an occurrence or of the thing of interest

4
New cards

Data

facts and objects, for example, student names, email addresses, grade, images, sound etc.

5
New cards

Information

data processed in such a way it can increase the knowledge of the person who is using it

6
New cards

Transactional Data

  • Data change

  • Relational Database


7
New cards

Historical Data

  • Read only data

  • Periodically updated in a batch

  • Data warehouse


8
New cards

relational database

stores data in tables. A table holds data about one and only one theme. stores data and relationships.

9
New cards

Redundancy and multiple themes create modification problems

  • Update problem

  • Deletion problem

  • Insertion problem


10
New cards

Structured Query Language

is an international standard for creating, processing and querying databases and their tables

11
New cards

The four components of a database system are

  • Users

  • Database application

  • Database Management system (DBMS)

  • Database


12
New cards

The four components of a database system are:

Users, database application, database management system (DBMS), Database

13
New cards

Desktop DBMS

User to Database application, to database management system (DBMS), to database

14
New cards

A user of a database system will track

  • Use a database application to track things

  • Use forms to enter, read, delete and query data

  • Produce reports


15
New cards

The database

a self describing collection of related records

16
New cards

Self-describing

the database itself contains the descriptions of its structure

17
New cards

Metadata

is data describing the structure of the database, e.g., the names of the columns and the tables to which they belong to, properties of tables and columns, etc

18
New cards

Database contents

  • user data

  • metadata

  • indexes and other overhead data

  • application metadata


19
New cards

Database management system (DBMS)

  • it serves as an intermediary between database applications and the database

  • The DBMS manages and controls database activities

  • The DBMS creates, processes and administers the databases


20
New cards

Functions of a DBMS

  • Create databases

  • Create tables

  • Create supporting structures like indexes

  • Read database data

  • Modify database data (insert, update, delete)

  • Maintain database structures

  • Enforce constraints (or rules)

  • Control currency

  • Provide security

  • Perform backup and recovery


21
New cards

Referential integrity constraints

  • the DBMS will enforce many constraints or rules

  • it ensures that the values of a column in one table is valid based on the values in another table


22
New cards

Database application

is a set of computer programs that serves as an intermediary between the user and the DBMS

23
New cards

Functions of Database Applications

  • Create and process forms

  • Process user queries

  • Create and process reports

  • Execute application logic

  • Control database applications


24
New cards

What do database Management systems contain?

they typically have:

  • a few tables

  • are simple in design

  • involve only one computer

  • support one user at a time


25
New cards

Enterprise-Class (Organizational) DBMS

they typically:

  • Support several user simultaneously

  • include more than one application

  • involve multiple computers

  • Are complex in design

  • Have many tables

  • Have many databases


26
New cards

What is a NoSQL Database?

  • NoSQL database= non-relational databasse

  • Web 2.0 Applications: Facebook, Twitter, Pinterest

  • Apache Software Foundation Cassandra: Facebook, Twitter


27
New cards

Commercial DBMS products

  • EX Desktop DBMS products: Microsoft Access

  • EX Organizational DBMS products: Microsoft’s SQL server, Oracle’s oracle, Oracle’s MySQL

  • IBM’s DB2


28
New cards

Entity

is something of importance to a user that needs to be represented in a database. It represents one theme or topic. It is restricted to a thing that can be represented by a single table.

29
New cards

Relation

is a two dimensional table consisting of rows and columns that has specific characteristics

30
New cards

Characteristics of a relation

  1. Rows contain data about an entity

  2. Columns contain data about attributes of the entity

  3. Cells of the table hold a single value

  4. All entries in a column are of the same kind

  5. Each column has a unique name

  6. The order of the columns is unimportant

  7. The order of the rows is unimportant

  8. No two rows may be identical


31
New cards

Synonyms for Table

File, Relation

32
New cards

Synonyms for Row

Record, Tuple

33
New cards

Synonyms for Column

Field, Attribute

34
New cards

Key

a key is one or more columns of a relation that is used to identify a row

35
New cards

Uniqueness of Keys

Data value is unique for each row. Consequently, the key will uniquely identify a row. For example, EmployeeNumber

36
New cards

A composite key

is a key that contains two or more attributes. For a key to be unique is must become a

37
New cards

Candidate key

the key that uniquely identifies each row in a relation. It is a to become the primary key.

38
New cards

Primary key

is the candidate key chosen to be the key for a relation. E.g.: EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Email, Phone)

39
New cards

Surrogate Key

is a unique numeric value added to a relation to serve as a primary key

  • has no meaning to users and is usually hidden on forms, queries and reports

  • is often used in place of a composite primary key

  • EX: CLASS_PROFFESOR (ClassName, Section, Term, Proffesor), CLASS_PROFFESOR (AssignmentID, ClassName, Section, Term, Proffesor)


40
New cards

Relationships between tables

A table may be related to other tables

  • For example: An employee works in a department, a manager controls a project


41
New cards

A foreign key

To preserve relationships, you may need to create a

  • A is a primary key from one table placed into another table


42
New cards

Referential Integrity

states that every value of the foreign key must match a value of the primary key in another table.

  • For example: if EmpID = 4 in EMPLOYEE has a DeptID = 7 (a foreign key), a Department with DeptID = 7 must exist in DEPARTMENT

  • The primary key value must be exist before the foreign key value is entered


43
New cards

Null value

is a missing value in a cell in a relation

44
New cards

Problems of Null values

A null is often ambiguous. It could mean…

  • The column value is not appropriate for the specific row

  • The column value is not decided

  • The column value is unknown

  • Each may have entirely different implications


45
New cards

Functional Dependency

A relationship between attributes in which one attribute (or group of attributes) determines the value of another attribute in the same table

  • Illustration… (UnitPrice,Quantity) —> ExtendedPrice


46
New cards

Determinants

The attribute (or attributes) that we use as the starting point (the variable on the left side of the equation) is called a determinant

  • Ex: (UnitPrice,Quantity) = Determinant


47
New cards

A candidate/ primary key

of a relation will functionally determine all other attributes in a relation

48
New cards

Normalization

A process of analyzing a relation to ensure that it is well-formed (well-structured)

  • More specifically, if a relation is normalized (well-formed), rows can be inserted, deleted or modified without creating modification problems (anomalies)


49
New cards

Normalization principles

  • for a relation to be considered well formed, every determinant must be a candidate key

  • Any relation that is not well-formed should be broken into two or more relations that are well formed


50
New cards

Normalization to BCNF

  • a relation is considered normalized when: Every determinant is a candidate key

  • This is Boyce-Codd Normal Form (BCNF)


51
New cards

Normalization Process (putting a relation into BCNF)

  1. Identify all candidate keys of the relation

  2. Identify all the functional dependencies in the relation

  3. If there is a functional dependency that has a determinant that is not a candidate key: A. Place the columns of that functional dependency into a new relation. B. Make the determinant of that functional dependency the primary key of the new relation. C. Leave a copy of the determinant as a foreign key in the original relation. D. Create a referential integrity constraint between the original relation and the new relation

  4. Repeat step 3 until every determinant of every relation is a candidate key


52
New cards

First Normal Form (1NF)

Each cell has only one value, and all entries in a column are of the same kind

53
New cards

Second Normal Form (2NF)

  • Each table is in 1NF and all non-key attributes are determined by only the single attribute primary key of a single attribute

  • No partial functional dependencies exist (some of non-key attributes are determined by a part of the composite primary key)


54
New cards

Third Normal Form (3NF)

  • Each table is in 2NF and no non-key attributes are determined by another non-key attribute (no transitive dependencies)


55
New cards

Boyce Codd Normal Form (BCNF)

Each table is in 3NF and all determinants are candidate keys

56
New cards

Fourth Normal Form (4NF)

Each table is in BCNF and all multivalued dependencies have been moved to their own table

57
New cards

Other Normal Forms

  • Fifth Normal Form (5NF)

  • Domain/Key Normal Form (DK/NF)


58
New cards

Structured Query Language

  • Acronym: SQL

  • Originally developed by IBM as the SEQUEL language in the 1970s

  • SQL-92 is an ANSI national standard adopted in 1992

  • SQL 2011 is current standard


59
New cards

SQL defined

  • SQL is not a programming language, but rather a data sublanguage

  • SQL is compromised of:

  • Data definition language (DDL): which is used to define database structures

  • Data manipulation language (DML): Data definition and updating, data retrieval (Queries)

  • SQL/Persistent Stored Modules (SQL/PSM): Procedural programming capabilities

  • Transaction Control Language (TCL): control transaction behavior

  • Data Control Language (DLC): Grant and revoke database permissions


60
New cards

SELECT

  • is the best known SQL statement

  • will retrieve information from the database that matches the specified criteria using the SELECT/FROM/WHERE framework


61
New cards

Query

  • pulls information from one or more relations and creates (temporarily) a new relation

  • This allows it to:

  • Create a new creation

  • Feed information to another one (as a sub query)


62
New cards

Asterisk

  • To show all of the column values for the rows that match the specified criteria, use an _____ (*)


63
New cards

DISTINCT

This keyword may be added to the SELECT statement to inhibit duplicate rows from displaying

64
New cards

WHERE

This clause stipulates the matching criteria for the record that is to be displayed

65
New cards

AND

Representing an intersection of the data sets

66
New cards

OR

Representing a union of the data sets

67
New cards

IN

the column may equal to any of the values in the list

68
New cards

NOT IN

the column must not be equal to all the values in the list

69
New cards

BETWEEN

  • SQL provides a keyword that allows a user to specify a minimum and maximum value on one line


70
New cards

The WHERE clause operators may include


  • Equals to “=”

  • Not Equal to “<>”

  • Greater than “>”

  • Less than “<“

  • Greater than or Equal to “>=”

  • Less than or Equal to “<=”


71
New cards

The SQL LIKE keyword

allows searches on partial data values

72
New cards

LIKE

can be paired with wildcards to find rows matching a string value

73
New cards

Multiple character wildcard character

is a percent sign (%)

74
New cards

Single character wildcard character

is an underscore (_)

75
New cards

the ORDER BY clause


Query results may be sorted using the

76
New cards

COUNT

counts the number of rows that match the specified criteria

77
New cards

MIN

Finds the minimum value for a specific column for those rows matching the criteria

78
New cards

MAX

Finds the maximum value for a specific column for those rows matching the criteria

79
New cards

SUM

calculates the sum for a specific column for those rows matching the criteria

80
New cards

AVG

Calculates the numerical average of a specific column for those rows matching the criteria

81
New cards

GROUP BY

Subtotals can be calculated using this clause

82
New cards

HAVING

This clause can be used to restrict which data is displayed

83
New cards

Subqueries

The result of a query is a relation. As a result, a query may feed another query.

84
New cards

Joins

Another way of combining data is by using a join

  • Join (also called an Inner Join)

  • Left Outer Join

  • Right Outer Join


85
New cards

Outer join

this syntax can be used to obtain data that exists in one table without matching data in the other table

86
New cards

CREATE

to create database objects

87
New cards

ALTER

To modify the structure and/or characteristics of database objects

88
New cards

DROP

to delete database objects

89
New cards

Insert

will add a new row in a table

90
New cards

Update

will update the data in a table that matches the specified criteria

91
New cards

Delete

Will delete the data in a table that matches the specified criteria

92
New cards

CHECK

this constraint can be used to create sets of values that restrict the values that can be used in a column

  • MSAccess doesn’t support this constraint


93
New cards

SQL View

its a virtual table created by a DBMS-stored SELECT statement which can combine access to data in multiple tables and even in other views

  • MSAccess doesn’t support Views