When turning in a homework problem, mark it with the exercise number shown in bold here. These will be the reference numbers I use in reporting back your standing on the homework.
9.4.x1:
Write a function, using Oracle's PL/SQL, named CountyName
, which is passed a county ID as a parameter and returns the county's name as its result value. Your function should use the sos.counties
table. You can ignore the possibility that an invalid ID might be provided. If done correctly, the following query should produce a table of 45 rows, a few of which are shown after the query:
select precinct_name, countyname(county_id) from sos.precincts where legislative_district = '23A'; PRECINCT_NAME COUNTYNAME(COUNTY_ID) ------------------------------------ --------------------- BELGRADE TOWNSHIP NICOLLET BERNADOTTE TOWNSHIP NICOLLET . . . ST PETER W-2 P-2 NICOLLET TRAVERSE TOWNSHIP NICOLLET WEST NEWTON TOWNSHIP NICOLLET ALFSBORG TWP. SIBLEY . . . WINTHROP CITY SIBLEY
9.6.x1: On one of the MCS Department's Linux machines, compile and run the attached ListParties JDBC program, following the instructions at the top of that file. As it stands, it shouldn't produce any output (but also shouldn't produce any error messages). Start by extending it to print the parties' full names, retrieved from the sos.parties
table, and then once that works, have it produce the same kind of output as the example PL/SQL procedure; that output is shown here:
02: Independence 03: Republican 04: Democratic-Farmer-Labor 05: Green 06: Socialist Workers 08: Independent 09: Libertarian, Better Life 10: Constitution 23: IVOTEMN.net 31: Moderate Independent Party 90: Nonpartisan 99: Write-In
Instructor: Max Hailperin