0% found this document useful (0 votes)
31 views43 pages

CSE 303 Lec 1 Introduction

This document provides an overview of a database management systems (DBMS) course. It introduces the instructors, outlines the course topics that will be covered over the semester, and lists the required textbook. The course topics are split into two halves, with the first half covering database fundamentals from a user's perspective, and the second half exploring how database systems work internally. The document encourages students to attend lectures, ask questions, and read the slides to succeed in the course.

Uploaded by

niloy2105044
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views43 pages

CSE 303 Lec 1 Introduction

This document provides an overview of a database management systems (DBMS) course. It introduces the instructors, outlines the course topics that will be covered over the semester, and lists the required textbook. The course topics are split into two halves, with the first half covering database fundamentals from a user's perspective, and the second half exploring how database systems work internally. The document encourages students to attend lectures, ask questions, and read the slides to succeed in the course.

Uploaded by

niloy2105044
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

CSE 215: Database

Lecture 01

2022
Introductory Lecture

CSE 303: Ashikur Rahman 1


Teaching Staff
• Instructors:

Ashikur Rahman Prof. ASM Latiful Hoque


Office: CSE 121 Office: CSE 118

CSE 303: Ashikur Rahman 2


Lectures: 1 st
half - from a user’s
perspective
1. Foundations: Relational data models & SQL
– Weeks 1-3
– How to manipulate data with SQL, a declarative language
• reduced expressive power but the system can do more for you

2. Database Design: Design theory and constraints


– Weeks 4-5
– Designing relational schema to keep your data from getting
corrupted

3. E-R diagram & Relational Algebra: Syntax & supporting


systems
– Week 6-7
– A programmer’s first step to data abstraction
CSE 303: Ashikur Rahman 3
Lectures: 2 nd
half - understanding
how it works
4. Inside to database systems
– Indexing
– External Memory Algorithms (IO model) for
sorting, joins, etc.
– Basics of query optimization (Cost Estimates)
5. Transactions: Syntax & supporting systems
A programmer’s abstraction for data consistency
6. Data Recovery
CSE 303: Ashikur Rahman 4
Communications
• Web site:
http://teacher.buet.ac.bd/ashikur/CSE215
– Lectures available here (usually the morning before class)
– Useful links to possibly useful reading materials
– Class test marks and important announcements are posted !

• Email:
{ashikur, asmlatifulhoque}@cse DOT buet DOT ac DOT bd

CSE 303: Ashikur Rahman 5


Textbook(s)
Main textbook:
• Database Systems: The Complete Book, Hector
Garcia-Molina, Jeffrey Ullman, Jennifer Widom
– Most chapters are good. Some are not as great
(functional dependencies).
– available at the Poroma Prokashoni
– A free PDF version is available (linked from the
course website)
• COME TO THE CLASS ! ASK QUESTIONS !
READ SLIDES !
CSE 303: Ashikur Rahman 6
Other Texts

• Database System Concepts,


by Avi Silberschatz, Henry F. Korth, S. Sudarshan

CSE 303: Ashikur Rahman 7


Today’s Outline

Overview of DBMS

DBMS vs other alternatives

DBMS through an example

The Course outline


CSE 303: Ashikur Rahman 8
“Data is the Future”
- Quotation by somebody on the earth

What is a database ?

FACEBOOK
definition

CSE 303: Ashikur Rahman 9


“Data is the Future”
- Quotation by somebody on the earth

• What is a database? • Database can be stored


• Any collection of in different ways
related information – On paper
– Phone book – In your mind
– Shopping list – On a computer
– Todo list
– Your 5 best friends
– Facebook’s user base

CSE 303: Ashikur Rahman 10


“Data is the Future”
- Quotation by somebody on the earth

Give examples of databases


• Accounts database; payroll database; BIIS
students database

CSE 303: Ashikur Rahman 11


Increasingly many companies
see themselves as data driven.
CSE 303: Ashikur Rahman 12
CSE 303: Ashikur Rahman 13
Millennia of Knowledge in Libraries

CSE 303: Ashikur Rahman 14


The world’s scientific knowledge
is accessible.

CSE 303: Ashikur Rahman 15


But we’re still human…

16
CSE 303: Ashikur Rahman
The world’s scientific knowledge
is accessible, but not readable.
Could we build a machine to
read for us?
Building database is the first step
towards machine readable data
CSE 303: Ashikur Rahman 17
Database Management System
What is a DBMS ?
• A big C/C++ program written by someone else
that allows us to manage efficiently a large
database and allows it to persist over long periods
of time

CSE 303: Ashikur Rahman 18


Database Management System
What is a DBMS(formal definition)?

•A Database Management System (DBMS)


is a piece of software designed to store and
manage databases

CSE 303: Ashikur Rahman 19


Functionalities of DBMS
• Makes it easy to manage large amounts of
information
• Handles Security
• Backups
• Importing and exporting data
• Concurrency
• Interacts with software application

CSE 215: Ashikur Rahman 20


CSE 215: Ashikur Rahman 21
Database Management System
Give examples of DBMS
• The big commercial database vendors:
– Oracle
– IBM (with DB2) bought Informix recently
– Microsoft (SQL Server)
• Some open source (free) database systems:
– Postgresql
– Mysql
– Predator

