03.partie (822B)
1 pseudo-parameter : $taille_nuage 2 3 // select random node 4 select eid from node where eid = (abs(random()) % (select max(eid) from node))+1 or eid = (select max(eid) from node where eid > 0) order by eid desc limit 1; 5 6 Difficulté 1 : 7 // select neighbors 1 hop 8 select end from relation where start = 42 limit $taille_nuage; 9 10 Difficulté 2 : 11 // select neighbors 2 hops 12 select * from relation where start in (select end from relation where start = 42) limit $taille_nuage; 13 14 Difficulté 3 : 15 // select neighbors relative to the end (one hop start->end, one hop start<-end). 16 select * from relation where end in (select end from relation where start = 42) and type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) limit $taille_nuage; 17 18 // Pour compléter : 19 // select random words 20 do "select random node" $taille_nuage times 21