CSC 5559
Database Programming
Instructor: Bert Hinrichs
Phone: 303-344-6458, 303-550-4077
Email: [email protected]
Textbook:
There is no required textbook for this class. Materials will be taken
Assignment for Module 4
The graded problems in Module 4 involve SELECT statements for single table problems
with conditions, joins with two tables, and row summaries involving single tables. You shoul
Temporal Data
Temporal Data Concepts
User Defined Time
Instant
Interval
Period
Valid Time
Transaction Time
Instants
An anchored location or point on a timeline
A datetime is an Instant in SQL
Generall
Querying Temporal Data
Querying State
Extracting Current State
Extracting Sequenced State
Extracting Nonsequenced State
Modifying Temporal State
Updating and Deleting
Current
Sequenced
Nonsequenced
Us
drop table if exists S;
create table S
(
SNO char(2) not null,
SNAME varchar(10) not null,
STATUS integer not null,
CITY varchar(10)
);
insert
insert
insert
insert
insert
into
into
into
into
into
S
S
Midterm Review Homework
CSC 5559
Assume you have the following table definitions:
sales
(
date
bc
cc
sn
pc
qty
datetime,
char(2),
char(2),
numeric(2),
char(2),
numeric(3)
# Date of sale
# Branch Code
Using Logic to Create SQL
What Are We Trying To Do
Create Logical Expressions (or Relational
Calculus Expressions) to define what Queries
or Constraints we want to express
Using the fact that Relation
Logic
Set Theory
Quantification
Unified
Logic is Logic:
Boolean Truth Values
Set Theory is Set Theory:
Manipulation of Sets
Quantification is a way to tie Logic and Set Theory together.
Special Case:
Logic
Set Theory
Quantification
Unified
Logic is Logic:
Boolean Truth Values
Set Theory is Set Theory:
Manipulation of Sets
Quantification is a way to tie Logic and Set Theory together.
Special Case:
Logic and SQL
Propositions and Predicates
Proposition
Predicate
A statement that evaluates unconditionally to TRUE
or FALSE
A truth valued function
A function that when invoked or instantiated
returns
Assignment for Module 5
The graded problems in module 5 involve SELECT statements for multiple tables and row
summaries and data manipulation statements using the INSERT, UPDATES, and DELETES
statemen