Principles of Databases

list Preamble

info Description

This course provides students with a solid background in the theory, design, and programming of database systems, with an emphasis on relational databases. The course introduces database query languages, including an in-depth coverage of the Structured Query Language (sql). Document-oriented databases, such as xml and json, will also be covered. Other topics include storage and indexing techniques, transactions, and database management via the command line.

list Learning Outcomes

Upon successful completion of this course, students will understand...

file_download Software Requirements

All the software required for this course is free and listed below.

MySQL

Download Mysql from https://dev.mysql.com/downloads/mysql/. Pay special attention to the correct version of Mysql for your os.

GitHub Desktop

Git is the industry standard for revision controlling code. GitHub is a ui for Git and is the most popular graphical client for Git. Download the Linux, Windows, or macOS version from https://desktop.github.com/.

Text Editor

The code you write will require a text editor. Although there are many on the market, such as Sublime Text (nagware), for example, vs Code (open source) is the only editor supported in class. Download the Linux, Windows, or macOS version from https://code.visualstudio.com/.

EditorConfig

EditorConfig is a tool that enforces consistent coding styles for everyone who works on a codebase. In our case, that codebase consists of all the examples in class and all the assignments you’ll submit throughout the semester. EditorConfig consists of a configuration file (.editorconfig) that goes in your home — or project — folder, and an extension. Some editors and ides have EditorConfig built in. vs Code, unfortunately, is not one of them.

Download this .editorconfig file and place it in your home folder. Ensure the file name is exactly .editorconfig, starting with a dot and without an extension. Then install the EditorConfig for vs Code extension for vs Code, whose id is EditorConfig.EditorConfig.

Fonts (Optional)

You will need to set your text editor to a monospace/fixed-width font family in your editor’s settings, because code requires vertical alignment that only this family of fonts can provide. The options provided by your os are limited. Thus, in addition to the stock issue fonts included with your computer, here are a few more options to explore:

menu_book Textbook

The textbook listed below is the only book used for this course. Ensure all the details match before making your purchase.

Textbook-related Info
Book Cover
[Cover of Database Systems: The Complete Book, 2nd edition.]
Title Database Systems: The Complete Book
Edition 2
Authors Hector Garcia-Molina, Jeffrey D Ullman, Jennifer Widom
isbn-13 (ebook) 9780133002010
isbn-13 (print) 9780131873254
Publisher Pearson

calendar_month Schedule

Any changes to this schedule will be announced the week before.

Important Notes

You should get accustomed to using your own laptop for computer science courses. Thus, you will need to bring your own laptops to class. We will use a portion of the first week of classes to install the software you need on your personal machines.

Notable Dates

⟫ First day of classes (Week 1): Monday, 28 August 2023

⟫ Labor Day — No class (Week 2): Monday, 4 September 2023

⟫ Last day to withdraw with a grade of “W” (Week 10): Friday, 3 November 2023

⟫ Thanksgiving recess — No class (Week 13): Monday, 20 November, and Wednesday, 22 November 2023

⟫ Last day of classes (Week 16): Monday, 11 December 2023

The weekly schedule for the semester, complete with topics and readings.
Week Topics Homework
One
Aug 28 – 30
  • Thorough syllabus breakdown
  • Software installfest (part 1 of 2)
  • (1.1.1) Early Database Management Systems
  • (1.1.2) Relational Database Systems
  • (1.1.3) Smaller and Smaller Systems
  • (1.1.4) Bigger and Bigger Systems
  • (1.1.5) Information Integration
  • (1.2.1) Data-Definition Language Commands
  • (1.2.2) Overview of Query Processing
  • (1.2.3) Storage and Buffer Management
  • Carefully re-read the syllabus.
  • Open a GitHub account, if you don’t have one already
  • Read (23 pages):
    • 1.1 The Evolutions of Database Systems, pages 1 – 4
    • 1.2 Overview of a Database Management System, pages 5 – 9
    • 2.1 An Overview of Data Models, pages 17 – 21
    • 2.2 Basics of the Relational Model, pages 21 – 28
    • 2.3 Defining a Relation Schema in sql, pages 29 – 34
