Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 30 */
- select naam, soort, hoogte from planten p, soorten s where p.soortid=s.soortid and soort = 'water' order by hoogte
- /* 31 wel zonder kleuren want da lukt mij nie */
- select naam, soort, kleur, hoogte, bl_b
- from planten p, soorten s, kleuren k
- where p.soortid=s.soortid and p.kleurid=k.kleurid and bl_b < 8 and hoogte between 100 and 200 and soort not in ('boom', 'heester') and kleur in ('rood', 'blauw')
- order by soort, naam
- /* 32 */
- select soort, min(prijs) from soorten s, planten p where p.soortid=s.soortid and bl_b between 5 and 6 group by soort order by soort
- /* 33 */
- select distinct(soort), kleur from soorten s, planten p, kleuren k where p.kleurid=k.kleurid and p.soortid=s.soortid and kleur = 'rood'
- /* 34 */
- select soort, kleur, count(*) from planten p, soorten s, kleuren k where p.kleurid=k.kleurid and p.soortid= s.soortid group by soort, kleur
- /* 35 */
- select naam, count(o.artcode) from leveranciers l, offertes o where l.levcode=o.levcode and levertermijn <= 18 group by 1 order by 1
- /* 36 */
- select DATE_FORMAT(leverdatum, "%d/%m/%Y") as "leverdatum", bl.bestelnr, naam, sum(aantal) as "totaal aantal", sum(bl.aantal * bl.prijs) as "bedrag" from bestellingen b, leveranciers l, bestellijnen bl where bl.bestelnr=b.bestelnr and b.levcode=l.levcode group by 1, bl.bestelnr order by bl.bestelnr
- /* 37 */
- select distinct woonplaats from leveranciers l, soorten s, planten p, offertes o where o.levcode=l.levcode and o.artcode=p.artcode and p.soortid=s.soortid and soort= 'vast'
- /* 38 */
- select p.artcode, naam, min(offerteprijs), max(offerteprijs) from planten p, offertes o where p.artcode=o.artcode group by naam order by naam
- /* 39 */
- select bestelnr, date_format(leverdatum, '%d/%m/%Y'), besteldatum, bedrag, case when besteldatum > '2003-03-05' then 'te laat' else '' end as opmerking from bestellingen
- /* 40 */
- select l.naam, count(distinct(soortID)) as aantal from leveranciers l, offertes o, planten p where l.levcode=o.levcode and o.artcode=p.artcode group by naam order by aantal desc
- /* 41 */
- select l.naam, soort from leveranciers l, offertes o, planten p, soorten s where l.levcode=o.levcode and o.artcode=p.artcode and p.soortid=s.soortid group by naam, soort
- /* 42 fout */
- select p.naam, p.bl_b, pp.naam, pp.bl_b from planten p, planten pp, soorten s, soorten ss where p.soortid=s.soortid and pp.soortid=ss.soortid and s.soort='vast' and ss.soort='vast' and p.bl_b<pp.bl_b group by pp.naam order by p.bl_b
- /* 43 niet helemaal correct volgens resultset */
- select b.bestelnr, b.artcodelev, prijs - offerteprijs as verschil from offertes o, bestellijnen b, bestellingen bb where b.bestelnr=bb.bestelnr and bb.levcode=o.levcode group by bestelnr
- /* 44 */
- select bestelnr, b.levcode, l.naam, besteldatum from leveranciers l left join bestellingen b on b.levcode=l.levcode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement