






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of questions and answers related to database management systems, focusing primarily on sql (structured query language). It covers topics such as relational algebra, sql data types, comparison operators, aggregate functions, and sql clauses. The questions address how to select, edit, and add data to relational databases, as well as how to perform various operations like sorting, joining tables, and calculating fields. The document serves as a study aid for understanding sql syntax and database concepts, providing practical examples of sql statements for tasks such as listing data, filtering records, and performing calculations. It is designed to help students and professionals alike in mastering the fundamentals of sql and database management, offering a concise yet comprehensive overview of essential sql commands and techniques. This resource is valuable for anyone looking to enhance their skills in database querying and manipulation.
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!







DSS Test 2 Each nnintersection nnof nna nnrow nnand nncolumn nnin nna nntable nnmay nncontain nnmore nnthan nnone nnvalue. nn- nnWhich nnof nnthe nnfollowing nnis nnnot nna nncharacteristic nnof nna nnhealthy nnrelation? A nnrecord nnis nnall nnof nnthe nnattribute nnvalues nnfor nnone nnitem nnin nnan nnentity. nn- nnWhich nnof nnthe nnfollowing nnsentences nnexplains nnhow nnentities, nnattributes, nnand nnrecords nnwork nntogether? primary nnkey nnfield nn- nnThe nn_____ nncontains nnvalues nnthat nnuniquely nnidentify nneach nnrecord nnin nna nntable nnand nnserves nnas nnthe nnlinking nnfield nnin nnthe nntable nnon nnthe nn"one" nn(parent) nnside nnof nna nnone- to-many nnrelationship. It nnis nnthe nnfield nnin nnthe nntable nnon nnthe nn"many" nn(child) nnside nnof nna nnone-to-many nnrelationship. nn- nnWhat nnis nnthe nnpurpose nnof nnthe nnforeign nnkey nnfield? the nnsame nnrow, nndifferent nnrows nn- nnIn nnthe nnquery nndesign nngrid nnin nnAccess nnQuery nnDesign nnView, nnyou nnplace nnAND nncriteria nnon nn_____, nnand nnyou nnplace nnOR nncriteria nnon nn_____. OR nncriteria, nnAND nncriteria nn- nnWith nn_____, nnonly nnone nncriterion nnmust nnevaluate nntrue nnin nnorder nnfor nna nnrecord nnto nnbe nnselected nnand nnwith nn_____, nnall nncriteria nnmust nnbe nnevaluate nntrue nnin nnorder nnfor nna nnrecord nnto nnbe nnselected. MonthlyRate: nn[AnnualRate] nn/ nn 12 nn- nnWhich nnof nnthe nnfollowing nnis nnan nnexample nnof nna nncomputed nnfield? An nnaggregate nnfunction nnsums, nnaverages, nnor nncounts, nnfor nnexample, nnthe nnrecords nnin nna nngroup. nn- nnWhich nnof nnthe nnfollowing nndescribes nnan nnAccess nnaggregate nnfunction? Use nnthe nnSort nnrow nnand nnspecify nnthe nnsort nnfields nnin nna nnleft-to-right nnorder. nn- nnHow nndo nnyou nnsort nndata nnin nnAccess nnQuery nnDesign nnView? You nnmay nnnot nncreate nnorphan nnrecords nnby nnentering nna nnphony nnforeign nnkey nnfield nnvalue nnin nnthe nn"many" nntable. nn- nnWhat nndoes nnit nnmean nnto nnenforce nnreferential nnintegrity nnon nna nnone-to-many nnrelationship?
SELECT nn- nnWhich nnof nnthe nnfollowing nntypes nnof nnqueries nndoes nnnot nnchange nndata nnin nnAccess? Relational nnAlgebra nn- nn_____ nnforms nnthe nnfoundational nnknowledge nnfor nnSQL, nnStructured nnQuery nnLanguage, nnwhich nnis nnthe nnmost nnpopular nnway nndevelopers nnselect, nnedit, nnand nnadd nndata nnto nna nnrelational nndatabase. DECIMAL nn- nnWhich nnof nnthe nnfollowing nnis nnnot nnan nnAccess nnSQL nndata nntype | nn| nn- nnWhichof nnthe nnfollowing nnis nnnot nna nnvalid nncomparison nnoperator? Criteria nnjoined nnby nnOR nnmay nnselect nnmore nnrecords nnthan nnif nnjoined nnby nnAND nn- nnWhich nnof nnthe nnfollowing nnis nntrue? A nncalculated nnfield nnstarts nnby nndetermining nnhow nnto nngroup nnthe nnrecords nn- nnWhich nnof nnthe nnfollowing nnis nnnot nntrue nnabout nncomputed nnor nncalculated nnfield? BETWEEN nn- nnWhich nnSQL nnoperator nncan nnbe nnrewritten nnwith nn>= nnAND nn<= nnoperators? IN nn- nnWhich nnSQL nnoperator nnprovides nna nnconcise nnway nnof nncreating nna nncondition nnto nnmatch nna nnspecific nnlist nnof nncriteria? SUBTOTAL nn- nnWhich nnof nnthe nnfollowing nnis nnnot nnan nnaggregate nnfunction nnused nnto nncalculate nninformation nnon nngroups nnof nnrecords? ORDER nnBY nnLastName, nnFirstName nn- nnWhich nnSQL nnclause nnsorts nnthe nnselected nnrecords nnin nnascending nnorder nnby nnFirstName nnwithin nnLastName? WHERE nnCustomers.CustID nn= nnOrders.CustID nn- nnWhich nnSQL nnclause nnwould nnjoin nna nnCustomers nntable nnwith nnan nnOrders nntable nnassuming nnthat nnthey nnare nnrelated nnin nna nnone-to-many nnrelationship nnon nna nnfield nncalled nnCustID nnin nnboth nntables?
ORDER nnBY nnCategoryID, nnTaskID nn- nnWhich nnSQL nncommand nnwould nnbe nnused nnto nnsort nnall nnTaskMasterList nnrecords nnin nnascending nnorder nnbased nnon nnthe nnvalue nnof nntheir nnTaskID nnwithin nnCategoryID? WHERE nnNOT nnPer nn= nn'Hour' nn- nnWhich nnSQL nnkeyword nnwould nnbe nnused nnto nnselect nnall nnrecords nnexcept nnthose nnwith nna nnPer nnfield nnvalue nnof nnHour? TEXT nnto nnCity nnand nnTEXT nnto nnZip nn- nnWhat nndata nntypes nnwould nnyou nnassign nnto nnthe nnCity nnand nnZip nnfields nnwhen nncreating nnthe nnZips nntable? SELECT nnSalary nn* nn0.1 nnAS nnBonusFROM nnEmployees; nn- nnWhich nnSQL nnstatement nncalculates nnthe nnBonus nnfield nnin nnthe nnEmployees nntable nnas nn 10 nnpercent nnof nnSalary? SELECT nnTitle, nnCOUNT() nnAS nnCountOfTitleFROM nnEmployeesGROUP nnBY nnTitle; nn- nnWhich nnSQL nnstatement nnlists nnthe nnjob nntitles nnat nnJCC nnand nndisplays nnthe nnnumber nnof nnemployees nnthat nnhave nneach nntitle? SELECT nnLastName, nnSalaryFROM nnEmployeesWHERE nnSalary nn< nn(SELECT nnSalary nnFROM nnEmployees nnWHERE nnEmployeeID nn= nn'72'); nn- nnWhich nnSQL nnstatement nnlists nnthe nnlast nnnames nnand nnsalaries nnof nnemployees nnwho nnhave nna nnSalary nnfield nnvalue nnless nnthan nnAmir nnNasser, nnEmployeeID nn72? SELECT nnClassName, nnRoom, nnLocation, nnDay, nnTime nnFROM nnClasses; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnList nnthe nnclass nnname, nnroom, nnlocation, nnday, nnand nntime nnfor nnall nnclasses. SELECT nnCustomers.LastName, nnReservations.ClassDate nnFROM nnCustomers, nnReservations nnWHERE nnCustomers.CustomerID nn= nnReservations.CustomerID nnAND nnReservations.ClassDate=#1/2/2021#; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnDisplay nnthe nnlast nnnames nnof nnthe nncustomers nnwho nnhave nnregistered nnfor nna nnclass nnon nn1/2/2021. SELECT nnLastName, nnStreetAddress nnFROM nnCustomers nnWHERE nnStreetAddress nnLIKE nn"Negley*"; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnDisplay nnthe nnlast nnname nnand nnstreet nnaddress nnof nnthe nncustomers nnwho nnlive nnon nnNegley.
SELECT nnCOUNT(ReservationID) nnAS nnCountOfReservationID nnFROM nnReservations nnWHERE nnClassDate=#1/3/2021#; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnCount nnthe nnnumber nnof nnreservations nnfor nn1/3/2021 nnand nndisplay nnthat nnnumber nnwith nna nnCountOfReservationID nnheading. SELECT nnInstructorLastName nnFROM nnInstructors nnWHERE nnInstructorZipCode nn= nn"15217"; nn- nnWrite nnthe nnSQL nncode nnthat nnanswers nnthe nnfollowing nnquestion: nnWhich nninstructors nn(showing nnlast nnname nnonly) nnlive nnin nnzip nncode nn15217? SELECT nnClassName, nnDay, nnLocation nnFROM nnClasses nnWHERE nnDay='Wednesday' nnAND nnLocation='Downtown'; nn- nnWrite nnthe nnSQL nncode nnthat nnanswers nnthe nnfollowing nnquestion: nnWhich nnclasses nnare nnscheduled nnfor nnWednesdays nnat nnthe nnDowntown nnlocation? nnList nnthe nnclass nnname, nnthe nnday, nnand nnthe nnlocation. SELECT nnInstructorLastName, nnLengthofTime/6020 nnAS nnAmountEarned nn- nnWhat nnSELECT nnstatement nnwould nnyou nnuse nnin nna nnlonger nnquery nnto nncalculate nnthe nnamount nnof nnmoney nnearned nnby nneach nninstructor nnbased nnon nnthe nnlength nnof nntime nnfor nnthe nnclass nnand nn$20 nnper nnhour. nnDisplay nnthe nninstructor's nnlast nnname nnand nnthe nnamount nnearned. UPDATE nnReservations nnSET nnClassPrice nn= nnClassPrice1.01; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnUpdate nnall nnclass nnprices nnto nnreflect nna nn1% nnincrease. SELECT nnInstructorFirstName nn& nn" nn" nn& nnInstructorLastName nnAS nnInstructorFullName nn- nnHow nnwould nnyou nnwrite nnthe nnSELECT nnstatement nnin nna nnlonger nnquery nnif nnyou nnwanted nnto nnconcatenate nnthe nnfirst nnand nnlast nnname nnof nnthe nninstructors nnand nndisplay nnthat nnas nnInstructorFullName? SELECT nn* nnFROM nnReservations nnORDER nnBY nnClassDate, nnClassID; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnOrder nnthe nnreservations nnby nnclass nndate nnand nnthen nnby nnclass nnID. nnDisplay nnall nnfields. SELECT nn* nnFROM nnPatient nnORDER nnBY nnCity; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnList nnall nnthe nninformation nnin nnthe nnpatient's nntable nnsorted nnby nncity. SELECT nnLastName, nnBalance nnFROM nnPatient nnWHERE nnBalance>1000; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnList nnthe nnlast nnnames nnof nnpatients nnwhose nnbalance nnis nngreater nnthan nn$1,000.
True nn- nnWhen nnyou nnconnect nnsimple nnconditions nnusing nnthe nnAND nnoperator, nnall nnthe nnsimple nnconditions nnmust nnbe nntrue nnfor nnthe nncompound nncondition nnto nnbe nntrue? nnTrue nnor nnFalse? NOT nn- nnPreceding nna nncondition nnwith nnthe nn__________Operator nnreverses nnthe nnresult nnof nnthe nnoriginal nncondition LIKE nn- nnWhich nncondition nnuses nnwildcards nnto nnselect nnrows? IN nn- nnWhich nnCondition nnlets nnyou nndetermine nnwhether nna nnvalue nnis nnin nnsome nnspecific nncollection nnof nnvalues PROJECT nn- nnComplete nnthe nnfollowing nnstatement nnto nnlist nnthe nnemployee nnID, nnfirst nnname, nnand nnlast nnname nnof nnall nnemployees. _____EMPLOYEES nnOVER nn(EmployeeID, nnLastName, nnFirstName) nnGIVING nnAnswer TaskID nn= nn'CODE05' nn- nnComplete nnthe nnfollowing nnstatement nnto nnlist nnall nninformation nnfrom nnthe nnTaskMasterList nntable nnfor nntask nnID nnCODE05. SELECT nnTaskMasterListWHERE nn_____ nnGIVING nnAnswer Projects.ClientID nn= nnClients.ClientID nn- nnComplete nnthe nnfollowing nnstatements nnto nnlist nnthe nnproject nnID, nnproject nnstart nndate, nnclient nnID, nnand nnclient nnname nnfor nneach nnproject. JOIN nnProjects nnClients nnWHERE nn_____ nnGIVING nnTemp1PROJECT nnTemp1 nnOVER nn(ProjectID, nnProjectStartDate, nnClientID, nnClientName) nnGIVING nnAnswer JOIN nn- nnComplete nnthe nnfollowing nnstatements nnto nnlist nnthe nnproject nnID, nnproject nnstart nndate, nnclient nnID, nnand nnclient nnname nnfor nneach nnproject nncreated nnfor nnthe nnemployee nnwith nnthe nnlast nnname nnof nnWinter.
_____ nnProjects nnClients nnWHERE nnProjects.ClientID nn= nnClients.ClientID nnGIVING nnTemp1JOIN nnTemp nnClients nnWHERE nnTemp1.EmployeeID nn= nnEmployees.EmployeeID nnGIVING nnTemp2SELECT nnTemp nnWHERE nnEmployees.LastName nn= nn'Winter' nnGIVING nnTemp3PROJECT nnTemp3 nnOVER nn(ProjectID, nnProjectStartDate, nnClientID, nnClientName) nnGIVING nnAnswer WHERE nnClientID nn= nn 5 nn- nnComplete nnthe nnfollowing nnstatements nnto nnlist nnthe nnproject nnID nnand nnproject nnstart nndate nnof nnall nnprojects nnthat nnwere nnplaced nnby nnclient nnID nn5. JOIN nnProjects nnClients nnWHERE nnProjects.ClientID nn= nnClients.ClientID nnGIVING nnTemp1PROJECT nnTemp nnOVER nn(ProjectID, nnProjectStartDate, nnClientID) nnGIVING nnTemp2SELECT nnTemp2 nn_____ nnGIVING nnTemp3PROJECT nnTemp3 nnOVER nn(ProjectID, nnProjectStartDate) nnGIVING nnTemp UNION nn- nnComplete nnthe nnfollowing nnstatements nnto nnlist nnthe nnproject nnID nnand nnproject nnstart nndate nnof nnall nnprojects nnthat nnwere nncreated nnfor nnclient nnID nn 5 nnor nn6. JOIN nnProjects nnClients nnWHERE nnProjects.ClientID nn= nnClients.ClientID nnGIVING nnTemp1PROJECT nnTemp nnOVER nn(ProjectID, nnProjectStartDate, nnClientID) nnGIVING nnTemp2SELECT nnTemp2 nnWHERE nnClientID nn= nn 5 nnGIVING nnTemp3PROJECT nnTemp3 nnOVER nn(ProjectID, nnProjectStartDate) nnGIVING nnTemp4 nnSELECT nnTemp2 nnWHERE nnClientID nn= nn 6 nnGIVING nnTemp5PROJECT nnTemp5 nnOVER nn(ProjectID, nnProjectStartDate) nnGIVING nnTemp6_____ nnTemp5 nnWITH nnTemp6 nnGIVING nnAnswer SUBTRACT nn- nnComplete nnthe nnfollowing nnstatements nnto nnlist nnthe nnproject nnID nnand nnproject nnstart nndate nnof nnall nnprojects nnwith nna nnproject nnstart nndate nnof nn3/1/2020 nnbut nnnot nnfor nnclient nnID nn7. SELECT nnProjects nnWHERE nnProjectStartDate nn='3/1/2020' nnGIVING nnTemp1PROJECT nnTemp1 nnOVER nn(ProjectID, nnProjectStartDate) nnGIVING nnTemp2SELECT nnTemp2 nnWHERE nnClientID nn= nn 7 nnGIVING nnTemp3PROJECT nnTemp3 nnOVER nn(ProjectID, nnProjectStartDate) nnGIVING nnTemp4_____ nnTemp4 nnFROM nnTemp2 nnGIVING nnAnswer To nnanswer nnthe nnquestion nncorrectly, nnyou nnwould nnneed nnonly nnthe nnClasses nntable. nnIf nnyou nnused nnall nnthe nntables nnin nnthe nnquery nnand nnsome nnclasses nnhad nnnot nnbeen nnreserved, nnyou nnmight nnbe nnmissing nnsome nnof nnthat nnoutput. nn- nnSuppose nnyou nnwant nnto nnlist nninformation nnon nnall nnthe nnclasses nnthat nnPitt nnFitness nnoffers, nnincluding nnthe nnday nnof nnthe nnweek, nntime, nnlocation, nnand nnlength nnof nnclass. nnTo nndo nnthis, nnyou nncould nncreate nna nnquery. nnWhat nntable(s) nnshould nnyou nnadd nnto nnthe nnquery? nnIf nnyou nnuse nnonly nnthe nnClasses nntable nninstead nnof nnall nnthe nntables nntogether, nndoes nnit nnmake nna nndifference nnto nnthe nnoutput? nnWhat nnif nnsomeone nnhad nnnever nnreserved nna nnspecific nnclass?
CREATE nnTABLE nnTshirts nn(TshirtID nnTEXT(5), nnTshirtDescription nnTEXT(25), nnTshirtPrice nnCURRENCY); nn- nnPitt nnFitness nnis nnselling nna nnline nnof nnexercise nnclothing nnat nntheir nnthree nnlocations. nnAt nnthe nnbeginning nnof nnthis nnventure, nnthey nndecide nnto nnsell nnonly nnthree nntypes nnof nnt-shirts nnwith nnthe nnPitt nnFitness nnlogo: nntwo nnwomen's nnsizes nnand nnone nnmen's nnsize. nnHow nnwould nnyou nnuse nnSQL nnto nncreate nna nnnew nntable nnin nnthe nnPitt nnFitness nndatabase nnto nncapture nnthe nnline nnof nnt-shirts nnand nntheir nnretail nnprice? nnThis nnnew nntable nnwould nnbe nnused nnfor nnadvertising nnpurposes nnonly, nnso nnno nnquantity-on-hand nnfields nnare nnnecessary. SELECT nnCOUNT nn(TshirtID) nnAS nnNumberOfTshirts, nnSUM nn(TshirtPrice) nnAS nnTotalPriceOfTshirts nnFROM nnTshirts;. nn- nnWrite nnan nnSQL nnquery nnthat nnwould nnask nnthe nndatabase nnto nncount nnthe nnnumber nnof nndifferent nntypes nnof nnt-shirts nnavailable nnand nntotal nntheir nnprice. nnYour nnoutput nnshould nnshow nnonly nnthe nnfield nnnames: nnNumberOfTshirts nnTotalPriceOfTshirts. SELECT nn* nnFROM nnPatient nnORDER nnBY nnCity; nn- nnWrite nnthe nnSQL nncode nnfor nnthe nnfollowing: nnList nnall nnthe nninformation nnin nnthe nnpatient's nntable nnsorted nnby nncity. SELECT nn* nnFROM nnTherapies nnWHERE nnDescription nnLIKE nn"bath" nnOR nnDescription nnLIKE nn"hot" nnOR nnDescription nnLIKE nn"electrical"; nn- nnWrite nnan nnSQL nnquery nnthat nndisplays nnthe nntherapies nnand nntheir nnunit nnof nntime nnfor nnthe nntherapies nnthat nninclude nnthe nnword nnbath, nnhot, nnor nnelectrical. SELECT nnFirstName nn&" nn"& nnLastName nnAS nnFullName nnFROM nnTherapist nnWHERE nnNOT nnZipCode=72511; nn- nnWrite nnan nnSQL nnquery nnto nndisplay nnevery nntherapist's nnfirst nnname nnand nnlast nnname nnas nntheir nnfull nnname, nnbut nnonly nnfor nnthose nninstructors nnnot nnliving nnin nnzip nncode nn72511.