Lecture1(1) - Lecture 1 on Relational Algebra This lecture...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
01/11/12 Lecture 1 on Relational Algebra This lecture introduces relational data model with relational algebra as its mathematical foundation Relational operations can be derived from the set operations of Select, Project, Join, Semi-join, Union, Intersect, Difference, Natural Join, Natural Semi-join, Outer Join and Cartesian Product.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
01/11/12 Relational database A relational database has been defined as a collection of tables. The major advantages of the relational approach are its simplicity and generality as follows: An interface for a high-level, non-procedural data language Efficient file structures store the database An efficient optimizer to help meet the response-time requirements User views and snapshots of the stored database. Integrity control – validation of semantic constraints on the database Concurrence control – synchronization updates to a shared database by multiple users Selective access control – authorization of access privileges to one user’s database Recovery from both soft and hard crashes. A report generator for a display of the results of interactions against the database.
Background image of page 2
01/11/12 Relational model Relational systems are based on an underlying set of theoretical ideas known as the relational model. The relational model can be characterized as a way of looking at data. It is concerned with three aspects of data: data structure, data integrity, and data manipulation.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
01/11/12 Relational data structure Relation – may be seen as a table or record type. Attribute – All values that occur in a specific field type, or column. Tuple – A row or record occurrence of a table Domain – A set of possible values for some attributes. Primary key – Record identifier for uniquely identifying rows in a relation without null value. Candidate key – Any set of attributes that could be chosen as a key of a relation. Composite key – A primary key consisting of more than one attribute. Foreign key – A set of attributes in one relation that constitute a key in some other relation; used to indicate logical links between relations. Domain – domains are pools of values, from which the actual values appearing in attributes are drawn.
Background image of page 4
01/11/12 Relations Relation may be seen as a table. A table provides a natural mechanism for conveying information in a compact form. In a table, there is a number of column, one for each attribute of the objects described. Each entry in the table is a row containing values for each attribute, i.e. a tuple.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
01/11/12 S# SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens P# PNAME COLOR WEIGHT CITY P1 Nut Red 12 London P2 Bolt Green 17 Paris P3 Screw Blue 17 Rome P4 Screw Red 14 London P5 Cam Blue 12 Paris P6 Cog Red 19 London S# P# QTY S1 P1 300 S1 P2 200 S1 P3 400 S1 P4 200 S1 P5 100 S1 P6 100 S2 P1 300 S2 P2 400 S3 P2 200 S4 P2 200 S4 P4 300 S4 P5 400 S P SP The Suppliers-and-parts database (sample values)
Background image of page 6
01/11/12 Relational Schema (Data Definition Language) Create Table – create relation as a relational schema.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/11/2012 for the course CS CS3462 taught by Professor Drlee during the Spring '11 term at City University of Hong Kong.

Page1 / 36

Lecture1(1) - Lecture 1 on Relational Algebra This lecture...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online