Midterm Flashcards

1
Q

Data

A

Human-made symbols invented for tracking and communication purposes

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

Metadata

A

Data descriptions specifying data content, relationships, and type; skeleton of a database.

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

Database

A

A collection of organized data (electronic or paper format). A set of records. Database is a part of a database system.

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

Database Management System (DBMS)

A

A software package for creating and managing databases and other elements of a database system.

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

DBMS Product (Database Product)

A

A certain brand of DBMS; DBMS produced by a software vendor (e.g., MS Access, Sybase, Informix).

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

Database System (DBMS Application, Application)

A

An implementation of a DBMS product that includes one or more databases, code, logic and user interface, and is designed to support organizational information needs. The data infrastructure of organizations upon which specific-purpose information systems are built. A DB system with an output designed according to particular business needs can be thought of as an information system.

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

Record

A

A logical unit of organizing data; a set of data describing an instance of a thing that a database system keeps a track of. In the object oriented methodology, a record usually tracks an object.

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

DBMS Components

A

Database engine (Data & Metadata management, Security Management), Query processor (Retrieval), Report writer (Input/Output; User Interface), Application generator (System Development tools).

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

CRUD

A

Create, Read, Update, Delete

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

File Programming Approach (also called Flat File Systems, File/File Processing Systems)

A

Data Files and program files (code) that work on data files, or data and code in the same file.

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

Hierarchical database

A

An older DBMS type that organizes data in hierarchies that can be rapidly searched from top to bottom, e.g., Customer – Order – OrderItem.

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

Network database

A

An older DBMS type that expanded the hierarchical database by supporting multiple connections between entities. A network database is characterized by the requirement that all connections had to be supported by an index.

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

Relational database

A

The most popular type of DBMS. All data is stored in tables (sometimes called relations). Tables are logically connected by the data they hold (e.g., through the key values). Relational databases should be designed through data normalization.

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

Object-Oriented Databases

A

The goal is to define

objects that can be reused in many programs—thus saving time and reducing errors.

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

Object-Relational DB Systems

A
  • More frequent than pure object-oriented systems.
  • Architecture:
  • -Database is relational
  • -Objects are created in main memory according to class diagram and business rules, and populated by data from the relational databases.
  • -System operations, then, performed by objects.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Database Engine Components

A

data dictionary, concurrency and lock manager, recovery manager, disk space manager

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

Data-Program Dependence

A

File systems; tight coupling between data and code—programs working on data

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

Data-Program Independence

A

Database approach; decoupling of code, data, and metadata

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

Class Diagram

A

A static model of classes and their relationships (classes & relationships) and write business rules.

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

Entity

A

The aspect of reality recorded in the system. (Example: Customer) (DEFINITION: An item in the real world that we wish to identify and track.)

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

Class

A

Description of an entity, which includes its attributes (properties) and behavior (methods, procedures). (Example: Customer, includes attributes and behavior) (DEFINITION: A descriptor for a set of objects with similar structure, behavior, and relationships. That is, a class is the model description of the business entity. A business model might have an Employee class, where one specific employee is an object in that class.)

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

Object (Class Instance)

A

One instance of a class with specific data; a record in a database. (Example: 12257, Joe Jones… (a specific customer)) (DEFINITION: An instance or particular example of a class. For example, in an Employee class, one individual employee would be an object. In a relational environment, a class is stored as a table, while an individual row in the table contains data for one object.)

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

Property (Attribute)

A

a data property of a class; an aspects of an entity. (Example: CustID, Name…) (DEFINITION: A feature or characteristic of an entity. An attribute will become a column in a data table. Employee attributes might include name, address, date hired, and phone.)

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

Method (Procedure, Behavior)

A

Procedures (methods, processes, functions) performed by the class. (Example: AddCustomer, DeleteCustomer… CRUD). (DEFINITION: A function or operation that a class can perform. For example, a Customer class would generally have an AddNew method that is called whenever a new customer object is added to the database.)

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

Degree of Association

A

Association Degree refers to the number of classes involved in an association: 1) Class with itself - unary: rare. 2) Between 2 classes - binary (previous slide); most frequent and most important!) 3) Between 3 or more classes - N-ary; rare. (A Association is a connection between classes or between entities).

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

