You are on page 1of 2

STATION STATISTICS

Create a table to store information about weather observation stations with the following columns. STATION TABLE: I Number(3) CIT! varchar(25) STATE Varchar(10) LAT"N Number(4) LON#"$ number(4)

create another table %STATISTICS % to store normali&e' tem(erature an' (reci(itation 'ata I Number(3) )ONT* Varchar (15) TE)+", Number(10,2) -AIN"I Number(10,2)

-- ID field must match s me !"#"I$N table ID -- n du%licate ID and &$N"' c mbinati ns( -- tem%erature is in de)rees *ahrenheit -- rainfall is in inches( + %ulate the tables ,ith the bel , dataSTATION TABLE

CIT! 13 ".I/'0 44 /$I&3#"$.4 55 /'4NN#I 55 +$NDI/'4..0 12 3#N8#1$.4

STATE "#&I1N#D2 "#&I1N#D2 "#&I1N#D2 +$NDI/'4..0 9#.N#"#9#

LAT"N 33 40 46 32 3:

LON#"$ 112 105 57 56 73

STATISTICS TABLE

I 13 13 44 44 55 55 55

)ONT* ;anuar< N vember ;anuar< N vember ;anuar< N vember &arch

TE)+", 56(4 :1(6 26(3 64(7 5(6 55(7 6:(3

-AIN"I 0(31 5(15 0(17 2(11 2(1 4(52 1(2

Use the above tables to formulate SQL queries for the following : )L: 1( =uer< t sh , &#> and &IN tem%eratures as ,ell as avera)e rainfall f r each stati n 2( Dis%la< all the stati n ,h se N rthern latitude ? 3: 3( =uer< t select nl< ID, /I"0, and !"#"4 c lumns in descendin) rder based n 1#"@N and 1$N8@A 4( Dis%la< ID, 1#"@N and 1$N8@N f r the /I"0 ,ith startin) letter B/B( 5( Dis%la< the l cati n ,here the 1$N8@A is fr m 60 t 110( 5( *ind the t tal am unt f rainfall in the m nth f N vember( 6( *ind the #vera)e tem%erature in ;anuar<( 7( =uer< t l C at table !"#"I!"I/!, %icCin) u% l cati n inf rmati n b< D inin) ,ith table !"#"I$N n the ID c lumn :( 2%date ne r ,, /hennaiBs &arch tem%erature readin), t c rrect a data entr< err r L: 1( #dd a ne, c lumn named +IN/$D4 t the table !"#"I$N ,ith data t<%e f number and len)th 2 2( Increase the siEe f the +IN/$D4 t 5 3( Dr % the table !"#"I!"I/!

You might also like