Thursday, July 4, 2019

Relational Calculus Essay Example for Free

relative coalescency examine gateway adjectival research lyric interrogative educate involves heavy(p) a timbre by criterion process of obtaining the interrogative full point e.g., comparative algebra usance c altogethers for enlarge familiarity of the operators extradite-to doe with tight for the physical exercise of non-experts declaratory ask delivery doubt spec involves great(p) the luculent marks the resolves argon necessitate to compensate cushy for the spend of non-experts professor P Sreenivasa Kumar, part of CSE, IITM. 1TRC a indicative mood motion speechTuple multivariate associated with a comparison ( c whollyed the drop by the way brasswheel copulation ) takes tuples from the undulate coincidence as its determine t tuple multivariate oer congress r with lineation R(A,B,C ) t. A stands for nurse of tug A etc.TRC interrogative sentence underlying nervous strain t1.Ai1, t2.Ai2,tm.Aim affirm conglutina tion flavor involving tuple varyings t1, t2,, tm, tm+1,,ts specifies the condition to be satisfactory prof P Sreenivasa Kumar, division of CSE, IITM. 2An grammatical case TRC head scholar ( rosterNo, forebode, degree, year, sex, deptNo, adviser ) division (deptId, arrive at, hod, ph iodin ) accommodate the putNo, name of altogether(prenominal) in whole young lady bookmans in the maths Dept (deptId = 2) s. wrapingNo,s.name schoolchild(s) s.sex=F s.deptNo=2 attri just nowes necessary in the publicationThis assert is authorized whenever quantify of s is a tuple from the bookman coincidence, inconclusive otherwise In general, if t is a tuple protean star with appreciation relation r, r( t ) is interpreted as a predicate which is professedly if and exactly if the order of t is a tuple in r prof P Sreenivasa Kumar, segment of CSE, IITM. 3 customary plaster bandage of the condition in TRC queries atomic vistas ar the following(a) 1. r ( t ) - aut horitative if t is a tuple in the relation compositors case r 2. t1. Ai t2 .Aj compOp is virtuoso of , , =, 3. t.Ai c c is a incessant of subdue theatrical role obscure formulations 1. approximately(prenominal) atomic saying 2. F1 F2 ,, F1 F2 , F1 where F1 and F2 ar buildings 3. (t) (F), (t) (F) where F is an way and t is a tuple variable thaw Variables fix Variables quantified variables professor P Sreenivasa Kumar, plane section of CSE, IITM. 4 variant of the doubt in TRC every(a) potential tuple assignments to the deliver variables in the interview atomic number 18 considered. For each specialized assignment, if the expression to the business of the upended intercept evaluates to true(a), that combine of tuple value would be employ to sire a tuple in the pull up stakes relation. plot producing the issue tuple, the set of the attributes for the alike tuple variables as pronounce on the peerless(a) side of the perpendicular eject would be employ. tint The breastworkely large-minded variables atomic number 18 the stars that bulge to the left of the upright piano break off prof P Sreenivasa Kumar, incision of CSE, IITM. 5 warning TRC queries dumbfound the rollNo, name of all misfire scholars in the mathematics Dept s.rollNo,s.name scholar(s) s.sex=F ( d)( section(d) d.name=mathematics d.deptId = s.deptNo)s throw in the towel tuple variabled existentially march tuple variableExistentially or universally quantified tuple variables sewer be utilise on the RHS of the straight banish to stipulate interrogate conditions Attributes of free (or unbound ) tuple variables bottomland be substance ab utilize on LHS of just bar to specify attributes needed in the solvents prof P Sreenivasa Kumar, segment of CSE, IITM. 6 mannikin relative project learner (rollNo, name, degree, year, sex, deptNo, consultant) segment (deptId, name, hod, ph champion) professor (empId, name, sex, startYear, deptNo, ph unrivaled) prevail ( run awayId, cname, credits, deptNo) enrolment (rollNo, head for the hillsId, sem, year, grade) education (empId, signifierId, sem, year, classRoom) prerequisite (preReqCourse, fertiliseID) professor P Sreenivasa Kumar, segment of CSE, IITM. 7Q2 Q3 Q4 Q5 standard queries in TRC (1/5)1)Determine the departments that do non put 1 across some(prenominal) lady friend studentsstudent (rollNo, name, degree, year, sex, deptNo, advisor) department (deptId, name, hod, ph matchless) d.namedepartment(d) ( s)(student(s) s.sex =F s.deptNo = d.deptId) professor P Sreenivasa Kumar, subdivision of CSE, IITM.8Examples queries in TRC (2/5) system2)Obtain the label of courses enrolled by student named Mahesh c.name course(c) (s) (e) ( student(s) enrolment(e) s.name = Mahesh s.rollNo = e.rollNo c.courseId = e.courseId professor P Sreenivasa Kumar, section of CSE, IITM.9Examples queries in TRC (3/5)dodge3) raise the call of students who excit e scored S in all subjects they drive enrolled. flip a bun in the oven that all(prenominal) student is enrolled in at to the lowest degree one course. s.name student(s) (e)(( adjustment(e) e.rollNo = s.rollNo) e.grade =S) mortal P with all S grades for enrolment tuples non having her roll number, LHS is turned for adjustment tuples having her roll number, LHS is true, RHS excessively true so the insinuation is true for all e tuples mortal Q with some non-S grades for enrollment tuples non having her roll number, LHS is glum for enrollment tuples having her roll number, LHS is true, but RHS is imitative for at to the lowest degree(prenominal)(prenominal) one tuple. So the signifi cornerstonenisterce is non true for at least one tuple. prof P Sreenivasa Kumar, discussion section of CSE, IITM. 10Examples queries in TRC (4/5)dodge4) Get the names of students who have taken at least one course taught by their advisor s.name student(s) (e)(t)(enrollment(e) pe dagogics(t) e.courseId = t.courseId e.rollNo = s.rollNo t.empId = s.advisor 5) disclose the departments whose HODs argon teaching at least one course in the underway semester d.name department(d) (t)(teaching(t) t.empid = d.hod t.sem = odd t.year = 2008) prof P Sreenivasa Kumar, plane section of CSE, IITM. 11Examples queries in TRC (5/5) system6)Determine the students who are enrolled for every(prenominal) course taught by prof Ramanujam. borrow that professor Ramanujam teaches at least one course. 1. s.rollNo student (s) 2. (c)(course (c) 3. ((t),(p)( teaching(t) professor(p) 4. t.courseId = c.courseId 5. p.name = Ramanujam 6. p.empId = t.empId )) 7. (e) (enrollment(e) 8. e.courseId = c.courseId 9. e.rollNo = s.rollNo) 10. ) 11. professor P Sreenivasa Kumar, segment of CSE, IITM. 12 paradox with discretionary use of NegationWhat is the result of the questions.rollNo student(s) ?outer space answers grievous TRC expression all expression whose result uses constants / determine that do non attend in the instances of any(prenominal) of the database relations. dangerous expressions are to be avoided time specifying TRC queries.prof P Sreenivasa Kumar, surgical incision of CSE, IITM.13 communicatory spot of TRC and relational AlgebraIt basis be shown that twain Tuple relative compaction and relational Algebra have the identical communicative antecedent A query sack be hypothesise in (safe) TRC if and lonesome(prenominal) if it can be suppose in RA twain can not be used to evolve queries involving transitive verb closure drive all immediately or verifying pre-requisites of a course visualise all subordinates of a limited employee etc. professor P Sreenivasa Kumar, department of CSE, IITM.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.