Professional Documents
Culture Documents
Week 1 686 F2022
Week 1 686 F2022
Week 1 686 F2022
Database Management
Fall 2022 | Section: 1 | Schedule: 22637
Tuesday, 4:00 – 6:40 PM | GMCS 305
DM Goldberg
1
Today
• Course admin/policy
• Syllabus information
• Canvas
• Course materials
2
Masks
• SDSU policy is that masks are required in class until
September 15th
3
Instructor
• David Goldberg
• Email: dgoldberg@sdsu.edu
4
Office hours over Zoom
• My office is small… Office hours are over Zoom for now
5
This course
• Database management course
• Why database?
• One of the most important industry skills for
business/data analytics
• Versatile and useful for many applications
6
Plan for this semester
• Part 1: database design
• Before any programming, setting up a database
efficiently to avoid problems in the future
8
Homework
• 6 homeworks assigned throughout the semester
• At least one week to complete each homework
• Submit assignment through the course website (Canvas)
• Each homework is due before midnight on the deadline
(11:59 PM)
9
Quizzes
• 6 quizzes given in-class throughout the semester
10
Honor code
• Everything in this class is an individual assignment
unless explicitly stated otherwise
11
Course materials
• You don’t need a textbook!
12
Installation – important for later
• Not yet, but later this semester, we will need a
database development environment to create and
work with our databases
13
Canvas
• Our course website this semester is on Canvas
14
History of data management
• Computerized file-based systems
• Composed of large “flat” files – think large Excel
spreadsheets
• Each business unit maintains its own files
• Dedicated staff (“data processing specialist”) in each
business unit to manage data
15
History of data management
• Example library “flat” file:
ISBN Title AuID AuName PubID PubName PubPhone Price
1-1111- C++ 4 Roman 1 Big House 123-456- $29.95
1111-1 7890
0-99- Emma 1 Austen 1 Big House 123-456- $20.00
999999-9 7890
0-91- Hamlet 5 Shakespeare 2 Alpha 999-999- $20.00
045678-5 Press 9999
0-11- Moby 2 Melville 3 Small 714-000- $49.00
345678-9 Dick House 0000
0-91- Fairie 3 Spencer 1 Big House 123-456- $15.00
335678-7 Queene 7890
16
Some terminology
• Table or “relation”: matrix of intersecting rows and
columns, or the entire flat file
17
Some terminology
• Field or “attribute”: a characteristic of an entity
(column in the table)
• For example, ISBN, Title, etc.
18
Some terminology
Table or “relation”: matrix of intersecting rows
and columns, or the entire flat file
19
Some terminology
Field or “attribute”: a characteristic of an entity
(column in the table)
20
Some terminology
Record or “tuple”: the data about one specific
instance of an entity (row in the table)
21
History of data management
22
Problems with file-based systems
• Data isolation: sharing of information between
departments is challenging
24
Update anomaly
• What if we need to update Big House’s phone number?
ISBN Title AuID AuName PubID PubName PubPhone Price
1-1111- C++ 4 Roman 1 Big House 123-456- $29.95
1111-1 7890
0-99- Emma 1 Austen 1 Big House 123-456- $20.00
999999-9 7890
0-91- Hamlet 5 Shakespeare 2 Alpha 999-999- $20.00
045678-5 Press 9999
0-11- Moby 2 Melville 3 Small 714-000- $49.00
345678-9 Dick House 0000
0-91- Fairie 3 Spencer 1 Big House 123-456- $15.00
335678-7 Queene 7890
25
Data anomalies
• Insertion anomaly: due to extra fields in the data
structure, we may not be able to insert a new
record until we can fill in every field
26
Insertion anomaly
• What if we need to add information for a new publisher,
“Beta Press”, with a phone number of 444-444-4444?
28
Deletion anomaly
• What happens to the data for the publisher “Small
House” if we want to delete Moby Dick?
• IBM didn’t really see the point, but others did, and
Oracle started to popularize RDBMS around 1980
30
Example relational structure
Authors
AuID AuName
Books
4 Roman
ISBN Title AuID PubID Price
1 Austen
1-1111- C++ 4 1 $29.95
5 Shakespeare 1111-1
2 Melville 0-99- Emma 1 1 $20.00
999999-9
3 Spencer 0-91- Hamlet 5 2 $20.00
045678-5
Publishers 0-11- Moby 2 3 $49.00
345678-9 Dick
PubID PubName PubPhone
0-91- Fairie 3 1 $15.00
1 Big House 123-456-7890 335678-7 Queene
2 Alpha Press 999-999-9999
3 Small House 714-000-0000
31
Example relational structure
• Addressing the data anomalies:
32
Example relational structure
Authors
AuID AuName
Books
4 Roman
ISBN Title AuID PubID Price
1 Austen
1-1111- C++ 4 1 $29.95
5 Shakespeare 1111-1
2 Melville 0-99- Emma 1 1 $20.00
999999-9
3 Spencer 0-91- Hamlet 5 2 $20.00
045678-5
Publishers 0-11- Moby 2 3 $49.00
345678-9 Dick
PubID PubName PubPhone
0-91- Fairie 3 1 $15.00
1 Big House 123-456-7890 335678-7 Queene
2 Alpha Press 999-999-9999
3 Small House 714-000-0000
33
Example relational structure
• Addressing the data anomalies:
34
Example relational structure
Authors
AuID AuName
Books
4 Roman
ISBN Title AuID PubID Price
1 Austen
1-1111- C++ 4 1 $29.95
5 Shakespeare 1111-1
2 Melville 0-99- Emma 1 1 $20.00
999999-9
3 Spencer 0-91- Hamlet 5 2 $20.00
045678-5
Publishers 0-11- Moby 2 3 $49.00
345678-9 Dick
PubID PubName PubPhone
0-91- Fairie 3 1 $15.00
1 Big House 123-456-7890 335678-7 Queene
2 Alpha Press 999-999-9999
3 Small House 714-000-0000
4 Beta Press 444-444-4444
35
Example relational structure
• Addressing the data anomalies:
36
Example relational structure
Authors
AuID AuName
Books
4 Roman
ISBN Title AuID PubID Price
1 Austen
1-1111- C++ 4 1 $29.95
5 Shakespeare 1111-1
2 Melville 0-99- Emma 1 1 $20.00
999999-9
3 Spencer 0-91- Hamlet 5 2 $20.00
045678-5
Publishers 0-11- Moby 2 3 $49.00
345678-9 Dick
PubID PubName PubPhone
0-91- Fairie 3 1 $15.00
1 Big House 123-456-7890 335678-7 Queene
2 Alpha Press 999-999-9999
3 Small House 714-000-0000
37