Database 2021-01

From Innovation
Jump to: navigation, search

Class Information

Class Info
Class ETA00009 - 데이터베이스
Lecturer Seongjin Lee
Time and Place 407-202 Wednesday 15:00-17:00, Friday 13:00-14:00
Office Hour Tuesday: 14:00-16:00
Contacts Office: 407-314
Email: insight at gnu dot ac dot kr

Course Introduction

In Database Management System (DBMS), we study the database which is organized and structured collection of data. DBMS is a software system which acts as intermediary between user or application and the data. It allows to navigate through the data and analyze the data. In this course, we are going to learn the core mechanism that holds the system together.

Goal

In this course, we are going to learn the essence of data base management system. Students are going to learn the following concepts.

  • Relational model
  • Entity-relational model
  • SQL
  • External, conceptual, physical levels of DMBS
  • Data definition language, Data manipulation language, query language
  • Data structures
  • Index
  • Transaction and Concurrency



Text Book

Main Textbook

Not necessarily required to buy the book

Supplementary Textbook

  • Database Systems : the Complete Book (Paperback) | Garcia-Molina, Ullman 지음 |Pearson Education Asia [link ][1판 번역본 ]
  • 만화로 쉽게 배우는 데이터베이스, Takahashi Mana 지음, 홍희정 옮김, Azuma Shouko 그림, 성안당
  • 데이터베이스 시스템 (AN INTRODUCTION TO DATABASE SYSTEMS), C.J. Date, Pearson, 2004


Evaluation

Categories Ratio Categories Ratio
Attendance 10 Quiz 10
Assignments 10 Midterm 30
Participation 10 Final 30
Total 100%
  • All exams are closed book and closed notes
  • Any request for regrade must be made within one week of the time that the paper is returned, with no exception. You should describe in writing why the score is incorrect or graded unfairly. The written argument must be self-contained and can be evaluated based only on what is written on the paper.




Lecture Plan

# Topic & material Readings Assignments
1 Course Overview and Database History

[ pptx ] [ pdf ]
Worksheet:
DB
Worksheet 1a
Worksheet 1b
If you haven't installed Jupyter, then please consult Jupyter Installation Guide
Video:
Overview Part 1 (16:14)
Overview Part 2 (14:48)

2 SQL Introduction Part I

[ pptx ] [ pdf ] [ Notebook ][ English ]
Worksheet:
DB
Worksheet 2a
Worksheet 2b
Worksheet 2c
Video:
Basic SQL 1 Part 1 Schema (18:35)
Basic SQL 1 Part 2 Single Table Query (10:20)
Basic SQL 1 Part 3 Multi table query (9:48)
Basic SQL 1 Part 4 Join Ex (9:25)
Basic SQL 1 Part 5 Join Semantic (10:05)

Ch. 6 Assignment 1


Assignment 1 [English]
Correct Output [English]
DB for the assignment (must be unzipped) [English]
Sanity checker script (run on the terminal) [English]
Answer Template [English]
Instructions on submitting the assignment [English]



quiz

3 SQL Introduction Part II

[ pptx ] [ pdf ] [ Notebook ]
Worksheet:
DB
Worksheet 3a
Worksheet 3b
Worksheet 3c
Video:
Basic SQL 2 01 (multiset operations) 8:09
Basic SQL 2 02 (nested query) 8:50
Basic SQL 2 03 (nested query 2) 7:12
Basic SQL 2 04 (aggregation) 14:10
Basic SQL 2 05 (join) 11:46

Ch. 6 quiz


4 Databas Design with ER Diagrams

[ pptx ][ pdf ]
Worksheet:
We are going to create an ER diagram in class with pencil and paper
Video:
ER Model Part 1 Entity Set (9:37)
ER Model Part 2 Relationship (10:22)
ER Model Part 3 Multiplicity (11:48)
ER Model Part 4 Design Consideration (6:08)
ER Model Part 5 Subclass ISA (8:31)
ER Model Part 6 Constraints and Weak entity set (8:58)

Ch. 2 [quiz] [worksheet]


5 Database Design Theory Part I

[ pptx ] [ pdf ]
Worksheet:
Worksheet 5a
Closure visualization tool for python v2 / python v3
Video:
Normal forms (10:39)
Functional Dependencies (10:18)
Finding FDs (14:35)
Closure Part 1 (7:48)
Closure Part 2 (7:43)