Association Multiplicity (Cardinality)

A
  • One-to-many (1:M) (Example: Customer-Order)
  • Many-to-many (M:N) (Example: Order-Item)
  • One-to-one (1:1) (Example:Customer-BillingAddress)
    (A Multiplicity refers to the number of objects participating in a relationship)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Minimum Multiplicity

A

1 or 1…1

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

Maximum Multiplicity

A
  • or 0…*
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

N-ary Association

A

An association among three or more classes. It is drawn as a diamond on a UML class diagram. The term comes from extending English terms: unary means one, binary means two, ternary means four; so N-ary means many.

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

Multiplicity Question

A

One object on your side of the association can be associated with how many objects on the opposite side of the association? The switch side and ask the same question.
Or, how many objects on your side of the association can be associated with one object on the opposite side of the association? The switch side and ask the same question.

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

Generalization

A

A relationship among classes that begins with a generic class. More detailed classes are derived from it and inherit the properties and methods of the higher-level classes.

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

Aggregation

A

The generic name for several SQL functions that operate across the selected rows. Common examples include SUM, COUNT, and AVERAGE.

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

Composition

A

A relationship in which an object is composed of a collection of other objects. For example, a bicycle is built from components. In UML, it is indicated with a small filled diamond on the association end.

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

Inheritance

A

In object-oriented design, the ability to define new classes that are derived from higher-level classes. New classes inherit all prior properties and methods, so the programmer only needs to define new properties and methods.

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

Polymorphism

A

In a class hierarchy each new class inherits methods from the prior classes. Through polymorphism you can override those definitions and assign a new method (with the same name) to the new class.

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

Computed Attribute

A

Denotes computed values. Written with a slash (/). Common example in business DB system: Sub = Item’s Sale Price * Quantity Sold

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

Event

A

Something that arises during database or form operations. Events are named and developers can write code that is executed when a specific event is triggered. (Example: Change in organization: Item is sold) Look at Trigger.

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

Trigger

A

An event that causes a procedure to be executed. For example, clicking a button can be a trigger, as can a change in a data value. (Example: Change in organization: Decrease inventory count) Look at Event.

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

Data Domain (Type)

A

Format of data (e.g., text vs. number) and the range of values. (Look at Data Types (Domains) CH. 2 Part 2 Slide 8)

40
Q

Data normalization

A

The process of putting data into the format of relational databases or organizing data into correctly designed tables.

41
Q

Table

A

A collection of data for one class or entity. It consists of columns for each attribute and a row of data for each specific entity or object.

42
Q

Relational Database

A

A collection of tables (relations). Tables store atomic data. The most popular type of DBMS. All data is stored in tables (sometimes called relations). Tables are logically connected by the data they hold (e.g., through the key values). Relational databases should be designed through data normalization.

43
Q

Primary Key Column (Primary Key, Key, PK)

A

A column or set of columns that identify a particular row in a table.

44
Q

Surrogate Key

A

Internally generated keys used to identify objects. They are often better keys than keys created by external sources because they are easier to guarantee uniqueness. See AutoNumber.

45
Q

Foreign Key (FK)

A

A column in one table that is a primary key in a second table. It does not need to be a key in the first table. For example, in an Order table, CustomerID is a foreign key because it is a primary key in the Customer table.

46
Q

First Normal Form (1 NF)

A

A table is in 1NF when there are no repeating groups within it. Each cell can contain only one value. For example, how may items can be placed in one Order table? The items repeat, so they must be split into a separate table.

47
Q

Second Normal Form (2 NF)

A

A table is in 2NF if every nonkey column depends on the entire key (not just part of it). This issue arises only if there is a concatenated key (with multiple columns).

48
Q

Third Normal Form (3 NF)

A

A table is in third normal form (3NF) if each nonkey column depends on the whole key and nothing but the key.

49
Q

Insertion Anomaly

A

Problems that arise when you try to insert data into a table that is not in third normal form. For example, if you find yourself repeatedly entering the same data (e.g., a customer’s address), the table probably needs to be redefined.