Two
Sep 6
  • (1.2.4) Transaction Processing
  • (1.2.5) The Query Processor
  • (2.1.1) What is a Data Model?
  • (2.1.2) Important Data Models
  • (2.1.3) The Relational Model in Brief
  • (2.1.4) The Semistructured Model in Brief
  • (2.1.5) Other Data Models
  • Read (13 pages):
    • 2.4 An Algebraic Query Language, pages 38 – 51
Three
Sep 11 – 13
  • (2.1.6) Comparison of Modeling Approaches
  • (2.2.1) Attributes
  • (2.2.2) Schemas
  • (2.2.3) Tuples
  • (2.2.4) Domains
  • (2.2.5) Equivalent Representations of a Relation
  • (2.2.6) Relation Instances
  • (2.2.7) Keys of Relations
  • (2.2.8) An Example Database Schema
  • Read (28 pages):
    • 2.5 Constraints on Relations, pages 58 – 61
    • 2.5 Summary of Chapter 2, page 63
    • 3.1 Functional Dependencies, pages 67 – 71
    • 3.2 Rules About Functional Dependencies, pages 72 – 81
Four
Sep 18 – 20
  • (2.3.1 – 2.3.6) Relations in sql; Data Types; Simple Table Declarations; Modifying Relation Schemas; Default Values; Declaring Keys
  • (2.4.1 – 2.4.4) Why Do We Need a Special Query Language?; What is an Algebra?; Overview of Relational Algebra; Set Operations on Relations
  • (2.4.5 – 2.4.8) Projection; Selection; Cartesian Product; Natural Joins
  • (2.4.9 – 2.4.13) Theta-Joins; Combining Operations to Form Queries; Naming and Renaming; Relationship Among Operations; A Linear Notation for Algebraic Expressions
  • (2.5.1 – 2.5.3) Relational Algebra as a Constraint Language; Referential Integrity Constrains; Key Constraints
  • Programming assignment 1 due
  • Read (28 pages):
    • 3.5 Third Normal Form, pages 102 – 104
    • 3.6 Multivalued Dependencies, pages 105 – 113
    • 3.7 An Algorithm for Discovering mvds, pages 115 – 119
    • 3.8 Summary of Chapter 3, page 121
    • 4.1 The Entity/Relationship Model, pages 126 – 135
    • 4.2 Design Principles, pages 140 – 144
Five
Sep 25 – 27
  • (3.1.1 – 3.1.3) Definition of Functional Dependency; Keys of Relations; Superkeys
  • (3.2.1 – 3.2.4) Reasoning About Functional Dependencies; The Splitting/Combining Rule; Trivial Functional Dependencies; Computing the Closure of Attributes
  • (3.2.5 – 3.2.8) Why the Closure Algorithm Works; The Transitive Rule; Closing Sets of Functional Dependencies; Projecting Functional Dependencies
  • (3.3.1 – 3.3.4) Anomalies; Decomposing Relations; Boyce-Codd Normal Form; Decomposition into bcnf
  • (3.4.1 – 3.4.4) Recovering Information from a Decomposition; The Chase Test for Lossless Join; Why the Chase Works; Dependency Preservation
  • (3.5.1 – 3.5.3) Definition of Third Normal Form; The Synthesis Algorithm for 3nf Schemas; Why the 3nf Synthesis Algorithm Works
  • (3.6.1 – 3.6.6) Attribute Independence and Its Consequent Redundancy; Definition of Multivalued Dependencies; Reasoning About Multivalued Dependencies; Fourth Normal Form; Decomposition into Fourth Normal Form; Relationships Among Normal Forms
  • (3.7.1 – 3.7.4) The Closure and the Chase; Extending the Chase to mvds; Why the Chase Works for mvds; Projecting mvds
  • Read (30 pages):
    • 4.3 Constraints in the e/r Model, pages 148 – 151
    • 4.4 Weak Entity Sets, pages 152 – 155
    • 4.5 From e/r Diagrams to Relational Designs
    • 4.6 Converting Subclass Structures to Relations, pages 165 – 169
    • 4.7 Unified Modeling Language, pages 171 – 177
    • 4.8 From uml Diagrams to Relations, pages 179 – 181
    • 4.9 Object Definition Language, pages 183 – 191
