Inheritance in C+
Remember from last time:
Classes can be derived from other classes
Basic Info about inheritance:
To declare a derived class:
class <derived-class>:public <base class> { <derived class member functions> <derived class member dat
Last time, we talked about constraints We discussed integrity constraints, specifically referential and value integrity
enforced with the aid of table constraints and check clauses
We mentioned triggers as providing another mechanism for integrity e
Entity Relationship Model
A database can be modeled as:
a collection of entities, relationship among entities.
An entity is an object that exists and is distinguishable from other objects.
Example: student, car, account
Entities have attributes
Exa
Entity Relationship Model
A database can be modeled as:
a collection of entities, together with relationships among entities.
An entity is an object that exists and is distinguishable from other objects. Entities have attributes
these are properties
Last time we ended discussing Design Issues
Use of entity sets vs. attributes
Choice mainly depends on the structure of the enterprise being modeled, and on the semantics associated with the attribute in question.
Use of entity sets vs. relationship
Last time we had started talking about Reduction to Relation Schemas:
We observed that a strong entity set reduces to a schema with the same attributes. A weak entity set becomes a table that includes a column for the primary key of the identifying s
Chapter 7 of the text: Relational Database Design
Features of Good Relational Design Atomic Domains and First Normal Form Decomposition Using Functional Dependencies Functional Dependency Theory Algorithms for Functional Dependencies Decomposition Us
Yeh-Roussopoulos Methodology
Goal: Given an English description of an enterprise, build a system to automate it and document the system Methodology is modular, with four phases:
1) 2) 3) 4) Environment & requirements Analysis System Analysis and Spe
On Monday We Started Looking at Relational Database Design
We looked at some example scenarios and saw that some of them were not "good" That motivated a desire to develop a theory to
Decide whether a particular relation R is in "good" form. In the
We've been looking at functional dependency theory
discussed the definition of a functional dependency discussed determination of the closure of a set of fd's
Armstrong's axioms: if , then (reflexivity) if , then (augmentation) if , and
On Monday, we reviewed computation of attribute closure and talked about uses for attribute closure defined and saw how to determine a canonical cover
concept of extraneous attributes on RHS and LHS algorithms for determining when an attribute is ext
Last time .
We looked at compositionality and subqueries
we saw examples of subqueries in:
the select clause the from clause the where clause the having clause
Basically, we observed that a subquery can appear wherever it makes sense
but what is rea
Remember from Friday Execution of an SQL Query Somewhat simplified execution model:
form a cross product of all relations in the from clause apply filtering according to the where clause group tuples according to the group by and compute any aggrega
So far (w.r.t. the relational algebra) we've seen:
Six basic operators
select: project: union: set difference: Cartesian product: x rename: and four additional operators
along with how these are expressed and used in SQL
Set intersection Natu
Database Systems What will we do this semester?
Relational Model SQL and (briefly) Other Relational Languages You'll be using a system such as MySql to gain experience with SQL Entity-Relationship Modeling You'll be using tools such as Visio to do an
Database System Structures and Components
Database systems can be viewed from three levels of abstraction:
physical level conceptual/logical level external/user/view level
Database System Components
the front end, the middle levels, and the back end
Relational Model Basics
Remember that an n-ary relation defined on D1, D2, ., Dn is just a subset of D1 D2 . Dn Codd's observation was that a relation can be viewed as a table
Employee
Jan Steve Tom
Department
accounting net services engineering J
Recall from last time: First Order Logic
The semantics of first order logic is a ternary relation between a formula P, a database B, and an assignment or binding Notation:
B, P what it means: P holds (or is true) in the database B with binding
Recall from last time: Queries expressed using first order logic
The example scenario:
Student(name, college, major, gpa) Faculty(name, dept, salary, year_hired) Chair(dept, name) Teaches(name, course) Enrolls(name, course)
List the names of faculty
DRC, TRC, and SQL
Before we get into "connecting the dots" on the logicbased expression of queries and SQL, we need to spend just a little time on pragmatic issues We will be using MySQL this semester.
"official" pronunciation is My Ess Queue Ell but
Relational Algebra
Procedural language Six basic operators
select: project: union: set difference: Cartesian product: x rename:
The operators take one or two relations as inputs and produce a new relation as a result.
Select is a "filtering" o
Remember from Friday the Relational Algebra
Procedural language Six basic operators select: project: union: set difference: Cartesian product: x rename: All of these operators except renaming () take two relations as inputs and produce a new re
Remember from Monday the Relational Algebra with some operators added
Procedural language Six basic operators select: project: union: set difference: Cartesian product: x rename:
and four additonal operators
Set intersection Natural join Divi
Remember that we are talking about the Relational Algebra with some operators added
Procedural language Six basic operators select: project: union: set difference: Cartesian product: x rename:
Extended relational algebra operators
Generalized
Multivalued Dependencies (MVDs)
Let R be a relation schema and let R and R. The multivalued dependency holds on R if in any legal relation r(R), for all pairs for tuples t1 and t2 in r such that t1[] = t2 [], there exist tuples t3 and t4 in r