Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

FIN 307:

Database Management and Financial Application

FIN 307
Laizhong Cui ©
College of Computer Science and Software Engineering
Shenzhen University
cuilz@szu.edu.cn
http://csse.szu.edu.cn/staff/cuilz/
Fall 2021
Instructor Information
○ Name: Laizhong Cui

○ Telephone: 18607550977

○ Email: cuilz@szu.edu.cn

Hello ○ Web: http://csse.szu.edu.cn/staff/cuilz/

In s t ru c t o r ○ Research interests
Computer Networks
a n d TA

■ Big Data Management
■ Edge Computing
■ Internet of Things (IoT)
■ Machine Learning

TA Information
○ Name: Fuming Lan

○ Telephone: 18786884848

○ Email: 12132975@mail.sustech.edu.cn
Course Summary
We’ll learn How To…

○ Database Design
FIN 307 ■

Entity-Relationship Model
The Relational Data Model
■ Transform ER schema to relational schema

Goals ○ Datebase Programming


■ Relational Algebra
■ SQL

○ Database Management System


■ Index Structures and Index Creation
■ Query Processing and Optimization
■ Transaction Management

Project: Implement the Retail Business Management System [MySQL + PHP/JAVA]


Where can I get class updates and assignments?
Wechat and Blackboard

When/where can I see the slides?


Class All slides will be posted to the Blackboard website before lecture.

Lo g is t ic s

When/who can I ask the questions?


TA and Instructor can answer your questions via Wechat or Email.
No textbook is required

Main reference book: Database Systems by M. Kifer, A.


Bernstein, and P. M. Lewis, second edition

Other reference books


Reference ● Fundamentals of Database Systems (6th edition), by R. Elmasri, and S.
Navathe
Bo o k s & ● Oracle10g Programming – A Primer by R. underraman
Le c t u re ● Database Systems: An Application-Oriented Approach (2nd edition) by
M. Kifer, A. Bernstein, P. Lewis
No t e s ● Principles of Database and Knowledge-base Systems (Volume I & II),
J. Ullman
● Database System Concepts, H. Korth and A. Silberschatz
● Database: Principles, Programming, Performance, O'Neil and O'Neil
● A First Course in Database Systems, Ullman and Widom

Lecture Notes
● Lecture Notes (PowerPoint Slides) will be posted in the course folder
on Blackboard.
What is the grading breakdown for FIN 307?
● Experiments (6 exercises):30%
● Project (including presentation): 20%, one group can have 1-4
students
● Final Exam: 50%

Grading All late homework, experiments and project will be penalized 5%


per day (including weekends and holidays) and no assignment
and will be accepted if it is more than 3 days late unless compelling
Se c t io n s reasons can be presented. Sometimes no late assignment will be
accepted.

Academic honesty and integrity are expected of every student.


Dishonesty and cheating in all academic work related to this
course, when discovered, will be severely punished.

Discussions among students for assignments are permitted


and encouraged.
• Attendance of every class is required and will be checked on a
random basis.

• Each unexcused absence will result in a one-point penalty


from the final overall score.

• An absence is counted if a student is not in the classroom


when the attendance is checked.
Attendance
• If you have six or more unexcused absences, you
automatically fail the course.

• Certain absences may be excused with prior consent from the


instructor. Please inform the instructor of any expected
absence in advance.
Applications of DBs and Data systems

In this Properties of general DBs, special-purpose DBs, data lakes


Se c t io n

Unpack a DB: Example of a mobile game using a DB


- For Whom and Why?
- Sample data architectures
Definition: A database is a collection of data with the following
properties:
- It represents certain aspect of the real-world.
- Its data are logically related.
In this - It is created for a specific purpose.
Se c t io n
Definition: A database management system (DBMS) is a set of
software that are used to define, store, manipulate and control
the data in a database.
- define – define data types, structures and constraints.
In this - store – store data to support efficient access.
Se c t io n - manipulate – perform retrieval and update operations using
a query language.
- control – control access to data.

Database System = Database + DBMS


Details + Big picture

Focus on ‘atomic’ examples

Take in big picture, flavor of issues, how pieces fit


Example: Youtube DB
Result list
Video & description,
Read
Lorem

# Views, Likes
ipsum

Example

Un p a c k Youtube
Lorem ipsum
Yo u t u b e D B DB
congue

Learn
Lorem
ipsum Modify
Lorem
ipsum

Related videos Upload


Relevant ads Like, Review
Every
m in u t e o n
t h e In t e rn e t
Example

Self Driving Cars


Front panel metrics
Read
Lorem
ipsum Speed, distance
ETA
Example

Un p a c k Lorem ipsum
Ca rs D B Cars DB
congue

Learn
Lorem
ipsum Modify
Lorem
ipsum

Collisions Road models


Traffic signals Drive models
Example

Un p a c k
ATM D B:

