CS 61: Database Systems
Introduction
Adapted from Silberschatz, Korth, and Sundarshan unless otherwise noted
CS 61: Database Systems Introduction Adapted from Silberschatz, - - PowerPoint PPT Presentation
CS 61: Database Systems Introduction Adapted from Silberschatz, Korth, and Sundarshan unless otherwise noted Zoom poll Where are you located? 2 Agenda 1. Course logistics 2. Data, information, and knowledge 3. Problems with early data
Adapted from Silberschatz, Korth, and Sundarshan unless otherwise noted
2
3
4
post each class session)
when called on, turn on your video camera and ask
material from the book, and will not simply repeat the book back to you
how someone else solved a problem could be useful
5
6
Lectures (10%):
http://www.cs.dartmouth.edu/~tjp/cs61
Labs (30%):
Midterm (20%) – no final Project (40%)
7
Online resources
8
9
10
11
Adapted from infogineering
12
Adapted from Coronel and Morris
13
14
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
15
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
independence)
16
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
in program code rather than being stated explicitly
departments
17
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
carried out (account balance example)
18
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
performance degradation
19
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
20
Problems Sales Shipping Manufacturing Each department keeps records for its own purposes (islands of information) in applications custom written for each group What could go wrong?
Modern database systems solve these problems
21
22
Instructor relation Relation instances attributes Metadata
about the data stored in the database
such as each field’s name, data type, if
relationships between data
data dictionary
Relational database
Data in a relational database
(rows or tuples)
number of attributes (fields) of fixed type
Metadata College database schema Course Room Instructor A database instance is a snapshot of the database at a point in time
23
Simplified database architecture Physical level
update, delete, and retrieve data
is stored
24
Simplified database architecture Physical level
update, delete, and retrieve data
is stored
Logical level
relations at a high level
database design
physically independent from applications (like an ADT)
25
Simplified database architecture Physical level
update, delete, and retrieve data
is stored
Logical level
relations at a high level
database design
physically independent from applications (like an ADT)
View 1 View 2 View n
confidentiality reasons
26
Data Definition Language (DDL)
database’s logical and physical schemas
attributes can take on)
Data Manipulation Language (DML)
the data
Structured Query Language (S-Q-L or Sequel) does both!
Structured Query Language, aka SQL, aka ‘sequel’
27
SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.'
cannot compute
higher-level language (e.g., Python, Java, PHP, JavaScript)
to a database on behalf of an application; API then returns result Structured Query Language (SQL)
28
Metadata Database Management System (DBMS) Course Room
Three-tiered architecture
Instructor Network API Smart phone apps Web browser “Thick client” apps College database schema
29
Metadata Database Management System (DBMS) Course Room
Three-tiered architecture
Instructor Network API Smart phone apps Web browser “Thick client” apps Tier 1: DBMS
structure
database
shared Advantages
shared between multiple applications
repository of knowledge
College database schema
30
Metadata Database Management System (DBMS) Course Room
Three-tiered architecture
Instructor Network API Smart phone apps Web browser “Thick client” apps Tier 1: DBMS
structure
database
shared Advantages
shared between multiple applications
repository of knowledge
College database schema Tier 2: API
to database via web services
server for web pages Advantages
access
be changed without changing all user applications
31
Metadata Database Management System (DBMS) Course Room
Three-tiered architecture
Instructor Network API Smart phone apps Web browser “Thick client” apps Tier 1: DBMS
structure
database
shared Advantages
shared between multiple applications
repository of knowledge
College database schema Tier 3: Applications Tier 2: API
to database via web services
server for web pages Advantages
access
be changed without changing all user applications
32
Use
Processing (OLTP) – production databases
Processing (OLAP) – reporting databases, use historical data, “Business intelligence”
support, may use data from external sources
Location
located in one location (our main focus)
connected “mini databases” each may hold only a shard of the entire data (end of class)
Database type
(our focus in CS61)
graph databases)
unstructured data
33
1. Data dictionary management
relationships (metadata)
(data independence) 2. Data storage management
storage for you
3. Data transformation and presentation
according to location, US vs. UK) Database management functions
34
4. Security management
5. Multiuser access
database concurrently without compromising its integrity
6. Backup and recovery management
7. Data integrity management
Database management functions
35
Exercise
36
Good design vs. poor design
37
Database disadvantages
200 400 600 800 1000 1200 1400 1600 1800 N
2 M a y
3 N
3 M a y
4 N
4 M a y
5 N
5 M a y
6 N
6 M a y
7 N
7 M a y
8 N
8 M a y
9 N
9
Popularity score
Database popularity
Oracle MySQL SQL Server Redis Cassandra Couchbase
38
Popular DBMS
Focus in CS61
MongoDB
https://db-engines.com/en/ranking_trend
Relational databases NoSQL databases
39
https://techhub.dice.com/Dice-2020-Tech-Job-Report.html
40
41