Six
Oct 2 – 4
  • (4.1.1 – 4.1.4) Entity Sets; Attributes; Relationships; Entity-Relationship Diagrams
  • (4.1.5 – 4.1.8) Instances of an e/r Diagrams; Multiplicity of Binary e/r Relationships; Multiway Relationships; Roles in Relationships
  • (4.1.9 – 4.1.11) Attributes on Relationships; Converting Multiway Relationships to Binary; Subclasses in the e/r Model
  • (4.2.1 – 4.2.5) Faithfulness; Avoiding Redundancy; Simplicity Counts; Choosing the Right Relationships; Picking the Right Kind of Element
  • (4.3.1 – 4.3.4) Keys in the e/r Model; Representing Keys in the e/r Model; Referential Integrity; Degree Constraints
  • (4.4.1 – 4.4.3)Causes of Weak Entity Sets; Requirements for Weak Entity Sets; Weak Entity Set Notation
  • (4.5.1 – 4.5.4)From Entity Sets to Relations; From e/r Relationships to Relations; Combining Relations; Handling Weak Entity Sets
  • (4.6.1 – 4.6.4) e/r-Style Conversion; An Object-Oriented Approach; Using Null Values to Combine Relations; Comparison of Approaches
  • Read (23 pages):
    • 4.10 From odl Designs to Relational Designs, pages 193 – 198
    • 5.1 Relational Operations on Bags, pages 205 – 210
    • 5.2 Extended Operators of Relational Algebra, pages 213 – 219
    • 5.3 A Logic for Relations, pages 222 – 228
Seven
Oct 9 – 11
  • (4.7.1 – 4.7.7) uml Classes; Keys for uml classes; Associations; Self-Associations; Association Classes; Subclasses in uml; Aggregations and Compositions
  • (4.8.1 – 4.8.4) uml-to-Relations Basics; From uml Subclasses to Relations; From Aggregations and Compositions to Relations; The uml Analog of Weak Entity Sets
  • (4.9.1 – 4.9.8) Class Declarations; Attributes in odl; Relationships in odl; Inverse Relationships; Multiplicity of Relationships; Type in odl; Subclasses in odl; Declaring Keys in odl
  • (4.10.1 – 4.10.5) From odl Classes to Relations; Complex Attributes in Classes; Representing Set-Valued Attributes; Representing Other Type Constructors; Representing odl Relationships
  • (5.1.1 – 5.1.6) Why Bags?; Union, Intersection, and Difference of Bags; Projection of Bags; Selection on Bags; Product of Bags; Joins of Bags
  • (5.2.1 – 5.2.7) Duplicate Elimination; Aggregation Operators; Grouping; The Grouping Operator; Extending the Projection Operator; The Sorting Operator; Outerjoins
  • (5.3.1 – 5.3.6) Predicates and Atoms; Arithmetic Atoms; Datalog Rules and Queries; Meaning of Datalog Rules; Extensional and Intensional Predicates; Datalog Rules Applied to Bags
  • (5.4.1 – 5.4.7) Boolean Operations; Projection; Selection; Product; Joins; Simulating Multiple Operations with Datalog; Comparison Between Datalog and Relational Algebra
  • Programming assignment 2 due
  • Read (27 pages):
    • 5.4 Relational Algebra and Datalog, pages 230 – 238
    • 5.5 Summary of Chapter 5, page 240
    • 6.1 Simple Queries in sql, pages 244 – 255
    • 6.2 Queries Involving More Than One Relation, pages 258 – 265
Eight
Oct 16 – 18
  • Review for midterm (Monday)
  • Midterm exam (Wednesday)
  • Read (16 pages):
    • 6.3 Subqueries, pages 268 – 277
    • 6.4 Full-Relation Operations, pages 281 – 288
Nine
Oct 23 – 25
  • Cover midterm
  • (6.1.1 – 6.1.8) Projection in sql; Selection in sql; Comparison of Strings; Pattern Matching in sql; Dates and Times; Null Values and Comparisons Involving NULL; The Truth-Value UNKNOWN; Ordering the Output
  • (6.2.1 – 6.2.5) Products and Joins in sql; Disambiguating Attributes; Tuple Variables; Interpreting Multirelation Queries; Union, Intersection, and Difference of Queries
  • (6.3.1 – 6.3.8) Subqueries that Produce Scalar Values; Conditions Involving Relations; Conditions Involving Tuples; Correlated Subqueries; Subqueries in FROM Clauses; sql Join Expressions; Natural Joins; Outerjoins
  • (6.4.1 – 6.4.7) Elminating Duplicates; Duplicates in Unions, Intersections, and Differences; Grouping and Aggregation in sql; Aggregation Operators; Grouping; Grouping, Aggregation, and Nulls; HAVING Clauses
  • (6.5.1 – 6.5.3) Insertion; Deletion; Updates
  • (6.6.1 – 6.6.6) Serializability; Atomicity; Transaction; Read-Only Transaction; Dirty Reads; Other Isolation Levels
  • Read (25 pages):
    • 6.5 Database Modifications, pages 291 – 294
    • 6.6 Transactions in sql, pages 296 – 304
    • 6.7 Summary of Chapter 6, page 308
    • 7.1 Keys and Foreign Keys, pages 311 – 315
    • 7.2 Constraints on Attributes and Tuples, pages 319 – 323
    • 7.3 Modification of Constraints, pages 325 – 326
    • 7.4 Assertions, pages 328 – 329
    • 7.5 Triggers, pages 332 – 334
    • 7.6 Summary of Chapter 7, page 339
Ten
Oct 30 – 1 Nov
  • (7.1.1 – 7.1.4) Declaring Foreign-Key Constraints; Maintaining Referential Integrity; Deferred Checking of Constraints
  • (7.2.1 – 7.2.4) Not-Null Constraints; Attribute-Based CHECK Constraints; Tuple-Based CHECK Constraints; Comparison of Tuple- and Attribute-Based Constraints
  • (7.3.1 – 7.3.2) Giving Names to Constraints; Altering Constraints on Tables
  • (7.4.1 – 7.4.2) Creating Assertions; Using Assertions
  • (7.5.1 – 7.5.2) Triggers in sql; The Options for Trigger Design
  • (8.1.1 – 8.1.3) Declaring Views; Querying Views; Renaming Attributes
  • (8.2.1 – 8.2.3) View Removal; Updatable Views; Instead-Of Triggers on Views
  • Read (27 pages):
    • 8.1 Virtual Views, pages 341 – 343
    • 8.2 Modifying Views, pages 344 – 347
    • 8.3 Indexes in sql, pages 350 – 351
    • 8.4 Selection of Indexes, pages 352 – 357
    • 8.5 Materialized Views, pages 359 – 364
    • 8.6 Summary of Chapter 8, page 365
    • 9.1 The Three-Tier Architecture, pages 369 – 372
    • 9.2 The sql Environment
