<< Chapter < Page Chapter >> Page >
Catesian Product Operation Notation
Catesian Product Operation Example
  • Note: As we can notice, the CARTESIAN PRODUCT operation by itself is not a useful querying mechanism since the result size is large. However, it is an extremely important operation of relational algebra since it is the basic mechanism for combining information across relations. We will discuss about this topic in more detail in Query Processing lecture.

Other relational algebra operations

  1. SELECT Operation

The SELECT operation is an unary operation. It means the input of this operation is only one relation and it output is also a relation.

The SELECT operation returns a subset of the tuples from a relation that satisfies a selection condition. The SELECT operation can be viewed as a horizontal filter of the relation. It partitions the input relation into two sets of tuples: those tuples that satisfies the condition are select, those do not satisfy the condition are discarded.

  • Notation: σ selection condition > ( r ) size 12{σ rSub { size 8{ ital "selection"` - ` ital "condition"}} \( r \) } {}
Select Operation Notation
  • σ F ( r ) = { t t r F ( t ) } size 12{σ rSub { size 8{F} } \( r \) `=` lbrace t \lline `t in `r and `F \( t \) rbrace `} {} where r(R) and F is a boolean expression on attributes in R

The selection condition is made up of a number of clauses of the form

  • <attribute name><comparison op><constant value>OR
  • <attribute name 1><comparison op><attribute name 2>

In the clause, the comparison operations could be one of the following: ≤, ≥, ≠, =,>,<. Clauses are connected by Boolean operators : and, or , not

  • Result size σ F ( r ) r size 12{ \lline σ rSub { size 8{F} } \( r \) \lline<= ` \lline r \lline `} {}
  • Result schema: R
  • Producing the result of the SELECT operation
    • Selection condition F is evaluate for each tuple in r, with the attribute variables in F set to their values in the tuples
    • Any tuple t that F(t) = true is placed in the result set
    • Other tuples are not include in the result.
  • Example: Retrieve the Id, Name, Suburb of students who live in Bundoora
Select Operation Example - 1
  • Example: Retrieve the Id, Name, Suburd of student who’s name is Mary or students who live in Bundoora
Select Operation Example - 2
  1. PROJECT Operation

The PROJECT operation is another unary operation. This operation returns a set of tuples containing a subset of the attributes in the original relation. Thus, as we state that the SELECT operation selects some rows and discards the others. The PROJECT operation, on the other hand, selects some columns of the relation and discards the other column. The PROJECT operation can be viewed as the vertical filter of the relation.

  • Notation: π attribute list ( r ) size 12{π rSub { size 8{ ital "attribute"` - ital "list"} } \( r \) } {}
Project Operation Notation
  • π X ( r ) = { t [ X ] t r } size 12{π rSub { size 8{X} } \( r \) `=` lbrace t` \[ X \] ` \lline t in `r rbrace ` } {} where r(R)
  • Result size: π X ( r ) r size 12{ \lline π rSub { size 8{X} } \( r \) \lline<= ` \lline r \lline `} {}
  • Result schema: R’(X)
  • Producing the result of PROJECT operation
    • Take each tuple in the original relation, extract the values of the specified attributes
    • Form new tuple from these values and place the new tuple in the result if it is not already there. This steps includes the duplicate removal phase, this makes the result of PROJECT operation a relation
  • Example: Retrieve the suburbs that are stored in database
Project Operation Example - 1
  • Retrieve the name of the subjects and department which is responsible for the subject

Questions & Answers

what is defense mechanism
Chinaza Reply
what is defense mechanisms
Chinaza
I'm interested in biological psychology and cognitive psychology
Tanya Reply
what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Algebra. OpenStax CNX. Aug 17, 2012 Download for free at http://cnx.org/content/col11445/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Algebra' conversation and receive update notifications?

Ask