Sample for CSE3330 Spring 2024

Query1:

English query: List name and city of all the golf courses.

SQL: SELECT Name, City FROM Courses

Query2:

English query: List course name, play date, and score among the rounds if the score is less than #score.

SQL: select playstarttime, courses.name, score from courses inner join rounds on courses.gcid = rounds.courseID where score < #score

Query3:

English query: List course name, play date, and score among the rounds if the score is less than #score. by the decreasing/increasing order of score.

SQL: select playstarttime, courses.name, score from courses inner join rounds on courses.gcid = rounds.courseID where score < #score order by score desc

Decreasing Increasing