Tra n s a c t io n
Read Balance Read Balance
Give money vs Update Balance
Update Balance Give money
Transfer $3k from a10 to a20:

1 Debit $3k from a10


2 Credit $3k to a20

Transactions

Example

Scenarios
1. Crash before 1?
2. After 1 but before 2? [Bad!! a10: 17,000, a20: 15,000]
3. After 2?
Platform to store, manage data Supporting
Scale
Speed
Read
Lorem

Stability
ipsum

Evolution
Goals of
Reliability
Cost efficiency
St a n d a rd Operations
Lorem ipsum
Da ta b a se s (any DB)
congue

Learn
Lorem
ipsum Modify
Lorem
ipsum
DBs are often optimized for key use cases
L
L L
o
o o
r
r r
e

Goals of
e e
m
m m L L
L L L L i
i i o o
o o o o p
p p r r
r r r r s
s s e DB e
e DB e e DB e u
u u m m

Sp e c ia l m m m m m
m m i i
i i i i
p p p p
p p

Da ta b a se s s s s s
s s
u u u u
u u
m m m m
m m

Store current data Optimize historical Run batch


(e.g., lot of reads) data (e.g., logs) Workloads
(e.g. training)
Applications of DBs and Data systems

In this Properties of general DBs, special-purpose DBs, data lakes


Se c t io n

Unpack a DB: Example of a mobile game using a DB


- For Whom and Why?
- Sample data architectures
User

Query Processor
DBMS
Transaction
Architecture Manager
Storage Manager

Stored Data
DBMS developers: Those who design and implement DBMS
software: buffer manager, query processor, transaction
manager, interface, ...

Database designers: Those who are responsible for


Persons determining
In vo lvin g - what data should be stored in the database;
D BS - how data in the database should be organized;
- the design of customized views;
- the design of special data structures to improve the
performance of the system.
Database administrator (DBA): Those who manage and
monitor the daily operation of a database system.
- authorization for database access, e.g., who can access
what data in what mode.
- routine maintenance: backup, install new tools, ...
- modification to existing database design.
Persons
In vo lvin g End-user:
D BS - Expert users: those who access the database using SQL
directly.
- Naive users: those who access the database using pre-
prepared packages.
Application programmers: Those who write menu
applications for naive users, typically, through database
calls embedded in a program.

Persons
In vo lvin g
D BS System analysts: Those who determine the requirement of
end users and develop specifications for canned
transactions that meet the requirements.
How?

Exa m p le
Mobile Game
Report & Share
Business/Product
Analysis

Ga m e Ap p
Real-Time
DBMS
User Events
DB

D B v0 Q1: 1000 users/sec? Q7: How to model/evolve game data? Q4: Which user cohorts?
Q2: Offline? Q8: How to scale to millions of users? Q5: Next features to build?
Q3: Support v1, v1’ versions? Q9: When machines die, restore game Experiments to run?
state gracefully? Q6: Predict ads demand?

App designer Systems designer Product/Biz designer


How?

Exa m p le Mobile Game Data Exploration


Cloud Datalab
Report & Share
Business/Product

Ga m e Ap p
Analysis
DB
Real-Time 4
User Events
Data Processing Analytics Engine
1
E-T-L, Dataflow BigQuery

2 3

D a t a syst e m
“v1” o n Clo u d

1 Log user actions 3 Run queries in a peta


scale analytics system
2 Store in DB, after
Extract-Transform-Load 4 Visualize query
results
How?

Exa m p le
Ga m e Ap p Mobile Game Data Exploration
Cloud Datalab
Report & Share
Business/Product
Analysis
DB
4
Data Sync
Data Processing Analytics Engine
1 MySQL, Dataflow BigQuery

2 3
D a t a syst e m 0 Real-Time
User Events

“v2” Clo u d +
Lo c a l Local DB

0 Log user actions 3 Run queries in a petabyte


In local DB scale analytics system

1 Data sync to cloud 4 Visualize query results

2 Store in DB, after ETL


DBs - General + Optimized

Summary Data System - A set of DBs


connected to solve a problem
Da ta b a se s

D a t a s ys t e m s

D a t a la k e s Data Lake - Collection of DBs


for your full application
Course Summary
We’ll learn How To…

○ Database Design
FIN 307 ■

Entity-Relationship Model
The Relational Data Model
■ Transform ER schema to relational schema

Goals ○ Datebase Programming


■ Relational Algebra
■ SQL

○ Database Management System


■ Index Structures and Index Creation
■ Query Processing and Optimization
■ Transaction Management

Project: Implement the Retail Business Management System [MySQL + PHP/JAVA]


Retail Business Management System (RBMS)

- ER Schema Design
- ER Schema to Relational Schema Transformation
Running - Table Normalization
P ro je c t - Application Implementation Using MySQL
 Table Population and Index Creation
 Functionality Implementation
 Web interface with PHP

You might also like