cc301_Chapter_1.ppt - CC301 Database Technology Lecture 1 Relational Algebra and SQL 1 Content 1 Models Languages and their Use in databases 2 The

cc301_Chapter_1.ppt - CC301 Database Technology Lecture 1...

This preview shows page 1 - 7 out of 28 pages.

1 CC301: Database Technology Lecture 1 Relational Algebra and SQL
Image of page 1
2 Content 1 Models, Languages and their Use in databases 2 The Relational Algebra (RA) 3 Simulating RA operations in SQL
Image of page 2
3 1.1 Relational and other data models Relational models (relational algebra, relational calculus) – most of the contemporary RDBMS are based on them Tree models (hierarchical, object-relational) – both legacy systems and new systems use them Object-oriented models (ODMG) – recent development, still not widely employed Note: XML native databases have some similarities with the hierarchical database systems (legacy systems), but they have more elaborated model and query languages, which are close to OQL (the standard query language of object- oriented databases)
Image of page 3
4 1.2 Relational Languages and their Use D ata M anipulation L anguage (DML) Use: Populates, updates, and queries relational DB Example: relational algebra, SQL DML D ata D efinition L anguage (DDL) Use: Specifies the data structures and defines the relational schema Example: domain calculus, SQL DDL D ata C ontrol L anguage (DCL) Use: Specifies operation permissions, resource access discipline and user profiles Example: SQL DCL, LDAP Note: Contemporary relational languages often incorporate some object- relational features of the model – e.g. Oracle 8i SQL has types, Oracle 9i SQL has type inheritance
Image of page 4
5 1.3 Can DB live without formal model? The answer is NO for several reasons: as we will see, SQL has ambiguities, while the relational algebra is unambiguous – so it can provide semantic interpretation for SQL Moreover, because of the same reason SQL cannot be executed directly, it needs to be translated into a realistic structure of operations first, which can be interpreted then Finally, if we want to control the execution of the SQL statements, we need to know how it works
Image of page 5
6 2 The Relational Algebra Proposed by Codd in 1970 as a formal data model. Describes the relations and the operations to manipulate relations Relational operations in relational algebra transform either a single relation (unary operation), or a pair (binary operation) into another relation Can be also used to specify retrieval requests (queries). Query result is also in the form of a relation. Relational Operations: RESTRICT ( ) and PROJECT ( ) operations.
Image of page 6
Image of page 7

You've reached the end of your free preview.

Want to read all 28 pages?

  • Summer '19
  • Relational model

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes