Relational Databases ~ Intermediate SQL II

Integrity constraints ensure that changes made to the database by authorized users do not result in a loss of data consistency. Thus, integrity constraints guard against accidental damage to the database. Examples of integrity constraints are:

  • An instructor name cannot be null.
  • No two instructors can have the same instructor ID.
  • Every department name in the course relation must have a matching department name in the department relation.
  • The budget of a department must be greater than $0.00.

继续阅读“Relational Databases ~ Intermediate SQL II”

Abstract Data Types~Abstract Objects and Collections of Objects

DEVELOPING ABSTRACT MODELS for our data and for the ways in which our programs process those data is an essential ingredient in the process of solving problems with a computer. In this series, we consider abstract data types (ADTs), which allow us to build programs that use high-level abstractions. With abstract data types, we can separate the conceptual transformations that our programs perform on our data from any particular data-structure representation and algorithm implementation. 继续阅读“Abstract Data Types~Abstract Objects and Collections of Objects”

Elementary Data Structures ~ Compound Data Structures

Arrays, linked lists, and strings all provide simple ways to structure data sequentially. They provide a first level of abstraction that we can use to group objects in ways amenable to processing the objects efficiently. Having settled on these abstractions, we can use them in a hierarchical fashion to build up more complex structures. We can contemplate arrays of arrays, arrays of lists, arrays of strings, and so forth. 继续阅读“Elementary Data Structures ~ Compound Data Structures”