Quiz 1 Flashcards

(74 cards)

1
Q

What is a Database?

A

An organized collection of structured data, typically stored electronically and accessed via a DBMS.

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

What is the primary purpose of a Database?

A

To store, manage, retrieve, and manipulate data efficiently and securely.

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

List the ideal qualities of a Database.

A
  • Low redundancy
  • High consistency
  • Integrity enforcement
  • Data independence
  • Concurrency
  • Durability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Who are the common users of a Database?

A
  • End users: Access data via applications
  • Developers: Build and maintain data-driven applications
  • DBAs: Oversee performance, backups, security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does DBA stand for?

A

Database Administrator

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

What is a DBMS?

A

Database Management System: Software used to define, manipulate, retrieve, and manage data.

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

Define Data Model.

A

Abstract framework defining how data is structured (e.g., relational).

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

What is a Schema in a Database?

A

The structure of a database — tables, fields, relationships.

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

What is an Instance in Database terminology?

A

A snapshot of the data in the database at a given time.

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

What does Structure refer to in a Database?

A

The logical arrangement of data (schemas, tables).

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

What is Integrity in the context of Databases?

A

Ensures data correctness and adherence to constraints.

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

What does Manipulation refer to in Databases?

A

Operations like insert, delete, update, select.

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

What is DDL?

A

Data Definition Language: SQL commands like CREATE, DROP, ALTER.

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

What is DML?

A

Data Manipulation Language: SQL commands like SELECT, INSERT, DELETE.

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

What are the two types of Data Independence?

A
  • Logical: Change schema without altering apps
  • Physical: Change storage without changing schema
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define Transaction in the context of Databases.

A

A sequence of operations that form a single logical unit of work.

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

What does ACID stand for?

A
  • Atomicity: All or nothing
  • Consistency: DB rules preserved
  • Isolation: Transactions don’t interfere
  • Durability: Changes persist after commit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the three levels of Database Architecture?

A
  • External: User views
  • Conceptual: Logical view (what data is stored)
  • Internal: Physical storage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

At which level do users primarily interact with the Database?

A

External level.

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

At which level do developers primarily interact with the Database?

A

Conceptual level.

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

What is the Relational Model in Databases?

A

Data as tables with rows and columns.

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

Define NoSQL.

A

Non-relational databases for flexible or large-scale data (e.g., document or key-value stores).

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

What is a Relation in SQL?

A

Table.

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

What is an Attribute in SQL?

A

Column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is a Tuple in SQL?
Row.
26
What is a Super Key?
Set of attributes that uniquely identifies a row.
27
What is a Candidate Key?
Minimal super key (no extra attributes).
28
Define Primary Key.
Chosen candidate key used as the main identifier.
29
What is a Foreign Key?
Attribute referencing a primary key in another table.
30
What defines a Good Primary Key?
* Unique * Minimal * Stable
31
What defines a Bad Primary Key?
* Long * Changeable * Non-unique values
32
List the Basic Datatypes in SQLite.
* TEXT * INTEGER * REAL * BLOB * NULL
33
What are the Constraints in SQLite?
* PRIMARY KEY * UNIQUE * NOT NULL
34
List key SQL Commands.
* CREATE TABLE * SELECT * INSERT INTO * UPDATE * DELETE * DROP TABLE * BEGIN * ROLLBACK * COMMIT
35
Define Entity in ER Diagrams.
A real-world object (e.g., Student).
36
What is an Entity Set?
Collection of similar entities.
37
What is a Strong Entity?
Has its own primary key.
38
What is a Weak Entity?
Depends on a strong entity; no full key.
39
Define Relationship in ER Diagrams.
Association between entities.
40
What is Cardinality?
Defines the number of instances in a relationship (1:1, 1:N, M:N).
41
What is Total Participation in ER Diagrams?
All entities in the set must participate.
42
What are the Attribute Types in ER Diagrams?
* Multivalued: Set of values (double ovals) * Composite: Made of subparts (branched ovals) * Derived: Computed from other data (dashed ovals)
43
What does Unary/Binary/Ternary refer to in ER Diagrams?
Relationships involving 1, 2, or 3+ entities.
44
What is Generalization in data modeling?
Combine sub-entities.
45
What is Specialization in data modeling?
Create sub-entities with extra attributes.
46
Define Subclassing in data modeling.
Represent inheritance in data modeling.
47
What does Selection (σ) do in Relational Algebra?
Filters rows.
48
What does Projection (π) do in Relational Algebra?
Chooses columns.
49
What does Renaming (ρ) do in Relational Algebra?
Renames relation/attributes.
50
What does Union (∪) do in Relational Algebra?
Combines tuples from two relations.
51
What does Intersection (∩) do in Relational Algebra?
Tuples in both relations.
52
What does Difference (−) do in Relational Algebra?
Tuples in one but not the other.
53
What does Cartesian Product (×) do in Relational Algebra?
All combinations of tuples.
54
What does Natural Join (⨝) do in Relational Algebra?
Join by common attributes.
55
What are the types of Joins?
* INNER: Matches only * LEFT OUTER: Keep left unmatched rows * RIGHT OUTER: Keep right unmatched * FULL OUTER: Keep all unmatched
56
What does Division (÷) do in Relational Algebra?
"For all" queries.
57
What are Aggregation functions in Relational Algebra?
* SUM * MAX * MIN * AVG * COUNT
58
What does Assignment (←) do in Relational Algebra?
Save query result.
59
What is a Functional Dependency (FD)?
FD (A → B): A determines B.
60
What is an Attribute Closure (A⁺)?
All attributes derivable from A.
61
What are the FD Rules?
* Reflexivity * Augmentation * Transitivity * Pseudo-transitivity * Union * Decomposition
62
What is the purpose of Normalization?
Reduce redundancy and improve integrity.
63
What does 1NF stand for?
Only atomic values; no repeating groups.
64
What does 2NF stand for?
No partial dependency on composite keys.
65
What does 3NF stand for?
No transitive dependencies.
66
What does BCNF stand for?
Left side of every FD is a super key.
67
What is Decomposition in the context of normalization?
Splitting tables to eliminate anomalies.
68
What is a tradeoff in normalization?
More joins; potentially slower queries.
69
Reflexivity (FD)
A → B if B ⊆ A
70
Augmentation (FD)
A → B implies AC → BC
71
Transitivity (FD)
A → B, B → C ⇒ A → C
72
Pseudo-transitivity (FD)
A → B, BC → D ⇒ AC → D
73
Union (FD)
A → B and A → C ⇒ A → BC
74
Decomposition (FD)
A → BC ⇒ A → B, A → C