");
String id = kysimus.getParameter("id");
String paring = "SELECT * FROM vaprad WHERE id=" + id + ";";
ResultSet rs=st.executeQuery(paring);
rs.next();
String laul = rs.getString("laul");
String paring1 = "SELECT COUNT(*) as viisi FROM vaprate_hinded WHERE hinne=5 AND laulu_id=" + id + ";";
ResultSet viis=st.executeQuery(paring1);
viis.next();
int viisi = viis.getInt("viisi");
String paring2 = "SELECT COUNT(*) as nelju FROM vaprate_hinded WHERE hinne=4 AND laulu_id=" + id + ";";
ResultSet neli=st.executeQuery(paring2);
neli.next();
int neljasi = neli.getInt("nelju");
String paring3 = "SELECT COUNT(*) as kolmi FROM vaprate_hinded WHERE hinne=3 AND laulu_id=" + id + ";";
ResultSet kolm=st.executeQuery(paring3);
kolm.next();
int kolmesi = kolm.getInt("kolmi");
String paring4 = "SELECT COUNT(*) as kahtesi FROM vaprate_hinded WHERE hinne=2 AND laulu_id=" + id + ";";
ResultSet kaks=st.executeQuery(paring4);
kaks.next();
int kahtesi = kaks.getInt("kahtesi");
String paring5 = "SELECT COUNT(*) as yhtesi FROM vaprate_hinded WHERE hinne=1 AND laulu_id=" + id + ";";
ResultSet yks=st.executeQuery(paring5);
yks.next();
int yhtesi = yks.getInt("yhtesi");
String paring6 = "SELECT AVG(hinne) as keskmine from vaprate_hinded WHERE laulu_id = " + id + ";";
ResultSet avg=st.executeQuery(paring6);
avg.next();
double keskmine = avg.getDouble("keskmine");
keskmine = keskmine * 100;
keskmine = (int)keskmine;
keskmine = keskmine / 100;
String paring7 = "SELECT COUNT(*) as kokku FROM vaprate_hinded WHERE laulu_id=" + id + ";";
ResultSet sum=st.executeQuery(paring7);
sum.next();
int kokku = sum.getInt("kokku");
cn.close();
out.println("