




























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Relational Databases, The Relational Model, Updates and Integrity, Cooperation and Plagiarism, Datatypes and Domains, Relation, Postgre SQL, Relation Schema, Schema States, Projection, Keys, Primary Key Violation, Entity Integrity, Dr Mohammad Yamin, Ms Zoe Brain, Lecture Slides, Relational Databases, Australian National University, Australia.
Typology: Slides
1 / 68
This page cannot be seen from the preview
Don't miss anything!





























































Lecture 6: The Relational Model: Updates and Integrity
Tips on your own PostgreSQL installation Domains, Relation Schemas and Database Schemas Keys and Integrity Constraints
I do not want to wait till the end of the year to find out how you found my teaching. Give me some feedback now, and perhaps we can improve things during the course.
Executive summary: cooperation yes, plagiarism no.
Executive summary: cooperation yes, plagiarism no.
I encourage you to discuss the course with other students, in labs, as you move around campus, in study groups.
Discussion on the forum led to creating your own PostgreSQL installation. Here are the short installation instructions for the Unix versions of PostgresSQL 8.2.
./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/dat /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/d
logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
(^1) forget it, use what the DCS IT guys provide in the labs!
(^1) forget it, use what the DCS IT guys provide in the labs! (^2) use Linux packages: .rpm .deb etc (^3) non-root unix installation works ./configure --prefix=$HOME
(^1) forget it, use what the DCS IT guys provide in the labs! (^2) use Linux packages: .rpm .deb etc (^3) non-root unix installation works ./configure --prefix=$HOME (^4) the Unix/Linux way would work on a Macintosh, so long as you have the xcode developer tools installed
A domain is a datatype, named and constrained to represent a particular kind of real world value.
A domain is a datatype, named and constrained to represent a particular kind of real world value.
For Example, we could create a domain sex and constrain it to the values โMโ and โFโ.
CREATE DOMAIN sex AS char CHECK ( VALUE = โMโ or VALUE = โFโ);
A domain is a datatype, named and constrained to represent a particular kind of real world value.
For Example, we could create a domain sex and constrain it to the values โMโ and โFโ.
CREATE DOMAIN sex AS char CHECK ( VALUE = โMโ or VALUE = โFโ);
A datatype is just a set eg varchar(20) is the set of all strings of characters of length 20 or less
A domain is a datatype, named and constrained to represent a particular kind of real world value.
For Example, we could create a domain sex and constrain it to the values โMโ and โFโ.
CREATE DOMAIN sex AS char CHECK ( VALUE = โMโ or VALUE = โFโ);
A datatype is just a set eg varchar(20) is the set of all strings of characters of length 20 or less A domain is a subset of its underlying datatype
Why is this
CREATE TABLE employee ( name varchar(20); gender sex );
a better table definition than this
CREATE TABLE employee ( name varchar(20); gender char );
A relation is a set, but a table is a list.