1.3 Multi-condition filtering

 

Find records of students in class one whose math score is 90 or above from Scores table.

CLASS STUDENTID SUBJECT SCORE
Class one 1 English 84
Class one 1 Math 77
Class one 1 PE 69
Class one 2 English 81
Class one 2 Math 80

SPL script:

A
1 =connect(“db”)
2 =A1.query@x(“select * from Scores”)
3 =A2.select(SUBJECT=“Math” && CLASS=“Class one” && SCORE>=90)

A1 Connect to the database;
A2 Retrieve Scores table from the database;
A3 Get records of class one where math score is 90 or above. By default, select()returns all records meeting the specified condition. To return the first found eligible record only, use @1 option in select() function.