Ch. 3.2-3.7 [quiz] [worksheet]



6 Database Design Theory Part II

[ pptx ] [ pdf ]
Worksheet:
Worksheet 6a
Worksheet 6b
Closure visualization tool for python v2 / python v3
Excercises on 3rd Normal Form
Excercises on Multi-Valued Dependency
Video:
BCNF (11:59)
Decomposition (12:36)

Assignment 2


Assignment 2
Answer Template
Instructions on submitting the assignment

quiz


Exam on Oct. 30th, up to Day 06 at 16:00 in 407-501

7 Transactions

[ pptx ] [ pdf ]
Worksheet:
Video:
Transaction Introduction (6:18)
Motivation of Transaction (9:20)
Properties of Transaction (6:47)
Atomicity and durability via logging (12:34)

Ch. 8.6 quiz


8 Concurrency and Locks

[ pptx ] [ pdf ]
Worksheet:
Worksheet 8a
Transaction visulization tool for pyton v2 / python v3
Transaction visulation java script
Video:
Interleaving and Scheduling (10:15)
Conflicts (6:07)
Conflict Serializability (11:16)
Strict Two-phase locking (9:31)

Ch. 18.1-18.4
quiz


9 Buffer Manager and Introduction to External Merge algorithm

[ pptx ]
Worksheet:
Worksheet 9a
External Merge Sort Workseet
Buffer manager engine for pyton v2 / python v3
Display helper
Modeling java script

Video:
Disk, Buffer, and File system (8:55)
External Mege (8:00)

Ch. 11.4


10 More on External Merge Sort

[ pptx ] [ pdf ]
Worksheet:

Video:
External Merge Sort (5:40)
External merge sort on larger files (3:00)
Optimizations for sorting (6:28)


11 Indexing

[ pptx ] [ pdf ]
Worksheet:
Worksheet 11a
Database for the worksheet

Ch. 13.1-13.3


12 Join part 1

[ pptx ] [ pdf ]
Worksheet:

Ch. 15


13 Join part 2

[ pptx ] [ pdf ]
Worksheet:

Ch. 15


14 Relational Algebra

[ pptx ] [ pdf ]
Worksheet:
Worksheet 9a
Picture used for the Worksheet
Relational Algebra for pyton v2
Display helper

Ch. 2 and 16.3


Exam on Dec 8th OFFLINE


15 Query Optimization

[ pptx ] [ pdf ]
Worksheet:
Worksheet 15a
Worksheet 15b
Database for the worksheet
Relational Algebra for pyton v2
Display helper



Working Environment Setup

Step 1: Installing Jupiter Notebook

Gentle reminder that, jupyter notebook best works at Linux


Option 1: Installation via Anaconda

It is recommended that you install Jupyter Notebook via Anaconda

  1. Download & install Anaconda for Python here
  2. Run jupyter notebook to confirm that it is properly installed

If Anaconda doesn't have jupyter: you can try running

conda install jupyter


Option 2: Installation via pip

You can also install via the python package manager pip

  1. Make sure you have installed
    • python and pip
  2. Make sure pip is updated to its latest version
    pip install --user --upgrade pip
  3. Install Jupyter Notebook
    pip install --user --upgrade jupyter


Installing other kernels and versions of python

When you are using Python3 and want to switch to Python2 in the notebook,

python2 -m pip install ipykernel

python2 -m ipykernel install —user

After restarting the Jupyter, you can chose different kernel in Jupyter notebook.

Step 2: Installing Other Dependencies

Git

Git is a version control system which we use to store the various course material; you can download from here

  • you can download the course material from here
  • If you want the up-to-date version of the course material, checkout the course repository from the git by typing the following command

IPython-SQL

python-sql allows you to use SQL queries inside jupyter notebooks; install using pip

  • pip install --user --upgrade ipython-sql

other modules

you will be needing

  • markdown
  • numpy
  • pandas

Step 3: Getting Started

Getting the latest course materials

You can always access the latest course materials on the course website. You can download all at once and keep them synced by using git. To get started with this, run:

git clone https://github.com/resourceful/lecture_db YourDestination

Now you should have all the materials in Database; to get the latest version, run the following command in the repository.

git pull

To read the notebook

In the directory where the relevant course materials are, run:

jupyter notebook


Course Credit

Much of the materials of this lecture is based on CS145 of Stanford.