50
Q

Deletion Anomaly

A

Problems that arise when you delete data from a table that is not in third normal form. For example, if all customer data is stored with each order, when you delete an order, you could lose all associated customer data.

51
Q

Non-key Column (Non-key)

A

Other Attributes that are not keys are called non-keys. A non-key depends on key

52
Q

Concatenated (Combined, Composed) Key

A

A compound key is a key that consists of 2 or more attributes that uniquely identify an entity occurrence

53
Q

Dependency (Dependence) among columns

A

An attribute depends on another attribute if the change of its value is caused by a change of the other attribute.
The key column must be sufficient for determining values of the non-key columns.

54
Q

Shorthand notation for classes & tables

A

Customer (TABLE NAME) (CustomerID (PRIMARY KEY IS UNDERLINED), LastName, FirstName, Address, City, State, ZipPostalCode, TelephoneNumber(NON-KEY COLUMNS))

55
Q

Rules of thumb for normalization:

A

Break every many-to-many relationship into two, with the goal of getting to one-to-many relationships. Make sure the relationship between PK and FK is 1:M.

56
Q

If a table has repeating sections, there is huge redundancy, different classes are mixed together, and all anomalies occur. Split the table, so that classes are clearly differentiated.

A

1NF: A table is in 1NF if it does not have repeating sections.

57
Q

If a table has a combined key, non-key columns may depend on just a part of the primary key, and so there is partial functional dependency. Split the table so that in new tables non-keys depend on the entire key.

A

2NF: A table is in 2NF if it is in 1NF and non-key columns depend on the entire key.

58
Q

If a non-key depends on another non-key, there is transitive dependency. Split the table so that in new tables each non-key depends on the key and nothing but the key.

A

3NF: A table is in 3NF if it is in 2NF and all non-keys depend on the key only.

59
Q

Pointer

A

A logical or physical address of piece of data. Address of data, designation of data location.

60
Q

Sequential File

A

Sequential files are the simplest method of storing data. Each row is stored in a predefined order. As long as the data is retrieved in the order specified, access is fast and storage space is used efficiently. The real problems arise when data is added or when users need to retrieve data in several different sequences.

61
Q

Linked List

A

To solve the insert problem, indexes are generally based on linked lists instead of sequential lists. A linked list is a technique that splits data even further than a sequential index. With a linked list, any index element can be stored separately. A pointer is then used to link to the next index item. In this example each row of data is stored separately. Then an index is created that is keyed on LastName. However, each element of the index is stored separately. An index element consists of three parts: the key value, a pointer to the associated data element, and a pointer to the next index element.

62
Q

B+ Tree

A

It is clear that binary searches are efficient, but how does that help with linked lists on indexes. First, recognize that indexes are sorted, so it should be possible to use a similar approach. Second, think about the list for a few minutes, and you can see that it can be reorganized. Instead of trying to store it sequentially, grab the middle entry (the starting point for any search), and build a tree structure. In many ways, a tree is just a more complex way of storing a linked list. Instead of linear, it contains multiple links.

63
Q

Hashing Method (Hash Table)

A

A hash table (also hash map) is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.

64
Q

Binary Search

A

A search technique for sorted data. Start at the middle of the data. If the search value is greater than the middle value, split the following data in half. Keep reducing by half until the value is found.

65
Q

Data Clustering

A

Grouping related data together to improve retrieval.

  • Data should be close to each other on one disk.
  • Preferably within the same disk page or cylinder.
  • Minimize disk reads and seeks.
  • Example: cluster each invoice with the matching order.
66
Q

File Partitioning

A

File partitioning may be useful for any of the following reasons:

  • Data volumes are too large to be managed within a single file;
  • Separate files need a consolidated view as well as an individual view;
  • Data archiving is needed with an efficient, high-performance recall capability.
67
Q

Indexed Sequential Access Method (ISAM Index)

A

A data storage method that relies on an index to search and retrieve data faster than a pure sequential search.

68
Q

List of File Types and Access Methods

A

Indexed Sequential Access Method (ISAM) & Sequential File, Linked List Index, B+ Tree index & Hash Index.

69
Q

