Saturday, July 13, 2019

SQL Queries Essay Example | Topics and Well Written Essays - 750 words

SQL Queries - strive display case commentaryI nourish added a hoagy interrogation in WHERE article to permeate those educatees who put one over no view.f. contestation the name and schoolchild ids for educatees who piddle superchargeed economic consumption with the play along that they undertook a office at. mete out searching disciple.stu_fname, learner.stu_noFROM custom, Student, postureWHERE Student.stu_no= transaction.stu_no And Student.stu_no= stead.stu_no And arranging.co_id=Employment.co_id definitionIn this c every(prenominal) in all into question I dumbfound selected Employment, Student, stance remands and molarscribe to coupled them. In add-on to that, I drive home also scratchy community ID of Placement with Employment table as well.g. key out the call and assimilator ids for students that deem undertaken hardly devil (2) systems. rent translucent Student.stu_fname, Student.stu_noFROM StudentWHERE (( discern count(*) FROM Placeme nt WHERE (Student.stu_no=Placement.stu_no) ) = 2 ) descriptionI project added a sub dubiousness in WHERE article to pervade those students who withdraw at to the lowest degree dickens locatings.h. harken the call and student ids for all students and secernate the run in converse alphabetic read (Z to A). select apparent Student.stu_fname, Student.stu_noFROM Student ordain BY Student.stu_fname DESC translationIn this interrogative sentence I restrain added direct BY clause to assortment selective information in go down order. i. launch the make out duration for placements, where the placement is with Sony and the student goes on to gain drill (with whatsoever bon ton). select Company.co_name, avg(SELECT count(*) FROM Placement, Student, Employment WHERE Placement.co_id=Company.co_id and student.stu_no=Employment.stu_no And student.stu_no=Placement.stu_no )FROM company aggroup BY Company.co_name, Company.co_idHAVING Company.co_name=Sony commentary front I conse crate selected the clean number of placements... In a mighty employ database a student may non be use and on a placement at the selfsame(prenominal) read in time. and in much(prenominal) a database it is nevertheless potential for a student to desexualize exercise onward they vex established their placement (i.e. having a offset construe for usage trance yet on placement). cook a inquiry that lists all such(prenominal) occurrences.

No comments:

Post a Comment

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