Preview

Relational Calculus

Powerful Essays
Open Document
Open Document
1192 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Relational Calculus
Tuple Relational Calculus ( TRC )
Introduction Procedural Query language query specification involves giving a step by step process of obtaining the query result e.g., relational algebra usage calls for detailed knowledge of the operators involved difficult for the use of non-experts Declarative Query language query specification involves giving the logical conditions the results are required to satisfy easy for the use of non-experts
Prof P Sreenivasa Kumar, Department of CS&E, IITM. 1

TRC – a declarative query language
Tuple variable – associated with a relation ( called the range relation ) • takes tuples from the range relation as its values • t: tuple variable over relation r with scheme R(A,B,C ) t.A stands for value of column A etc TRC Query – basic form: { t1.Ai1, t2.Ai2,…tm.Aim | θ } predicate calculus expression involving tuple variables t1, t2,…, tm, tm+1,…,ts - specifies the condition to be satisfied
Prof P Sreenivasa Kumar, Department of CS&E, IITM. 2

An example TRC query student (rollNo, name, degree, year, sex, deptNo, advisor ) department (deptId, name, hod, phone )
Obtain the rollNo, name of all girl students in the Maths Dept (deptId = 2) {s.rollNo,s.name| student(s)^ s.sex=‘F’^ s.deptNo=2}

attributes required in the result

This predicate is true whenever value of s is a tuple from the student relation, false otherwise In general, if t is a tuple variable with range relation r, r( t ) is taken as a predicate which is true if and only if the value of t is a tuple in r
Prof P Sreenivasa Kumar, Department of CS&E, IITM. 3

General form of the condition in TRC queries
Atomic expressions are the following: 1. r ( t ) -true if t is a tuple in the relation instance r 2. t1. Ai t2 .Aj compOp is one of {, ≥, =, ≠ } 3. t.Ai c c is a constant of appropriate type Composite expressions: 1. Any atomic expression 2. F1 ∧ F2 ,, F1 ∨ F2 , ¬ F1 where F1 and F2 are expressions 3. (∀t) (F), (∃t) (F) where F is an expression and t is a tuple

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Homework Unit 3

    • 354 Words
    • 2 Pages

    4. AND operator- combines more than one condition in a program. Makes a compunf Boolean operation.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CTS 2437 Final Exam

    • 630 Words
    • 4 Pages

    Before providing a solution for any of the following problems, create the Faculty database. This is attached to the Final Exam—Part 2 link in Blackboard.…

    • 630 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Structured Query Language (SQL) is a standard database computer language used for querying, modifying and managing data in Relational Database Management Systems (RDBMS). SQL was developed in the 1970's by IBM to initially manipulate and retrieve data in IBM System R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization for Standardization (ISO) standards.…

    • 612 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Clc Agreement

    • 949 Words
    • 28 Pages

    |CLC Member Name |Primary Email Address |Secondary Email Address |Other Contact | | | | |Information | |Maria Mosqeda |MMosqueda1@my.gcu.edu |Mariamaria4417@sbcglobal.net |209-475-9642 | |Erica Smith |Emartinez13187@my.gcu.edu |ericalmartinez@yahoo.com |928-210-2327 | |Leelamma |LVarghese@my.gcu.edu |daisy.babu@yahoo.com |301-741-1930 | |Nina Zabalza |nzabalza@my.gcu.edu |ninazabalza@gmail.com |480-390-1569 | |Hope T |HTorres1@my.gcu.edu |Torres1751@comcast.net |8474317133 |…

    • 949 Words
    • 28 Pages
    Powerful Essays
  • Satisfactory Essays

    unit 6

    • 360 Words
    • 2 Pages

    1) SQL is the programming language used to manipulate data and data objects in a relational database management system.…

    • 360 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    FAMILY NAME: . . . . . . . . . . . . . . . . . . . . . . . . . . . . OTHER NAME(S):. . . . . . . . . . . . . . . . . . . . . . . . . . STUDENT NUMBER: . . . . . . . . . . . . . . . . . . . . . . SIGNATURE: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .…

    • 10483 Words
    • 42 Pages
    Good Essays
  • Good Essays

    Unit 5 PT1420

    • 959 Words
    • 7 Pages

    6.When determining whether a number is inside a range, which logical operator is it best to use?…

    • 959 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Extract the First and Last Name, Address, City, State, Zip Code and Phone Number of each senior on the database. Sort by Last Name, then First Name (1 sort).…

    • 325 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    "SQL Sql Database Language Data Standard Query Programming Set." Business, Economy, Market Research, Finance, Income Tax Informations. N.p., n.d. Web. 26 Sept. 2012. <http://www.economicexpert.com/a/SQL:programming:language.htm>.…

    • 701 Words
    • 3 Pages
    Good Essays
  • Good Essays

    - Yes, the ordered pairs represent a function the range is , and the domain is…

    • 706 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Student ID | 5 | 7 | 9 | 7 | 5 | 7 | | | |…

    • 1729 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    Consider a simple selection query asking for all reservations made by sailor Joe. As we saw in the previous chapter, there are many ways to evaluate even this simple query, each of which is superior in certain situations, and the DBMS must consider these alternatives and choose the one with the least estimated cost. Queries that consist of several operations have many more evaluation options, and finding a good plan represents a significant challenge. A more detailed view of the query optimization and execution layer in the DBMS architecture presented in Section 1.8 is shown in Figure 13.1. Queries are parsed and then presented to a query optimizer, which is responsible for identifying an efficient execution plan for evaluating the query. The optimizer generates alternative plans and chooses the plan with the least estimated cost. To estimate the cost of a plan, the optimizer uses information in the system catalogs. This chapter presents an overview of query optimization, some relevant background information, and a case study that illustrates and motivates query optimization. We discuss relational query optimizers in detail in Chapter 14. Section 13.1 lays the foundation for our discussion. It introduces query evaluation plans, which are composed of relational operators; considers alternative techniques for passing results between relational operators in a plan; and describes an iterator interface that makes it easy to combine code for individual relational operators into an executable plan. In Section 13.2, we describe the system catalogs for a relational DBMS. The catalogs contain the information needed by the optimizer to choose between alternate plans for a given query. Since the costs of alternative plans for a given query can vary by orders of magnitude,…

    • 5828 Words
    • 24 Pages
    Powerful Essays
  • Satisfactory Essays

    dbms 2 marks

    • 347 Words
    • 3 Pages

    Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE Short Answers Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE 3rd Semester 2marks Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE 3rd Semester Important Questions Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE Short answers Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE Database Management Systems 2marks Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE DBMS 2marks Free Download | Anna University Chennai Regulation 2013 B.E. Computer Science and Engineering CSE DBMS Important Questions Free Download…

    • 347 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Object Oriented Database

    • 5350 Words
    • 22 Pages

    “Choosing the right OODB architecture can mean orders of magnitude difference in performance and scalability characteristics rather than a few percentage points as found in relational implementations.”…

    • 5350 Words
    • 22 Pages
    Powerful Essays
  • Good Essays

    Project

    • 2616 Words
    • 11 Pages

    Compatibility : Models of computation—Finite Automata, Pushdown Automata, Nondeterminism and NFA. DPDA and PDAs and Languages accepted by these structures.…

    • 2616 Words
    • 11 Pages
    Good Essays

Related Topics