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 (Mac, Windows, Linux)

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

Git Client (Mac, Windows, Linux)

All in-class examples, assignments, and help is done via GitHub. Download the client for your computer here.

Text Editor (Mac, Windows, Linux)

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 (Mac, Windows, Linux)

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 an extension and a configuration file (.editorconfig) that goes in your home — or project — folder. Some editors and ides have EditorConfig built in. vs Code, unfortunately, is not one of them. Install the EditorConfig extension for vs Code from here, then download this .editorconfig file and place it in your home folder. Ensure the file name is exactly .editorconfig, starting with a dot and without a file extension.

Fonts (Mac, Windows, and Linux)

In addition to the stock issue, monospace/fixed-width fonts included with your os, here are a few more fonts to explore in your text editors:

IBM Plex | Ubuntu Mono | Fira Mono | Anonymous Pro | Inconsolata

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

Important Notes

The University treats absences related to covid-19 as excused absences. Consequently, you’ll need to get notes from someone in class, as mentioned in the section of this syllabus marked Advice on Succeeding in Class. There will not be a streaming video option for anyone missing class.

Notable Dates

The weekly schedule for the semester, complete with topics and readings.
Week Class Topics Homework
1 Mon
  • Thorough syllabus breakdown
  • Software installfest (part 1 of 2)
  • Carefully re-read the syllabus.
  • Open a GitHub account, if you don’t have one already
Wed
  • (1.1.5) Information Integration
  • (1.2.1) Data-Definition Language Commands
  • (1.2.2) Overview of Query Processing

Read:

  • 1.1 The Evolutions of Database Systems, pages 1 – 4
  • 1.2 Overview of a Database Management System, pages 5 – 6
2 Mon
No Class
None
Wed
  • (1.2.3) Storage and Buffer Management
  • (1.2.4) Transaction Processing
  • (1.2.5) The Query Processor

Read:

  • 1.2 Overview of a Database Management System, pages 6 – 9
3 Mon
  • (2.1.1) What is a Data Model?
  • (2.1.2) Important Data Models
  • (2.1.3) The Relational Model in Brief

Read:

  • 2.1 An Overview of Data Models, pages 17 – 19
Wed
  • (2.1.4) The Semistructured Model in Brief
  • (2.1.5) Other Data Models
  • (2.1.6) Comparison of Modeling Approaches

Read:

  • 2.1 An Overview of Data Models, pages 19 – 21
4 Mon
  • (2.2.1) Attributes
  • (2.2.2) Schemas
  • (2.2.3) Tuples

Read:

  • 2.2 Basics of the Relational Model, pages 21 – 23
Wed
  • (2.2.4) Domains
  • (2.2.5) Equivalent Representations of a Relation
  • (2.2.6) Relation Instances
  • Programming assignment 1 due

Read:

  • 2.2 Basics of the Relational Model, pages 23 – 25
5 Mon
  • (2.2.7) Keys of Relations
  • (2.2.8) An Example Database Schema
  • (2.3.1 – 2.3.6) Relations in sql; Data Types; Simple Table Declarations; Modifying Relation Schemas; Default Values; Declaring Keys

Read:

  • 2.2 Basics of the Relational Model, pages 25 – 28
  • 2.3 Defining a Relation Schema in sql, pages 29 – 34
