Professional Documents
Culture Documents
Xiaoying Tu
About me…
o Xiaoying Tu
• Phonetically: Shiau-ing Too
• Or simply: X.T.
o Post-doc Teaching Fellow (Dietrich & Heinz Colleges)
o For the past 35 years of my life:
© Chinatour.net
o Research: How IT innovations (digitization + internet) disrupted film and music industries
o Teaching:
• Instructor for Database Management and Data Mining
• Recitation leader & teaching assistant for master’s courses at Heinz
Your Turn…
Course Logistics – Important Documents
o Course Syllabus
• Assessment components
• Late submission policy + how late passes work
• Participation + “Two-strikes” rule
• Policy on collaboration and cheating
• … and many more
o Course Schedule
• Lecture topics and dates
• Suggested reading
• Submission deadlines
o You must only attend the classes and office hours of Section A. Do
not switch to the other sections of 95-703 on an ad-hoc basis.
o If you are not registered for Section A, you must attend the section
which you are registered for.
Course Logistics – Student Evaluation
Assessment Component Grade Percentage
Homework Assignments (4) 20%
Project 20%
Customer Physical
needs Model
The Database 3. Additional Topics
Views, indexes, Data Integration, …
Conceptual Logical
Model Model
o Data models
DBMS
persistence
files
Example: A Simple File System
What’s wrong with File Systems?
o Hard to query
• Need to write dedicated program for even the simplest report
o Structural Dependence
• Once you change a file structure, all reports built upon it needs modification.
o Data Dependence
• Changes in the characteristics of data (e.g. changing a field from integer to decimal)
require changes in all the programs that access the file.
o Data Redundancy
• Because files are isolated, same information are repeated in multiple files
o Lack of security
• Issues with data sharing, control of access…
What does a database provide?
? ? ? ? ? ? ?
DBMS
persistence
files
What does a database provide?
DBMS
persistence
files
Client Server Architecture
Request
Server
Client
Response
END-
USERS DATABASE SYSTEM
Application &
Web Server(s) Database Server(s)
Registrar
Application Database
programs including Data
Accounting Management
data entry forms and System (DBMS)
reports
- Registrar
- Accounting
Students
Data Models
o A data model represents data structures and their characteristics, relations,
constraints, transformations, and other constructs with the purpose of
supporting a specific problem domain.
o Four ways data is related:
Linear Network
Set
Hiearchical
Tables: One Data Structure to Rule them All …
Students • In Relational Databases there is only one data
ID Name GPA structure: a table made up of at least 1 column and
zero or more rows
• Tables are relations which in turn are sets. Hence the
order of the rows in a table are immaterial
Daily_Show_Guests
Year Title Date Profession Name
Ted Codd
(Turing Award 1981)
Baby_Names
State Gender Year fname number
Why study Relational Databases?
Why study Relational Databases?
Lecture 2: The Relational Model
95-703 Database Management (Fall 2021, Section A)
Xiaoying Tu
Agenda
o Tables vs. (Mathematical) Relations
• Why the name “relational” database?
o Keys
• All sorts of keys, but most importantly:
Primary keys
Foreign keys
o Anomalies
o Integrity Constraints
Recall: The central object in a relational
database is a table
Customers Table
Cardinality: # of
rows in a table
Student Advisor
What to put in
here as PK?
DELETION Anomaly
ID Name AdvisorID Name Office
1 Jack A3 Correy WH 5403
2 Jill A3 Correy WH 5403
3 Pat A3 Correy WH 5403
Information
4 George A5 Gary PH 226C
about Gary
is lost!
Solution: Split the Table
Foreign Primary
Student Key Key Advisor
This foreign key and primary key match represents the logical relationship between
the two entities.
Logical Relationships
o Logical relationships that exist between the entities are important for the
organization to capture along with the data itself.
Integrity Constraints
o Null
• A special value representing “unknown” or “blank” or “absence of a value”
• Not the same as zero numeric value or text strings consisting of spaces