Relational Databases-Lecture 05 Slides-Computer Science, Slides of Relational Database Management Systems (RDBMS)

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

2011/2012

Uploaded on 03/12/2012

kyleaus
kyleaus ๐Ÿ‡ฆ๐Ÿ‡บ

5

(4)

12 documents

1 / 68

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Relational Databases - Comp2400 / Comp6240
Lecture 6: The Relational Model: Updates and Integrity
A more careful look at the relational data model
Tips on your own PostgreSQL installation
Domains, Relation Schemas and Database Schemas
Keys and Integrity Constraints
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44

Partial preview of the text

Download Relational Databases-Lecture 05 Slides-Computer Science and more Slides Relational Database Management Systems (RDBMS) in PDF only on Docsity!

Relational Databases - Comp2400 / Comp

Lecture 6: The Relational Model: Updates and Integrity

A more careful look at the relational data model

Tips on your own PostgreSQL installation Domains, Relation Schemas and Database Schemas Keys and Integrity Constraints

Quick Feedback

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.

Cooperation and Plagiarism

Executive summary: cooperation yes, plagiarism no.

Cooperation and Plagiarism

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.

Installing PostgreSQL on Linux/Unix

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

Other PostgreSQL Installation Strategies

(^1) forget it, use what the DCS IT guys provide in the labs!

Other PostgreSQL Installation Strategies

(^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

Other PostgreSQL Installation Strategies

(^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

Datatypes and Domains

A domain is a datatype, named and constrained to represent a particular kind of real world value.

Datatypes and Domains

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โ€™);

Datatypes and Domains

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

Datatypes and Domains

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

Datatypes and Domains

Question

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 );

Relation

[E&N ยง5.1]

A relation is a set, but a table is a list.