List of File Types and Access Methods (Similarities & Differences)

A

B+-Tree is best overall, Hashing is good for high-speed random access, & sequential/ISAM is good if entire larger tables often used.

70
Q

Operators

A

The forms of implementing constraints in queries; they can be relational operators (=, >, <, etc.), Boolean operators, and others (e.g., BETWEEN…AND, LIKE).

71
Q

DeMorgan’s law

A

An algebraic law that states: To negate a condition that contains an AND or an OR connector, you negate each of the two clauses and switch the connector. An AND becomes an OR and vice versa.

72
Q

Boolean Operator

A

Are simple words (AND, OR, NOT or AND NOT) used as conjunctions to combine or exclude keywords in a search, resulting in more focused and productive results. This should save time and effort by eliminating in appropriate hits that must be scanned before discarding.

73
Q

Boolean Operator AND

A

Requires both terms to be in each item returned. If one term is contained in the document and the other is not, the item is not included in the resulting list. (Narrows the search) Example: A search on stock market AND trading includes results contains: stock market trading; trading on the stock market; and trading on the late afternoon stock market.

74
Q

Boolean Operator NOT

A

(Dependent upon the coding of the database’s search engine) – the first term is searched, then any records containing the term after the operators are subtracted from the results. (Be careful with use, as the attempt to narrow the search may be too exclusive and eliminate good records). If you need to search the word not, that can usually be done by placing double quotes (&laquo_space;») around it. Example: A search on Mexico AND NOT city includes results contains: New Mexico; the nation of Mexico; US-Mexico trade; but does not return Mexico City or This city’s trade relationships with Mexico.

75
Q

Boolean Operator OR

A

Either term (or both) will be in the returned document. (Broadens the search) Example: A search on ecology OR pollution includes results contains: documents containing the world ecology (but not pollution) and other documents containing the word pollution (but not ecology) as well as documents with ecology and pollution in either order or number of uses.

76
Q

Query

A

To extract meaningful data from database, which help us answer business questions. Querying databases is where business value form a DB system is drawn.

77
Q

Null value

A

A missing (or currently unassigned) value. A blank cell, missing data

78
Q

Structured Query Language (SQL)

A

A standardized database language, used for data retrieval (queries), data definition, and data manipulation.

79
Q

Aggregate functions

A

The generic name for several SQL functions that operate across the selected rows. Examples: Sum, Avg, Min, Max, Count, StDev, Var.

80
Q

Truth table using AND, OR, and NOT

A

Check slide 13 in Chapter 4.
A(T) - B(T) - A AND B (T) - A OR B (T)
A(T) - B(F) - A AND B (F) - A OR B (T)
A(F) - B(T) - A AND B (F) - A OR B (T)
A(F) - B(F) - A AND B (F) - A OR B (F)
A(T) - B(-) - A AND B (NOT A) - A OR B (F)
A(F) - B(-) - A AND B (NOT A) - A OR B (T)

81
Q

Structure of SQL Query run on one table (order of command lines)

A

SELECT, FROM, INNER JOIN, WHERE, GROUP BY, HAVING, ORDER BY.

82
Q

SQL statement: Someone From Ireland Would Grow Horseradish and Onion.

A

SELECT, FROM, INNER JOIN, WHERE, GROUP BY, HAVING and ORDER BY.

83
Q

Inner or Equi-Join

A

A SQL equality join condition. Rows from two tables are joined if the columns match exactly. Equi-join is the most common join condition. Rows that have no match in the other table are not displayed.

84
Q

LEFT JOIN

A

An outer join that includes all of the rows from the “left” table, even if there are no matching rows in the “right” table. The missing values are indicated by Nulls. See right join and inner join. Left and right are defined by the order the tables are listed; left is first.

85
Q

RIGHT JOIN

A

An outer join that includes all the rows from the “right” table, even if there are no matching rows in the “left” table. The missing values are indicated by Nulls. See right join and inner join. Left and right are defined by the order the tables are listed; left is first.

86
Q

Nested Query or Subquery

A

Using a second query to retrieve additional data within the main query. For example, to retrieve all sales where price was greater than the average, the WHERE clause could use a subquery to compute the average price.

