Relational Databases Flashcards

(10 cards)

1
Q

How does a relational database store data and what are the basic components?

A

Stores data in tables with rows (individual data records/entities) and columns (data attributes/properties). Data is parsed into multiple tables connected using keys

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

What are primary and foreign keys and how do they create connections between tables?

A

Primary keys uniquely identify each record in a table. Foreign keys reference primary keys in other tables, creating relationships and connections between different tables

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

What two key principles govern relational database table design?

A
  1. Each table contains only minimal information with every informational theme (business concept) having its own table. 2. All attributes in a table must depend only on the primary key and nothing else
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why must all attributes in a table depend only on the primary key? Give an example of what violates this rule.

A

Prevents data redundancy and inconsistency. Violation example: A table with CustomerID (primary key), CustomerName, OrderDate, and ProductPrice - ProductPrice depends on the product, not the customer, so it belongs in a separate table

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

What is a Relational Database Management System (RDBMS) and what role does it play?

A

Software that allows interaction with databases - like the operating system of the database. It interprets queries and commands and executes database operations

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

What are the 4 main categories of operations possible on a relational database through an RDBMS?

A
  1. Database Design (planning structure, tables, relationships), 2. Construction (creating and populating database), 3. Data manipulation (insert, delete, update, query), 4. Reporting (summarizing data for analysis)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Distinguish between Database Design and Construction operations with examples.

A

Database Design: Planning structure, designing tables, setting relationships (conceptual work). Construction: Actually creating the database, building tables, populating with initial data (implementation work)

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

Categorize these operations: SELECT queries, CREATE TABLE, INSERT records, generating sales reports, UPDATE customer info, DELETE old records.

A

Data Manipulation: SELECT queries, INSERT/UPDATE/DELETE records. Database Design-Construction: CREATE TABLE. Reporting: generating sales reports

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

What is the relationship between SQL and relational databases?

A

SQL is the programming language specifically used to communicate with and control relational databases - it’s the standard interface for all relational database operations

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

You have customer data: names, addresses, orders, and products. How should this be organized in a relational database and why?

A

Separate tables: Customers (names, addresses), Orders (order details), Products (product info). Each represents a distinct business concept. Tables connected via keys - CustomerID in Orders table, ProductID linking to Products table

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