CSE 303: Ashikur Rahman 22


DBMS Market Shares
In 2006, www.gartner.com

• Oracle: 47% market share, $7.2BN in sales

• IBM: 21% market share with $3.2BN in sales

• Microsoft: 17% market with $2.6BN in sales

CSE 303: Ashikur Rahman 23


DBMS Market Shares (Cloud
based)

CSE 303: Ashikur Rahman 24


DBMS Latest ranking
http://db-engines.com/

CSE 303: Ashikur Rahman 25


An Example
The Internet Movie Database
http://www.imdb.com

• Entities:
Actors (800k), Movies (400k), Directors, …

• Relationships:
who played where, who directed what, …
CSE 303: Ashikur Rahman 26
Tables
Directors: Movie_Directors:
id fName lName id mid
15901 Francis Ford Coppola 15901 130128
... ...

Movies:
mid Title Year
130128 The Godfather 1972
...

CSE 303: Ashikur Rahman 27


A Motivating, Running Example

• Consider building a course management


system (CMS):

– Students
– Courses Entities
– Professors
– Who takes what
Relationships
– Who teaches what
CSE 303: Ashikur Rahman 28
Modeling the CMS using DBMS
• Logical Schema
• Students(sid: string, name: string, gpa: float)
• Courses(cid: string, cname: string, credits: int)
• Enrolled(sid: string, cid: string, grade: string)
• ………………….
sid Name Gpa cid cname credits
101 Jalil 3.2 101 C 3
Relations 303 Dbase 3
123 Karim 3.8

Students sid cid Grade Courses


123 303 A
Enrolled 29
CSE 303: Ashikur Rahman
Can we do it without a DBMS ?
Sure we can! Start by storing the data in files:

students.txt courses.txt professors.txt

You can store data using text editors, OR


You can write C or Java programs to
implement specific tasks
30
CSE 303: Ashikur Rahman
Can we do it without a DBMS ?

Another way: store the data in EXCEL files:

students.xls courses.xls professors.xls

CSE 303: Ashikur Rahman 31


Possible Organizations
• Files

• Spreadsheets

• DBMS

CSE 303: Ashikur Rahman 32


1. Create/store Large Datasets
Yes, but…
• Files

• Spreadsheets Not really…

• DBMS Yes

CSE 303: Ashikur Rahman 33


2. Search/Query/Update
Simple queries (grep);
• Files Updates are difficult

• Spreadsheets Simple queries;


Simple updates

• DBMS All

CSE 303: Ashikur Rahman 34


3. Change the Structure
Add Address to each Actor

Very hard
• Files

• Spreadsheets Yes

• DBMS Yes

CSE 303: Ashikur Rahman 35


4. Concurrent Access
Multiple users access/update the data concurrently
• What can go wrong ?
Lost updates; inconsistent reads,…

– You and your project partner are editing the same


file.
– You both save it at the same time.
– Whose changes survive?
• How do we protect against that in OS ? locks

CSE 303: Ashikur Rahman 36


5. Recover from crashes
• Transfer $100 from account #4662 to #7199:
X = Read(Account, #4662);
X.amount = X.amount - 100;
Write(Account, #4662, X);
CRASH !
Y = Read(Account, #7199);
Y.amount = Y.amount + 100;
Write(Account, #7199, Y);

What is the problem ?


37
CSE 303: Ashikur Rahman
6. Security

File-level
• Files access control

• Spreadsheets Same [?]

• DBMS Table/attribute-
level access control

CSE 303: Ashikur Rahman 38


How DBMS does all those things
“Two tier system” or “client-server”

connection
(ODBC, JDBC)

Database server
(someone else’s
Data files C program) Applications
39
CSE 303: Ashikur Rahman
Data Independence
Logical view
Directors: Movie_Directors:
id fName lName id mid
15901 Francis Ford Coppola 15901 130128
... ...

Movies:
mid Title Year
130128 The Godfather 1972
...

Directors_file Moviews_title_index_file

Directors_fname_index_file Movies_file
CSE 303: Ashikur Rahman Physical view
40
What the Database Systems Does
SQL DDL
1. Create/store large datasets SQL DML
2. Search/query/update
3. Change the structure SQL DDL

4. Concurrent access to many user


Transactions
5. Recover from crashes ACID
6. Security
Grant, Revoke, Roles

41
CSE 303: Ashikur Rahman
Course Outline (first half) -
TENTATIVE !!
1. Introduction (chapter 1)
2. Relational model (chapter 2)
3. SQL (chapter 6)
4. Constraints (chapter 7)
5. Design theory (chapter 3)
6. E-R diagram (chapter 4)
7. Relational Algebra (chapter 2)

CSE 303: Ashikur Rahman 42


Until Next Time…
• Go to the course website
• Install Oracle Xpress Edition 11/12
• Start using sqlplus, and sql developer
• Read the guideline on the course website to
use sqlplus
• Find a partner for the project in the lab
• Start reading about SQL online and in the
book
CSE 303: Ashikur Rahman 43

You might also like