Wed
  • (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

Read:

  • 2.4 An Algebraic Query Language, pages 38 – 51
6 Mon
  • (2.5.1 – 2.5.3) Relational Algebra as a Constraint Language; Referential Integrity Constrains; Key Constraints
  • (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

Read:

  • 2.5 Constraints on Relations, pages 58 – 61
  • 2.5 Summary of Chapter 2, page 63
  • 3.1 Functional Dependencies, pages 67 – 71
Wed
  • (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

Read:

  • 3.2 Rules About Functional Dependencies, pages 72 – 81
  • 3.3 Design of Relational Database Schemas, pages 85 – 89
  • 3.4 Decomposition: The Good, Bad, and Ugly, pages 93 – 100
7 Mon
  • (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:

  • 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
Wed
  • (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
  • Programming assignment 3 due

Read:

  • 4.1 The Entity/Relationship Model, pages 126 – 135
8 Mon
  • (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

Read:

  • 4.2 Design Principles, pages 140 – 144
  • 4.3 Constraints in the e/r Model, pages 148 – 151
  • 4.4 Weak Entity Sets, pages 152 – 155
Wed
  • (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
  • (4.7.1 – 4.7.7) uml Classes; Keys for uml classes; Associations; Self-Associations; Association Classes; Subclasses in uml; Aggregations and Compositions

Read:

  • 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
9 Mon
  • (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

Read:

  • 4.8 From uml Diagrams to Relations, pages 179 – 181
  • 4.9 Object Definition Language, pages 183 – 191
  • 4.10 From odl Designs to Relational Designs, pages 193 – 198
Wed
  • (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

Read:

  • 5.1 Relational Operations on Bags, pages 205 – 210
  • 5.2 Extended Operators of Relational Algebra, pages 213 – 219
10 Mon
Midterm
None
Wed
  • (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 3 due

Read:

  • 5.3 A Logic for Relations, pages 222 – 228
  • 5.4 Relational Algebra and Datalog, pages 230 – 238
  • 5.5 Summary of Chapter 5, page 240
11 Mon
  • (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

Read:

  • 6.1 Simple Queries in sql, pages 244 – 255
  • 6.2 Queries Involving More Than One Relation, pages 258 – 265
Wed
  • (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

Read:

  • 6.3 Subqueries, pages 268 – 277
  • 6.4 Full-Relation Operations, pages 281 – 288
12 Mon
  • (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:

  • 6.5 Database Modifications, pages 291 – 294
  • 6.6 Transactions in sql, pages 296 – 304
  • 6.7 Summary of Chapter 6, page 308
Wed
  • (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

Read:

  • 7.1 Keys and Foreign Keys, pages 311 – 315
  • 7.2 Constraints on Attributes and Tuples, pages 319 – 323
13 Mon
  • (7.3.1 – 7.3.2) Giving Names to Constraints; Altering Constraints on Tables
  • (7.4.1 – 7.4.2) Creating Assertions; Using Assertions

Read:

  • 7.3 Modification of Constraints, pages 325 – 326
  • 7.4 Assertions, pages 328 – 329
Wed
  • (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
  • Programming assignment 4 due

Read:

  • 7.5 Triggers, pages 332 – 334
  • 7.6 Summary of Chapter 7, page 339
  • 8.1 Virtual Views, pages 341 – 343
  • 8.2 Modifying Views, pages 344 – 347
14 Mon
No class
None
Wed
No class
None
15 Mon
  • (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

Read:

  • 8.3 Indexes in sql, pages 350 – 351
  • 8.4 Selection of Indexes, pages 352 – 357
Wed
  • Class evaluations
  • Final exam review
Study for final exam
16 Mon
Final exam
Enjoy your break!

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.

Note: Broken links in the list below will be updated once each assignment is assigned a due date.

info Grading

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, 15% becomes .15, 20% becomes .20, etc. Imagine you earned 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, a 100 on the final exam. 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/.

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

Note: I do not give grades; students earn them. The grade you earn is based strictly on the outlined formula above.

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

psychology No AI Use in Class

The use of generative ai tools is strictly forbidden in this course. All programming assignments — and any labs — associated with this course must be completed without the assistance of ai-generated content. This policy is in place to ensure that the work submitted is authentically yours and reflects your personal understanding and capabilities. Violations of this policy will be considered academic dishonesty and will be subject to disciplinary actions as outlined in the university’s academic honesty policy.

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 that walks 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 chances of succeeding in class.

door_front Office Hours

I meet students on an appointment basis via video conference during the times listed here. (Click here for videoconferencing details.) Other times on Thursdays and Fridays are available, also. Email vanegas@hartford.edu to make an appointment.

contact_mail Contact

Nowadays, I only use email for emergency situations, such as a 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.