Submit Search
Upload
資料庫入門 Part1
•
0 likes
•
378 views
A
Allen Chou
Follow
資料庫入門 Part 1 @ 新竹女中資訊讀書會 2018/06/05
Read less
Read more
Software
Report
Share
Report
Share
1 of 19
Download now
Download to read offline
Recommended
痞客邦的關鍵字精靈
痞客邦的關鍵字精靈
晨揚 施
2016 Hadoop Conf TW - 如何建置數據精靈
2016 Hadoop Conf TW - 如何建置數據精靈
晨揚 施
陳宜欣/大數據下的情緒分析
陳宜欣/大數據下的情緒分析
台灣資料科學年會
黑箱演算法的獨裁時代
黑箱演算法的獨裁時代
Allen Chou
瀏覽器大戰 @ NTUOSC
瀏覽器大戰 @ NTUOSC
Allen Chou
Git 入門與應用
Git 入門與應用
Allen Chou
資料庫入門 Part2
資料庫入門 Part2
Allen Chou
資料庫入門 Part3
資料庫入門 Part3
Allen Chou
Recommended
痞客邦的關鍵字精靈
痞客邦的關鍵字精靈
晨揚 施
2016 Hadoop Conf TW - 如何建置數據精靈
2016 Hadoop Conf TW - 如何建置數據精靈
晨揚 施
陳宜欣/大數據下的情緒分析
陳宜欣/大數據下的情緒分析
台灣資料科學年會
黑箱演算法的獨裁時代
黑箱演算法的獨裁時代
Allen Chou
瀏覽器大戰 @ NTUOSC
瀏覽器大戰 @ NTUOSC
Allen Chou
Git 入門與應用
Git 入門與應用
Allen Chou
資料庫入門 Part2
資料庫入門 Part2
Allen Chou
資料庫入門 Part3
資料庫入門 Part3
Allen Chou
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
資料庫入門 Part1
1.
資料庫入門 Part 1
2.
我是 Allen Chou ●
廢物學渣QQ ● 剛開始學程式 ● 學科能力競賽都墊底TAT ● https://allenchou.cc ● s3131212@gmail.com ● FB: Allen Chou (@s3131212) ● https://github.com/s3131212
3.
相信我們都遇過一種狀況......
4.
慟!資料不見了!
5.
有哪些資料要存? ● 使用者的帳號密碼 ● 作家的著作整理 ●
誰按了什麼讚 ● 通訊錄裡的聯絡人 ● ……
6.
資料要怎麼整理與儲存? ● 存在變數裡然後祈禱程式永遠不會被關閉 ● 直接開一個檔案寫進去 ●
把資料丟到異次元,緣分到了,資料自然就會回來了
7.
資料庫 Database & 資料庫管理系統 Database
Management System 那是什麼?聽起來好可怕 QQ
8.
資料庫 (DB) vs
資料庫管理系統 (DBMS) ● 資料庫Database:處存電子資訊的地方,通常是表格 ● 資料庫管理系統(DBMS):管理DB 所用的軟體
9.
id name password
email balance 1 王小明 123 aaa@example.com 1000 2 陳小華 456 bbb@example.com -200 3 ☆㊣↖煞氣ㄟ倫哥↘㊣☆ 789 ccc@example.com 8787 row/ record 列 column/field 行 Table 資料表 很多 Table -> Database 資料庫 什麼是 Database
10.
DBMS 的好處 - 為什麼不存在
FS 裡面就好? ● DBMS 跑 Query 比較快+ 方便 ● DBMS 支援交易(Transaction) ● DBMS 可以避免當機時資料損毀
11.
12.
Query ● 找出第一筆ID 為
Allen 的使用者以及他的密碼 ○ ID: Allen ○ password: hello ● 找出 Allen 前三次登入的時間 ○ 0: 2018/06/01 10:26:32 ○ 1: 2018/06/02 13:47:51 ○ 2: 2018/06/03 01:12:34 ● 找出 Allen 是否為管理員 ○ is_admin: false ● 找出 Allen 的所有朋友 ○ 查無資料 QQ
13.
Transaction ● 一連串的讀寫 ● 只有完全成功(commit)或完全失敗(rollback),沒有做一半的 ●
範例:甲給乙50 元 a. 交易開始 b. 甲帳號 - 50 元 c. 電腦插頭被拔了 QQ d. 系統恢復運作 e. 交易失敗,還原成交易前 的狀態 a. 交易開始 b. 甲帳號 - 50 元 c. 乙帳號 + 50 元 d. 交易成功
14.
ACID ● Atomicity(原子性):Transaction 只能完全成功或完全失敗,沒有部分成功 ●
Consistency(一致性):Transaction 前後資料庫維持完整穩定,符合所有預設規則 ● Isolation(隔離性):多個Transaction 可以同時執行且維持數據一致 ● Durability(持久性):Transaction 結束後數據會永久更改,不會因為系統故障而損毀
15.
SQL ● Structured Query
Language ● 一種用來與DBMS 互動的語言 ● 支援查詢、新增、更新、刪除數據,及修改資料型態、資料庫權限等等
16.
各式各樣的 DBMS
17.
● Relational Database
Management System ○ MySQL ■ MariaDB(後面教學都是用他) ○ Microsoft SQL Server ○ PostgreSQL ● NoSQL ○ MongoDB ○ BigTable ○ CouchDB 等等,NoSQL 是什麼 QQ 那個名字很長的又是什麼 Orz
18.
關聯式資料庫(Relational Database) ● 目前最主流的資料庫形式 ●
剛剛所講的一切都是Relational Database 的東西 ● 以表格為主,用某個值做對應關係(Relation) id name 1 Alice 2 Bob 3 Christopher 4 David id user_id1 user_id2 relationsip 8787 1 2 friend 8788 2 3 friend 8789 2 4 relative
19.
NoSQL ● 這幾年才崛起的 ● 號稱「沒有SQL」(Non
SQL),但有些也支援類SQL 語言 ● Scale-out (Horizontal scaling) ● 速度理論上會比較快,但實務上不一定 ● 缺乏一些RDBMS 有的功能,多半沒有ACID,但也有些支援 ● 儲存形式 ○ Key-Value ○ Document ○ Graph ○ Column ○ ...
Download now