preview

Part 2 Is3280 Data Management Answers

Satisfactory Essays

TEST 2 – Part 2: IS3280 Data Management – SQL

Name:______________________________________________________

Use the tables listed at the end of this document to answer the following questions. Please submit both the question and the SQL statement for that question. You may simply edit this document by adding your answers below each question.

Submit via D2L. Name the file yourlastnameExam1Part2 [ie murrayexam2part2.docx].

There are 15 questions – Questions 1-9 are worth 3 pts; questions 9-14 are worth 4 pts and Question 15 is worth 5 points.

SQL Commands
After each question, construct the SQL statement that answers the question. When specific attributes are not asked for, you may choose which attributes you wish to display.

1) What basic information do we have about the candidates? Sort by position. …show more content…

Select Zipcode from district where district.state= Georgia

3) On what date(s) were early votes cast? -- No Duplicates

Select dateofvote from vote order by DateOfVote desc

4) List the congressional districts that end in 01 (zero one).

Select county, dateofvote from candidate join district on candidate.CDid= district. CDid join vote on candidate.candidateid = vote.candidateid where dateofvote < 01;

5) What is the age of the oldest candidate running? Select lastname, fistname, max(age) as oldestAge from candidate

6) How many of each type of ballot was cast?

Select count(voteID) from vote group by TypeOfBalot

7) List the candidates [by name and position] who are affiliated with the Blue, Red or Orange parties [use the IN keyword].

Select FirstName, lastname Position from candidate where party afficliation IN (Blue,

Get Access