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

  • Good Essays

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

    • 10483 Words
    • 42 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
  • 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
  • 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
  • Good Essays

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

    • 706 Words
    • 3 Pages
    Good 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
  • 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
  • Powerful Essays

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

    • 1729 Words
    • 7 Pages
    Powerful Essays
  • Best Essays

    Relational Dialectics

    • 2179 Words
    • 9 Pages

    Imagine a world without communication. There would be a lack of spoken word, gestures; anything that the world uses to interconnect would be eliminated. All in all, our civilization as a whole would fall apart. Communication is one of the major roles in a functioning society. It can be broken up into several different subcategories, from verbal, non-verbal or emotion-driven. Communication sends signals to those around us and shows how language is such a prevalent part of one’s society. One thing that all forms of communication have in common is that it strikes a response or reaction. Different circumstances promote different forms of communication. In some forms of communication, tensions and contradictions can arise which makes those situations harder to handle. In relational dialectics, it discusses the contradictions in communication and other patterns that form positive and negative interactions within a relationship.…

    • 2179 Words
    • 9 Pages
    Best Essays
  • Better Essays

    The original idea was to supply you with an excel file of student data (names, award, date of birth etc) that you could simply (!) edit and import into your empty database. However I had forgotten what a pain this is and what I don’t want is for you to be spending all your initial analysis time solving this problem. That is not to say that I don’t want the import problem solving but as you redesign your system it may be that some of the problems go away (or at least become different)…

    • 1132 Words
    • 5 Pages
    Better Essays
  • Powerful Essays

    Query Optimization Paper

    • 1520 Words
    • 7 Pages

    The query optimizer is an important system component of a relational database management system (DBMS). It is the responsibility of this component to translate the user-submitted query - usually written in a non the database. The research literature describes a wide variety of optimization strategies for different quer y languages and implementation environments. However, very little is known about how to design and structure the query optimization component to implement these strategies. This paper proposes a first step towards the design of a modular query optimizer. We describe its operations by transformation rules which generate different QEPs from initial query specifications. As we distinguish different aspects of the query optimization process, our hope is that the approach taken in this paper will contribute to the more general goal of a modular query optimizer as part of an extensible database management system. -procedural language - into an efficient query evaluation plan (QEP) which is then executed against…

    • 1520 Words
    • 7 Pages
    Powerful 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
  • 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
  • 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