87
Q

UNION

A

An SQL clause to combine rows from two SELECT statements. Both queries must have the same number of columns with the same domains. Most systems also support INTERSECT and EXCEPT (or SUBTRACT) operators.

88
Q

IN clauses in SQL

A

A SQL WHERE clause operator typically used with subqueries. It returns a match if the selected item matches one of the items in the list. For example, WHERE ItemID IN (115, 235, 536) returns a match for any of the items specified. Typically, another SELECT statement is inserted in the parentheses.

89
Q

NOT IN clauses in SQL

A

The SQL negation operator. Used in the WHERE clause to reverse the truth value of a statement. Which animals have not been sold? Start with list of all animals. Subtract out list of those that were sold.

90
Q

SELECT Merchandise.ItemID, Merchandise.Description, Merchandise.ListPrice
FROM Merchandise
WHERE (((Merchandise.ListPrice)>(Select Avg(ListPrice) FROM Merchandise)))
ORDER BY Merchandise.ListPrice DESC;

A

The query will output item IDs, decriptions and list price for the merchandise items with a list price greater than the average list price of all merchandise items

91
Q

SELECT Animal.Gender, Avg([SaleDate]-[OrderDate])
FROM Sale INNER JOIN (AnimalOrder INNER JOIN
((Animal INNER JOIN AnimalOrderItem ON
Animal.AnimalID=AnimalOrderItem.AnimalID) INNER JOIN
SaleAnimal ON Animal.AnimalID = SaleAnimal.AnimalID) ON
AnimalOrder.OrderID = AnimalOrderItem.OrderID) ON
Sale.SaleID = SaleAnimal.SaleID
WHERE Animal.Category=”Cat”
GROUP BY Animal.Gender;

A

The query will output the gender and the average time between ordering and selling cats.

92
Q

SELECT Sale.CustomerID, Customer.LastName, Customer.FirstName, Sum([SalePrice][Quantity]) AS [Monthly Total]
FROM (Customer INNER JOIN Sale ON Customer.CustomerID = Sale.CustomerID)
INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID
WHERE Month(Sale.SaleDate)=5
GROUP BY Sale.CustomerID, Customer.LastName, Customer.FirstName
ORDER BY Sum([SalePrice]
[Quantity]) Desc;

A

The query will output customers’ IDs, last names, first names, and their total expenditures in May and sort the output by the total expenditure in decreasing order.

93
Q

SELECT DISTINCT Employee.EmployeeID, Employee.LastName,
Employee.FirstName
FROM Employee INNER JOIN Sale ON Employee.EmployeeID = Sale.EmployeeID
WHERE (((Sale.SaleDate) Between #6/15/2007# And #6/30/2007#));

A

The query will output IDs, last names and first names for those employees that sold something between June 15-30, 2007 (or in the last two weeks of June 2007).

94
Q

SELECT Animal.AnimalID, Animal.Name, Animal.Category, [DateOrder]-[OrderBorn]
AS Days, AnimalOrder.OrderDate
FROM AnimalOrder INNER JOIN (Animal INNER JOIN AnimalOrderItem
ON Animal.AnimalID = AnimalOrderItem.AnimalID)
ON AnimalOrder.OrderID = AnimalOrderItem.OrderID
WHERE ( ( ([OrderDate]-[DateBorn]) Between 0 And 30) );

A

The query will output IDs, names, category and the period between the birth and order date for those animals that were orderd up to 30 days after thier birth (or that were less than a month 30 old when ordered).

95
Q

SELECT DISTINCT Employee.LastName
FROM Employee INNER JOIN (Sale INNER JOIN SaleAnimal
ON Sale.SaleID = SaleAnimal.SaleID) ON Employee.EmployeeID = Sale.EmployeeID
WHERE (((Sale.SaleDate) Between #2/1/2007# And #2/28/2007#))
AND Employee.EmployeeID NOT IN
(SELECT Sale.EmployeeID
FROM Sale INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID
WHERE (((Sale.SaleDate) Between #2/1/2007# And #2/28/2007#)));

A

The query will output last names of the employees that sold animals but no merchandise in February 2007?