Database 2019-02: Difference between revisions

From Innovation
Jump to: navigation, search
Line 128: Line 128:
<br> [http://open.gnu.ac.kr/lecslides/2018-2-DB/Lectures/Day03/DB-WS02b.ipynb Worksheet 3b]
<br> [http://open.gnu.ac.kr/lecslides/2018-2-DB/Lectures/Day03/DB-WS02b.ipynb Worksheet 3b]
<br> [http://open.gnu.ac.kr/lecslides/2018-2-DB/Lectures/Day03/DB-WS03c.ipynb Worksheet 3c]
<br> [http://open.gnu.ac.kr/lecslides/2018-2-DB/Lectures/Day03/DB-WS03c.ipynb Worksheet 3c]
<br> '''Video:'''
<br> '''Video:'''
<br> [https://www.youtube.com/watch?v=fBS3J9gIyqs&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=9 Basic SQL 2 Part 1 Multiset Operations (8:09)]
<br> [https://www.youtube.com/watch?v=fBS3J9gIyqs&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=9 Basic SQL 2 01 (multiset operations) 8:09]
<br> [https://www.youtube.com/watch?v=IDIsWemryn4&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=10 Basic SQL 2 Part 2 Nested Query 1 (8:50)]
<br> [https://www.youtube.com/watch?v=IDIsWemryn4&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=10 Basic SQL 2 02 (nested query) 8:50]
<br> [https://www.youtube.com/watch?v=NnIrnl3RwP4&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=11 Basic SQL 2 Part 3 Nested query 2 (7:12)]
<br> [https://www.youtube.com/watch?v=NnIrnl3RwP4&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=11 Basic SQL 2 03 (nested query 2) 7:12]
<br> Grouping operations and JOIN  to come shortly
<br> [https://www.youtube.com/watch?v=Sn2eC9Jtkoc&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=16 Basic SQL 2 04 (aggregation) 14:10]
<br> [https://www.youtube.com/watch?v=fjJDOX3eTj4&list=PLWm33cHVRby7Av1hirp_TUWAnmWLvw8Nr&index=17 Basic SQL 2 05 (join) 11:46]
| style="vertical-align: top;"| Ch. 6
| style="vertical-align: top;"| Ch. 6
| style="vertical-align: top;"|
| style="vertical-align: top;"|

Revision as of 23:00, 16 September 2019

Class Information

Class Info
Class ETA00137 - 데이터베이스
Lecturer Seongjin Lee
Time and Place 407-202 Tuesday 16:00-20:00
Office Hour Tuesday: 16:00-20: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
Project 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.

Discussion

Please provide your info on this T.B.D.

All discussions and assignments are to be submitted in Piazza. Enroll into the class through the following link.

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


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)
"IS-A" to come shortly

Ch. 2


5 Database Design Theory Part I

[ pptx ] [ pdf ]
Worksheet:
Worksheet 5a
Closure visualization tool for python v2 / python v3

Ch. 3.2-3.7



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

Assignment 2


Assignment 2
Answer Template
Instructions on submitting the assignment


7 Transactions

[ pptx ] [ pdf ]
Worksheet:

Ch. 8.6


8 Concurrency and Locks

[ pptx ] [ pdf ]
Worksheet:
Worksheet 8a
Transaction visulization tool for pyton v2 / python v3
Transaction visulation java script

Ch. 18.1-18.4


9 Buffer Manager and Introduction to External Merge algorithm

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

Ch. 11.4


10 More on External Merge Sort

[ pptx ] [ pdf ]
Worksheet:


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 1

[ 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


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.