Eleven
Nov 6 – 8
  • (8.3.1 – 8.3.2) Motivation for Indexes; Declaring Indexes
  • (8.4.1 – 8.4.4) A Simple Cost Model; Some Useful Indexes; Calculating the Best Indexes to Create; Automatic Selection of Indexes to Create
  • (8.5.1 – 8.5.4) Maintaining a Materialized View; Periodic Maintenance of Materialized Views; Rewriting Queries to Use Materialized Views; Automatic Creation of Materialized Views
  • (9.1.1 – 9.1.3) The Web-Server Tier; The Application Tier; The Database Tier
  • (9.2.1 – 9.2.7) Environments; Schemas; Catalogs; Clients and Servers in the sql Environment; Connections; Sessions; Modules
  • (9.3.1 – 9.3.9) The Impedance Mismatch Problem; Connecting sql to the Host Language; The DECLARE Section; Using Shared Variables; Single-Row Select Statements; Cursors; Modifications by Cursor; Protecting Against Concurrent Updates; Dynamic sql
  • (9.4.1 – 9.4.8) Creating psm Functions and Procedures; Some Simple Statement Forms in psm; Branching Statements; Queries in psm; Loops in psm; For-Loops; Exceptions in psm; Using psm Functions and Procedures
  • Programming assignment 3 due
  • Read (27 pages):
    • 9.3 The sql/Host-Language Interface, pages 378 – 388
    • 9.4 Stored Procedures, pages 391 – 402
    • 9.5 Using a Call-Level Interface, pages 404 – 410
Twelve
Nov 13 – 15
  • (9.5.1 – 9.5.4) Introduction to sql/cli; Processing Statements; Fetching Data From a Query Result; Passing Parameters to Queries
  • (9.6.1 – 9.6.4) Introduction to jdbc; Creating Statements in jdbc; Cursor Operations in jdbc; Parameter Passing
  • (9.7.1 – 9.7.7) php Basics; Arrays; The pear db Library; Creating a Database Connection Using db; Executing sql Statements; Cursor Operations in php; Dynamic sql in php
  • (10.1.1 – 10.1.6) Privileges; Creating Privileges; The Privilege-Checking Process; Granting Privileges; Grant Diagrams; Revoking Privileges
  • (10.2.1 – 10.2.2) Defining Recursive Relations in sql; Problematic Expressions in Recursive sql
  • (10.3.1 – 10.3.4) From Relations to Object-Relations; Nested Relations; References; Object-Oriented Versus Object-Relational
  • (10.4.1 – 10.4.6) Defining Types in sql; Method Declarations in udts; Method Definitions; Declaring Relations with a udt; References; Creating Object ids for Tables
  • Read (29 pages):
    • 9.6 jdbc, pages 412 – 416
    • 9.7 php, pages 416 – 421
    • 9.8 Summary of Chapter 9, page 422
    • 10.1 Security and User Authorization in The sql, pages 425 – 433
    • 10.2 Recursion in The sql, pages 437 – 440
    • 10.3 The Object-Oriented Model, pages 445 – 449
    • 10.4 User-Defined Types in The sql, pages 451 – 455
Thirteen
Nov 20 – 22
Thanksgiving recess None
Fourteen
Nov 27 – 29
  • (10.5.1 – 10.5.4) Following References; Accessing Components of Tuples with a udt; Generator and Mutator Functions; Ordering Relationships on udts
  • (10.6.1 – 10.6.5) olap and Data Warehouses; olap Applications; A Multidimensional View of olap Data; Star Schemas; Slicing and Dicing
  • (10.7.1 – 10.7.2) The Cube Operator; The Cube in sql
  • Read (12 pages):
    • 10.5 Operations on Object-Relational Data, pages 457 – 461
    • 10.6 On-Line Analytic Processing, pages 464 – 469
    • 10.7 Data Cubes, pages 473 – 475
    • 10.8 Summary of Chapter 10, page 478
  • Study for final exam
Fifteen
Dec 4 – 6
  • Open lab (Monday)
  • Review for final exam (Wednesday)
  • Evaluations (Wednesday)
  • Programming assignment 4 due
Study for final exam
Sixteen
Dec 11
Final exam None

