Q1) 1) SELECT title FROM playin GROUP BY playin.title HAVING count(*)>3; title EuroTrip From Hell Safe Siblings 2) SELECT title FROM playin, movie WHERE playin.first_name='Tom' And playin.last_name='Cruise' And movie.type='M' And movie.year>1996 And movie.name=playin.title; title EuroTrip Junket Whore 3) SELECT first_name, last_name FROM playin GROUP BY first_name, last_name HAVING count(*) >= all (SELECT count(*) from playin group by first_name, last_name); first_name last_name Dodo Abashidze 4) SELECT DISTINCT (Title) FROM playin WHERE first_name&last_name in (select first_name&last_name from playin where Title='Eurotrip') and not Title = 'Eurotrip'; Title From Hell Junket Whore Legend 5) SELECT title FROM playin WHERE not playin.title = 'Eurotrip' and playin.first_name in (select first_name FROM playin WHERE title = 'Eurotrip') GROUP BY title HAVING count(title) > 1; Title From Hell Q2) K-d trees: Spatial Join Spatial join for nodes within distance 1 1. -77340390, 39153210 -77340390, 39153211 2. -77221913, 39261987 -77221914, 39261987 3. -77217040, 39270456 -77217040, 39270457 Spatial join for nodes within distance 10 1. -76996083, 39040774 -76996086, 39040772 2. -77372289, 39101984 -77372298, 39101981 3. -77075400, 39111500 -77075407, 39111494 4. -77040596, 39115807 -77040600, 39115800 5. -77340390, 39153210 -77340390, 39153211 6. -77013777, 39156738 -77013783, 39156738 7. -77118530, 39165370 -77118532, 39165368 8. -77201800, 39172890 -77201800, 39172900 9. -77247200, 39175000 -77247206, 39174996 10. -77247177, 39174965 -77247179, 39174964 11. -77216093, 39182692 -77216096, 39182689 12. -77292168, 39200594 -77292176, 39200589 13. -77284695, 39230896 -77284700, 39230900 14. -77221913, 39261987 -77221914, 39261987 15. -77217040, 39270456 -77217040, 39270457 Spatial join for nodes within distance 20 1. -77114675, 39035620 -77114675, 39035631 2. -76996083, 39040774 -76996086, 39040772 3. -77241200, 39097900 -77241209, 39097893 4. -77372289, 39101984 -77372300, 39102000 5. -77372298, 39101981 -77372311, 39101996 6. -77372298, 39101981 -77372300, 39102000 7. -77372289, 39101984 -77372298, 39101981 8. -77372300, 39102000 -77372311, 39101996 9. -77473000, 39103600 -77472990, 39103604 10. -77318600, 39110400 -77318602, 39110390 11. -77075400, 39111500 -77075407, 39111494 12. -77040596, 39115807 -77040600, 39115800 13. -77204789, 39126205 -77204800, 39126200 14. -77161137, 39128901 -77161145, 39128908 15. -77161145, 39128908 -77161154, 39128916 16. -77238177, 39145442 -77238172, 39145452 17. -77340390, 39153210 -77340390, 39153211 18. -77262213, 39155483 -77262220, 39155467 19. -77013777, 39156738 -77013783, 39156738 20. -77170500, 39162400 -77170510, 39162385 21. -77190595, 39162986 -77190600, 39163000 22. -77118530, 39165370 -77118532, 39165368 23. -77201800, 39172890 -77201800, 39172900 24. -77247200, 39175000 -77247206, 39174996 25. -77247177, 39174965 -77247179, 39174964 26. -77216093, 39182692 -77216096, 39182689 27. -77297081, 39190089 -77297088, 39190100 28. -77292168, 39200594 -77292176, 39200589 29. -77277782, 39208007 -77277800, 39208000 30. -77284695, 39230896 -77284700, 39230900 31. -77203089, 39253501 -77203100, 39253500 32. -77221913, 39261987 -77221914, 39261987 33. -77217040, 39270456 -77217040, 39270457 34. -77202284, 39283596 -77202300, 39283600 Counts for 2D.txt Distance=1 Count=3 Distance=10 Count=15 Distance=20 Count=34 Distance=50 Count=103 Distance=100 Count=504 Distance=200 Count=1353 Counts for 3D.txt Distance=1 Count=3 Distance=10 Count=2626 Distance=20 Count=20697 Distance=50 Count=318080 Distance=100 Count=2475498 Distance=200 Count=18696653 Q3) Plot available at: http://www.cs.cmu.edu/~kaustav/15826/hw1/rtree_plot.JPG Number of Nodes in Level 1: 33 Number of Nodes in Level 2: 947