Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the...

21
Database applications I have connections Common problems Group Work Introduction to Database Systems: CS312 An Overview of Databases Oliver Bonham-Carter 2 Sept 2020 1 / 20

Transcript of Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the...

Page 1: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Introduction to Database Systems:CS312

An Overview of Databases

Oliver Bonham-Carter

2 Sept 2020

1 / 20

Page 2: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Let’s discuss...

What is the function of a database?

1 / 20

Page 3: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Database Management System (DBMS)

Database Applications:

Banking: transactionsAirlines: reservations, schedulesUniversities: registration, gradesSales: customers, products, purchasesOnline retailers: order tracking, customizedrecommendationsManufacturing: production, inventory, orders, supply chainHuman resources: employee records, salaries, taxdeductions

2 / 20

Page 4: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Databases at Our College!

Application:Adding new students, instructors, and coursesRegistering students for courses, and generate class rostersAssigning grades to students,Computing grade point averages (GPA)Generating transcripts

3 / 20

Page 5: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

To connect data in some meaningful way

4 / 20

Page 6: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Database - A True Story (sort of)

Databases were not always used as they are today ...

They were often disconnected systems

Isolated from other systems that contained similar data.

(Why would anyone use this configuration??)5 / 20

Page 7: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Meanwhile at Batman and Associates...One database was working well...

One (simple) working database containing all companyinformation.

6 / 20

Page 8: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Two teams join Batman and Associates...

7 / 20

Page 9: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Batman and Associates...Two identical bases created from a single base

The database is copied into two new identical bases for useby two different teams in the Bat-cave.

8 / 20

Page 10: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Each team gets own DB...

9 / 20

Page 11: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Batman and Associates...Problems in the Bat-cave

Nearly identical: no equal updating of each base.

Teams verbally communicate changes to each other

10 / 20

Page 12: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Batman and Associates confuses an address...What went wrong?! :-(

11 / 20

Page 13: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

How Many Databases Do You Need??Common problems

Let’s talk about ...

Common Problems with Databases

12 / 20

Page 14: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

How Many Databases Do You Need??Common problems

Database applications were once built directly on top of filesystems (i.e., permanent records of information in variousspread-out files)

A firm may have managed several information sources!

Anything wrong with this picture?13 / 20

Page 15: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Messy Data Storage?Risks of having several different DBs for same information

Drawbacks of using file systems to store dataData redundancy and inconsistencyMultiple file formats, duplication of information in differentfiles - hard to shareDifficulty in accessing dataNeed to write a new program to carry out each new taskData redundancy and inconsistencyData isolation - multiple files and formats

14 / 20

Page 16: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Messy Data Storage?

Drawbacks of using file systems to store data, continued

Data redundancy and inconsistencyIntegrity problems - The data is not accurate andconsistently storedData redundancy and inconsistencyIntegrity constraints (i.e., account balance ≥ 0) become“buried” in program code rather than being stated explicitlyHard to add new constraints or change existing ones

How many times did you see, “Data redundancy andinconsistency”, here??

How many times should you see the same data in yourDB??

15 / 20

Page 17: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Messy Data Storage?

Atomicity of updates

An atomic transaction is an indivisible and irreducible seriesof database operations such that either all occur, ornothing occurs.Failures may leave database in an inconsistent state withpartial updates carried outExample: Transfer of funds from one account to anothershould either complete or not happen at all

16 / 20

Page 18: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Messy Data Storage?

Concurrency: transactions at same time

Access by multiple usersAccess needed for performance - no slow-downUncontrolled concurrent accesses can lead toinconsistencies Example: Two people reading a balance(say 100) and updating it by withdrawing money (say 50each) at the same time

17 / 20

Page 19: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Messy Data Storage?

Security problems

Hard to provide user access to some, but not all, dataDifficult to control how data is usedHow to watch all databases, all the time?

Database systems offer solutions to all the above problems18 / 20

Page 20: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Video: Finding Trends in Data

Hans Rosling’s 200 Countries, 200 Years, 4 Minutes - TheJoy of Stats

https://www.youtube.com/watch?v=jbkSRLYSojo

19 / 20

Page 21: Introduction to Database Systems: CS312 An Overview of ...Database systems o er solutions to all the above problems 18/20. Database applications I have connections Common problems

Databaseapplications

I haveconnections

Commonproblems

Group Work

Video: Questions

1 What kind of data was likely being used for this study?

2 Where could a database serve in this project?

3 How was the data likely organized for the study?

4 What kinds of relationships were likely used to connectdata points?

5 How could this study be done in absence of a database?

20 / 20