![]() |
INFSCI 1022
|
|
| Announcements: |
04/30/08 I believe this is a final announcement:
04/21/08
04/16/08
04/15/08
04/09/08
04/08/08
04/02/08
04/02/08
04/02/08. On future plans:
03/29/08
03/27/08.
03/26/08.
03/23/08.
03/17/08.
03/06/08.
03/04/08.
03/04/08.
03/03/08.
02/29/08.
02/28/08.
To make the main course page shorter, all old annoucements have been moved here. |
| Class Time and Place: | Tuesdays and Thursdays 11:00 am - 12:15 pm, IS405 |
| Instructor: | Valeria (Lera) Brusilovsky Email: LeraBrusilovsky (at) yahoo.com Office Hours: By appointment |
| GSA: | Divyasheel (Div) Sharma Email: dsharma@sis.pitt.edu (remember: put "1022" in the subject line of all messages to Div) Tel: (412) 624-7378 Location: B-212, DSL Lab, 2nd Floor, SIS Office Hours: Mondays, 2-3 pm |
| Topics Covered: |
|
| Course Book: | Silberschatz, Korth, and Sudarshan Database System Concepts, 5th edition , McGraw-Hill, 2005, ISBN 0-07-228363-7 |
| Plan of the Course: | The following is the list of chapters from the course book (see above) included in this course. Dr. Zadorozhny generously provided us with slides of his lectures from Fall 2007 semester. They are posted with correspondent chapters. Please, remember that these slides can't replace neither lectures, nor reading the book, but could give you an idea what material will be covered in the course, as well as help you to take good notes in class and to review the material after class.
Chapter 1. Introduction. Chapter 2. Relational Model. Last Semester Slides Chapter 3. SQL. Last Semester Slides, Part 1 and Part 2 Chapter 6. Entity-Relationship Model. Last Semester Slides Chapter 7. Relational Database Design. Last Semester Slides Chapter 11. Storage and File Structure. Last Semester Slides Chapter 12. Indexing and Hashing. Last Semester Slides Chapter 15. Transactions. Last Semester Slides Chapter 16. Concurrency Control. Last Semester Slides Chapter 17. Recovery System. Last Semester Slides |
| Knowledge Tree | Knowledge Tree - Link - is a set of interactive tools developed to help you learn Relational Algebra and SQL. Use the login/password sent to you via email by Knowledge Tree administrator. If you haven't received the email from the Knowledge Tree administrator, contact your instructor. Knowledge Tree tutorial is posted here (.pdf) |
| Grades |
Your grade for the course will be combined from the grades for the homeworks (30%), the project (30%) and the final exam (40%). The score is translated into letter grades as following:
|
| Homework |
Homework is always due before the class. If you can't come to the class, you can put the completed homework to the instructor's mailbox at IS 701 as early as you like, but before the class. Homework 1 is posted here. Below are the questions I've received by email and my answers to them.
Solutions and comments for the Homework 1 are posted here. Please, don't be alarmed if your solution is different from the one suggested there: if your answer solves the given problem, it gets full points, unless some additional requirements were stated in the original problem. The corrected and graded homework papers will be distributed in class on 2/5/08. Homework 2 is posted here. To create test data for this homework:
As an alternative, you can use the same script from here. Below are the questions I've received by email and my answers to them.
Solutions and comments for the Homework 2 are posted here. The corrected and graded homework papers were distributed in class on 2/28/08. Homework 3 is posted here. Below are the questions I've received by email and my answers to them.
Solutions and comments for the Homework 3 are posted here. Homework 4 is posted here. Solutions and comments for the Homework 4 are posted here. The corrected and graded homework papers were distributed in class on 4/15/08. |
| Project |
Detailed project description is posted here. The first steps to the successful completion of the project are
|
| Lecture Notes: |
To make the main course page shorter, Lecture Notes for the Lectures 1 through 4 (Introduction and Relational Algebra) have been moved here. |
|
Unix Lab, 01/22/08. The presentation given today is here. Additional slides on spool, ftp and printing are here. |
Lecture 5, 01/24/08. Chapter 3. SQL. Part 1. After this lecture, you should be able to: 1. Understand the basic CREATE TABLE statement, point out the table name, the list of column names and data types for each column. Write a basic CREATE TABLE statement for your own table, following the given example. 2. List three major types of data (character data, numeric data and date/time data) and explain Oracle data types for the character and the numeric data. 3. Understand the basic INSERT INTO ... VALUES (...) statement that provides a value for each column. Write a similar INSERT statement for your own table and data, following the given example. 4. Write a statement for table deletion. 5. Explain that results of a SQL query is a table that is shown on the screen (or used in some other way), but not preserved in the database, unlike the tables created by CREATE TABLE statement and populated by INSERT INTO statements. 6. Know an order of clauses in SQL query (SELECT, then FROM, then WHERE, then ORDER BY - for now). 7. Understand and master a variety of SQL queries for a single table:
We are at the point when the more you practice with various queries, the better you know the material. You can try out the queries from the handouts, invent your own, and/or practice with Knowledge Tree. Knowledge Tree not only shows some queries with explanations, it also provides a tool where you have a task, write SQL statement to solve it and, the best of all, your answer gets verified. The students who used Knowledge Tree in the past, reported that it helped them significantly in mastering necessary skills. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 6, 01/29/08. Chapter 3. SQL. Part 2. After this lecture, you should be able to: 1. Explain and demonstrate how aggregate functions work on an entire table. Show examples for SUM, MIN, MAX, AVG and COUNT. Explain, why we put star (*) in COUNT(*). Explain how the word "distinct" inside the parentheses affects the result. 2. Explain and demonstrate how aggregate functions work with GROUP BY clause. Show the process step-by-step. 3. Add WHERE clause and ORDER BY clause. Explain in what order WHERE clause, GROUP by, aggregate function(s), and ORDER BY will be executed. 4. Have a clear idea how many rows the particular query on particular table will produce. 5. Have a clear idea what could and what couldn't be listed as a column in SELECT clause, when aggregate functions and/or GROUP BY present. 6. Understand HAVING clause. Explain and demonstrate when it will be executed in a statement with other clauses. 7. Apply all of above to solve tasks. We will practice this in class, but to master the skills you need to practice on your own. You can try to recreate statements from the handouts, invent your own, do exercises from the book, work in pairs and groups to check each other's work, and, of course, practice with Knowledge Tree. You can bring interesting tasks and/or questions to the class, though it would be helpful if you send them to the instructor before the class. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 7, 01/31/08. Chapter 3. SQL. Part 3. After this lecture, you should be able to: 1. Apply a general approach to write SQL statements with aggregate functions, GROUP BY and HAVING clauses. Most of the examples we solved in class are here. 2. Understand when the condition(s) from the task goes into WHERE clause (when we can check it for each row before aggregation), and when - into HAVING clause (when we have to do aggregation first, and then check the condition(s)). 3. Create data for the first versions of tables for your project or for your experiments. We learned:
4. Have a general idea about NULLs ("unknown" data) - this term was introduced, but not yet properly covered. A listing of the demo is posted here. There was an additional demo of KnowledgeTree system, specifically QuizGuide. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 8, 02/05/08. Chapter 3. SQL. Part 4. The three set operations (union, intersect and except/minus), nested subqueries and joins were covered. Then a problem of unknown data and NULL values was addressed. The lecture followed the handouts closely. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 9, 02/07/08. Chapter 6. Entity-Relashionship Model. Theory. After this lecture, you should be able to: 1. Understand the place of an Entity-Relashionship Model in the database design process. 2. Understand what it means and know how to express (draw) in your model:
3. Have some ideas how to translate Entity-Relashionship Model into database design. The lecture handouts/slides are posted here. The theory, examples and explanations could be also found in the Chapter 6 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 10, 02/12/08. Chapter 3. SQL. Part 5. After this lecture, you should be able to: 1. Understand the structure of the CREATE TABLE statement with column definitions and constraint definitions. 2. Understand and use:
3. Understand and use ALTER TABLE statement to add columns and constraints. 4. Understand and use DELETE statements. 5. Perform multiple column inserts with nested subquery. The lecture handouts are posted here. We also devoted some time to practice solving sql problems that could be found here. The theory, examples and explanations could be also found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 11, 02/14/08. Chapter 3. SQL. Part 6. The lecture handouts are posted here. They list statements, that were explained and demonstrated, and problems that were solved, explained and/or demonstrated at this lecture. I urge everyone at this point to work with KnowledgeTree to practice your skills and assess your knowledge. The theory, examples and explanations could be also found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 12, 02/19/08. Chapter 6. Entity-Relashionship Model. Practice. We took a set of requirements for a pharmacy application (this one), built a rough draft of an Entity-Relationship model for this application, discussed choices to make and questions to ask, then defined (created) tables for some of the entities, some of the relationships, and for the multivalued attributes. After this lecture you should be able to prepare an E-R model and create a set of tables for your project. The theory, examples and explanations could be also found in the Chapter 6 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 13, 02/21/08. Chapter 3. SQL. Part 7. The lecture handouts are posted here. After this lecture you should be able to: 1. Understand primary key and foreign key constraints and their role in referential integrity. 2. Create and delete these constraints. 3. Update and delete rows without integrity violations. 4. Work with strings:
5. Use line editor in sqlplus:
The theory, examples and explanations could be found in the Chapters 3 and 4 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 14, 02/26/08. Chapter 7. Relational Database Design. Part 1 The lecture handouts are posted here. After this lecture you should be able to: 1. Explain what problems we are trying to solve by a good relational design. 2. List the main goals of a good relational design. 3. Define a First Normal Form, provide examples. 4. Explain a lossless join decomposition and how to check for it. 5. Describe functional dependencies. 6. Define a closure of a set of functional dependencies, list Armstrong's axioms, give examples. The theory, examples and explanations could be found in the Chapter 7 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 15, 02/28/08. Chapter 7. Relational Database Design. Part 2 The lecture handouts are posted here. After this lecture you should be able to: 1. Explain a process of normalization using functional dependencies. 2. Distinguish between dependency preserving decomposition and decomposition which doesn't preserve dependencies. Explain drawbacks. 3. Define a Boyce-Codd Normal Form. 4. Explain how to check a relation for BCNF. 5. Understand decomposition to the point when all relations are in BCNF. We haven't finished the Part 2, we'll continue at the next lecture. The theory, examples and explanations could be found in the Chapter 7 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 16, 03/04/08. Chapter 7. Relational Database Design. Part 2+Practice We have finished the Relational Database Design. Part 2 (the same handouts as the previous lecture, they are posted here). Then, we worked through the list of problems to apply what we learned in Chapter 7. The problems are here, the same problems with solutions and some explanations are here. After this lecture you should be able to: 1. Define a Third Normal Form (3NF). 2. Explain how to check a relation for 3NF. 3. Explain why we may want to stop decomposition BEFORE all relations are in BCNF, and what are the advantages and the problems of 3NF. 4. Solve the problems similar to the practice problems. The theory, examples and explanations could be found in the Chapter 7 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 17, 03/06/08. Chapter 11. Storage and File Structure. Lecture handouts are posted here). After this lecture you should be able to: 1. List and explain storage media classification parameters: speed, cost, reliability and volatility. 2. List, characterize and compare current storage media options. 3. Explain which storage options we use to store databases. 4. Show and explain magnetic disk functionality, using proper terminology. Explain access time, and what it consists of. 5. Explain functions of a disk controller. 6. Explain why the data needs to be moved to and from disk and where it is moved. 7. Define block. Define buffer. 8. List functions of a buffer manager. 9. List and explain replacement strategies buffer manager might use. The theory, examples and explanations could be found in the Chapter 11 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 18, 03/18/08. Chapter 3. Part 8. More SQL: views, derived relations, some, all, exists - and more practice. To learn more SQL, we were solving the following problems: without solutions, with solutions). After this lecture and additional practice on similar problems you should be able to: 1. Use words some, all and exists when needed. 2. Solve complex problems with subqueries in where clause, having clause, as well as in from clause (derived relation). 3. Create and use views. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 19, 03/20/08. Chapter 12. Indexing and Hashing. Hands-on introduction After this lecture you should be able to: 1. Understand why and when indices (indexes) are useful. 2. Distinguish dense index from sparse index. 3. Distinguish primary (clustered, clustering) index from secondary index. 4. Create index manually (without SQL); search table with index. 5. Explain and use multi-level index. The theory, examples and explanations could be found in the Chapter 3 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 20, 03/25/08. 1. We finished the theme of the Lecture 18 (see handouts and solutions posted for that lecture). 2. We discussed an ER Model for Homework 3. 3. We reviewed what we know about indexes (indices) so far. |
Lecture 21, 03/27/08. Chapter 12. Indexing and Hashing. Lecture handouts about B-trees are posted here. Slides for the entire chapter are posted here After this lecture you should be able to: 1. Explain how hashing technique works, give examples. 2. Define B-tree indexes. Draw B-tree for different n. Note: we drew B-tree up to 7 for n=3, and B-tree up to 9 for n=6. The theory, examples and explanations could be found in the Chapter 12 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 22, 04/01/08. Chapter 15. Transactions. Part 1. Lecture handouts are posted here (both Part 1 and Part 2). After this lecture you should be able to: 1. Define transaction. List and explain ACID properties. 2. Define transaction schedule. Define serial schedule. 3. Explain the reasons for concurrent execution. Explain possible problems. 4. Define conflict serializable schedule. Give example. 5. For a given schedule show that it is / isn't conflict serializable. The theory, examples and explanations could be found in the Chapter 15 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 23, 04/03/08. Chapter 15. Transactions. Part 2. Lecture handouts are posted here (the same as Lecture 22 handouts). After this lecture you should be able to: 1. Define recoverable schedule. Give example. 2. For a given schedule show that it is / isn't recoverable. 3. Explain cascading rollback. Give example. 4. Define cascadeless schedule. Explain one way to achieve it. 5. Compare concurrency control with serializability tests. 6. Give an example of a situation when weak level of consistency is acceptable. 7. Explain what commit and rollback statements do in SQL. The theory, examples and explanations could be found in the Chapter 15 of the Course Book. If you feel that you need an additional help, contact the instructor. |
Lecture 24, 04/08/08. Chapter 16. Concurrency Control. Hand-on part. This lecture was devoted to hand-on exercises with transactions and an introduction of some terms and problems. The theory will be presented at the next lecture. |
Lecture 25, 04/10/08. Chapter 16. Concurrency Control. Theory. Lecture handouts are posted here. |
Lecture 26, 04/15/08. Chapter 17. Recovery. Theory. Lecture handouts (for this and the beginning of the next lecture) are posted here. |
Lecture 27, 04/17/08. Chapter 17. Recovery. Theory. Chapter 15-17. Practice We will go over a few last slides of Chapter 17 (see previous lecture) and then work on the problems posted here with solutions. |