Class Notes (889,369)
CA (531,995)
Carleton (18,205)
COMP (439)
COMP 3005 (3)
Louis Nel (3)
Lecture

COMP 3005 - Introduction to Databases.docx

4 Pages
331 Views

Department
Computer Science
Course Code
COMP 3005
Professor
Louis Nel

This preview shows page 1. Sign up to view the full 4 pages of the document.

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
Introduction to Databases COMP 3005 Louis D. Nel [email protected] Scenarios • A company wishes to store and access information about its employees, departments, and projects. • The data will be accessed by different departments for various reasons Scenarios • Students (and Instructors) would like to know how assignment marking is progressing. • Students should be able to determine the progress on their assignments • Instructors should be able to generate reports about all of the assignment grades in the class. File Systems as Database • Consider using the fact that we can write programs which open disk files, write to files, and close files • We could simply write programs to store data and retrieve it from the appropriate files when needed • You’ve done this sort of thing in your 1406 and 2404 courses ...File Systems as Database • Disk files accomplish one very important aspect of database systems: • Data lives a long time ­longer than the running of the program accessing it ...File Systems as Database • Goal: creating a new database of student marks • soln: create a new file, decide on the format of data, write programs which access data based on known format • Problems: ­data format is implicit and hard coded ­data is probably duplicated  ­exists in other files, or duplicated in single file ­no explicit notion of data schema ...File Systems as Database • Goal: query the database to print names of students with A+ • soln: write a method to search file for students with mark=A+ • Problems: ­query is hard­coded, requires programming ­new queries require re­programming ­no theory for query optimization ...File Systems as Database • Goal: Data should be free of inconsistencies (You cannot get a B and Ain the same course) • soln: make sure procedures verify data is valid • Problems: ­integrity constraints cannot be found or changed without re­programming ­integrity constraints cannot be changed ...File Systems as Database • Goal: Data should be secure from unauthorized users • soln: use file access permissions • Problems: ­file access permission provided by host operating system will be inadequate ­host OS may not provide any file access restrictions ...File Systems as Database • Goal: Data should be usable by several users concurrently (Two agents book a seat on a plane simultaneously) • soln: Custom locking code • Problems: ­Must write explicit locking code ­Host OS file system will not provide basic concurrency control ...File Systems as Database • Goal: Data invariants must be maintained (During an account transfer the power fails after the withdrawal but before the deposit) • soln: no easy solution • Problems: ­Must write explicit code to ensure the a program failure will allow an Undo on data modified so far Database Solution • Use an application to which we input: ­what our data will look like ­what constraints apply to the data ­allows us to pose arbitrary queries ­allows us to specify access controls ­monitors modification of data ­provides transaction control • The database is generic ­works with anyone’s data or queries ­at run time Database management System DBMS allows users to: • create new databases, specifying their schema (using a DDL) • Query and modify data (using DML) • Keep large amounts of data secure from accidents or unauthorized users • Allow many users access to data at once without corruption Problems to Avoid • Difficult to access data • Data Redundancy and Inconsistency • Structure and Data Dependence • Data Isolation • Concurrent Access Anomalies • Security Problems • Integrity Problems Difficult to access Data • Does not anticipate new types of requests or reports • How can you get the database to handle query it’s never done before without requiring re­programming? • Database should anticipate new queries and provide a way of navigating data • Provide a specific Query Language Data Redundancy and Inconsistency • e.g. Customer name and address appears in several files: CUSTOMER_FILE, ACCOUNTS_FILE • Wasteful • Allows for possible inconsistencies (changed in one file but not the other e.g. for change of address ­this really happens) Structure and Data Dependence • In file processing systems the programs are written to expect a certain file for
More Less
Unlock Document
Subscribers Only

Only page 1 are available for preview. Some parts have been intentionally blurred.

Unlock Document
Subscribers Only
You're Reading a Preview

Unlock to view full version

Unlock Document
Subscribers Only

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit