CPS 430 - Database Exam Guide

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

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.

56 Terms

1
New cards

DBMS vs File Processing

DBMS provides centralized control, minimal redundancy, and data independence; file systems are app-specific, redundant, and inconsistent.

2
New cards

Advantages of DBMS

Data integrity, security, concurrency control, recovery, and abstraction.

3
New cards

Three-Level Architecture

External (views), Conceptual (entire DB), Internal (storage).

4
New cards

Mapping

Translation between database levels.

5
New cards

Logical Data Independence

Change conceptual schema without changing external views.

6
New cards

Physical Data Independence

Change storage without affecting conceptual schema.

7
New cards

Entity

Real-world object represented in the database.

8
New cards

Attribute Types

Simple, composite, multivalued, derived, key.

9
New cards

Relationship Types

One-to-one, one-to-many, many-to-many.

10
New cards

Structural Constraints

Cardinality ratio and participation constraint.

11
New cards

Weak Entity

Exists only through an identifying relationship with a strong entity.

12
New cards

Existence Dependency

Weak entity depends on the existence of another entity.

13
New cards

Referential Integrity

Foreign key must reference an existing primary key or be NULL.

14
New cards

Entity Integrity

Primary key cannot be NULL.

15
New cards

Referential Integrity Actions

RESTRICT, CASCADE, or SET NULL on update/delete.

16
New cards

Convert ER to Relational Schema

Entities → tables, attributes → columns, 1

17
New cards

Tuple Properties

Unordered; duplicates not allowed.

18
New cards

Relational Algebra Core Operators

σ (Select), π (Project), × (Product), ∪ (Union), − (Difference).

19
New cards

Derived Operators

∩ (Intersection), ⋈ (Join), ÷ (Division), ⟕ (Outer Join).

20
New cards

Union Compatibility

Same number and type of attributes required for set operations.

21
New cards

Relational Algebra Example

π Fname,Lname (σ Dno=5 ∧ Hours>10 ∧ Pname='ProductX' (Employee ⨝ Works_on ⨝ Project)).

22
New cards

DDL Commands

CREATE, ALTER, DROP; define or modify schema.

23
New cards

Integrity Constraints in SQL

PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL.

24
New cards

DML Core Syntax

SELECT-FROM-WHERE for data retrieval.

25
New cards

SQL Aliases

Shorten table names using AS.

26
New cards

DISTINCT Keyword

Removes duplicate rows from query output.

27
New cards

NULL Handling

Use IS NULL or IS NOT NULL in SQL conditions.

28
New cards

Aggregate Functions

SUM, AVG, COUNT, MAX, MIN.

29
New cards

Grouping in SQL

GROUP BY and HAVING for aggregate filtering.

30
New cards

Subquery Types

Correlated (depends on outer query) vs Uncorrelated.

31
New cards

Supervised Employees Query

SELECT e.fname,e.lname FROM employee e, employee s WHERE e.superssn=s.ssn AND s.fname='Franklin' AND s.lname='Wong';

32
New cards

Managers in Research Query

SELECT fname,lname FROM employee,department WHERE dno=dnumber AND ssn=mgrssn AND dname='Research';

33
New cards

Dependents A% Query

SELECT fname,lname FROM employee,dependent WHERE ssn=essn AND dependent_name LIKE 'A%';

34
New cards

Works on Dept 5 Projects Query

SELECT fname,lname FROM employee,works_on,project WHERE ssn=essn AND pno=pnumber AND dnum=5;

35
New cards

Instance vs Schema

Instance = data; Schema = definition of structure.

36
New cards

Degree of Relation

Number of attributes.

37
New cards

Cardinality of Relation

Number of tuples.

38
New cards

Surrogate Key

Artificial unique identifier used as PK.

39
New cards

Superkey

Any attribute set that uniquely identifies a tuple.

40
New cards

Candidate Key

Minimal superkey with no redundant attributes.

41
New cards

Foreign Key

Attribute referencing another table’s primary key.

42
New cards

Purpose of a DBMS

Manage data efficiently, ensure integrity, enable concurrent access.

43
New cards

Primary SQL Integrity Principle

Enforce both entity and referential integrity across relations.

44
New cards

Common Aggregate Mistake

Using HAVING without GROUP BY returns single-group results.

45
New cards

Correlated Subquery Example

SELECT ename FROM employee e WHERE salary > (SELECT AVG(salary) FROM employee WHERE deptno = e.deptno);

46
New cards

Normalization Goal (preview)

Minimize redundancy and dependency anomalies.

47
New cards

Schema Mapping Rule

Each ER relationship becomes one or more foreign keys or a new relation.

48
New cards
Simple Attribute
An attribute that cannot be divided further; it has a single atomic value (e.g., FirstName, Age).
49
New cards
Composite Attribute
An attribute made up of smaller parts that can be broken down (e.g., Name = {FirstName, LastName}).
50
New cards
Multivalued Attribute
An attribute that can have multiple values for a single entity (e.g., PhoneNumbers for one person).
51
New cards
Derived Attribute
An attribute that is calculated or derived from other attributes (e.g., Age derived from DateOfBirth).
52
New cards
Key Attribute
An attribute or combination of attributes that uniquely identifies each entity in a set (e.g., StudentID).
53
New cards
One-to-One Relationship
Each entity in one set is related to at most one entity in another set (e.g., each person has one passport).
54
New cards
One-to-Many Relationship
A single entity in one set is related to multiple entities in another (e.g., one department has many employees).
55
New cards
Many-to-Many Relationship
Multiple entities in one set can relate to multiple entities in another (e.g., students enroll in many courses, and courses have many students).
56
New cards