assignment Assignments

The workload for this course involves four programming assignments. (See the Grading section to learn what percentage of your final grade each is worth.) As noted in the instructions for each assignment, No late work is accepted.

info Grading

Grading Formula

Your grade for this course is computed as follows:

  1. Programming assignments (60%)
    • Assignment 1 — 15%
    • Assignment 2 — 15%
    • Assignment 3 — 15%
    • Assignment 4 — 15%
  2. Midterm exam (20%)
  3. Final exam (20%)

To calculate your final grade, convert the percentages listed above and your grades to decimal. For example, if you got an 80 on the first programming assignment, a 93 on the second, a 60 on the third, a 50 on the fourth, a 95 on your midterm, and, finally, a 100 on the final exam, then you’d calculate your final grade as follows:

(.80 × .15) + (.93 × .15) + (.60 × .15) + (.50 × .15) + (.95 × .20) + (1 × .20) = 80%

You can convert your percentage grade to a letter grade at http://vanegas.cs.hartford.edu/grading/.

I do not give grades; students earn them. The grade you earn is based strictly on the outlined formula clearly listed in this section.

This grading formula is unbending and will be adhered to strictly.

Important Note

Please do not try to negotiate a grade with me. By asking me to treat you favorably, you’re requesting that I put you above your classmates. Manage your time well; I do not accept late work.

balance Class Policies

warning Academic Honesty

Cheating of any kind will not be tolerated in this course; make certain that all the work you submit is your own. Refresh your understanding of the college’s policy on academic honesty.

accessible Students with Disabilities

If you have a documented disability for which you are requesting accommodation, you are encouraged to contact Access-Ability Services as soon as possible by calling 860.768.4312, emailing tlopez@hartford.edu, or by stopping by the Access-Ability Services office in Auerbach Hall, Room 209. If your request for accommodations is approved, an accommodation letter will be emailed to your instructor(s) upon your request. Please discuss your accommodations with the instructor as soon as possible to make appropriate arrangements. Note: Student requests for accommodations must be filed each semester. Visit https://www.hartford.edu/academics/academic-support/accessibility-services/ and click the “Registering” link for more info and a link to a video to walk you through the process.

balance Title IX and Sexual Assault

Sexual violence and other forms of sexual misconduct and harassment, including stalking and intimate partner violence, are prohibited under Title ix, federal and state law, and University of Hartford policy. Information on the University’s policies against sexual violence can be found at https://www.hartford.edu/about/policies/title-ix/. Resources regarding sexual violence can be found at https://www.hartford.edu/about/policies/title-ix/on-off-campus-resources.aspx

Note: University of Hartford faculty, staff, and ras are required to report incidents of sexual misconduct to the Title ix Office (title9@hartford.edu). For further information on The University’s policies and resources, please contact Jason Martinez (860.768.5255; jamartine@hartford.edu) or Justin Bell (860.768.4880; jbell@hartford.edu).

psychology Mental Health and Well-Being

Mental Health is an important aspect of students’ well-being and integral to positive academic experiences and success. If, during the semester, you experience difficulties and would like support, consider contacting the University of Hartford’s caps, or Counseling and Psychological Services, which offers a range of short-term counseling services available to full-time undergraduate students at no additional cost, and to part-time undergraduate and graduate students for a small fee. caps is located in Gengras Student Union, Room 313 map, and can be reached by calling 860.768.4482 or emailing Liz Inkel at inkel@hartford.edu. Office hours are Monday – Friday, 8:30 AM – 4:30 PM.

info Advice on Succeeding in Class

Read over the following to understand procedures for maximizing your chance of succeeding in class.

door_front Office Hours

contact_mail Contact

Nowadays, I only use email for emergency situations, such as pet emergencies, personal tragedies, etc. For matters related to our course, you’re advised to see me before or after class, during my office hours, or by appointment. My contact info is listed in the Preamble.