Question: [PYTHON] A students: This function takes a connection object, a table name with default value ISTA 131 F17, a class standing string with default value

[PYTHON]

[PYTHON] A students: This function takes a connection object, a table name

A students: This function takes a connection object, a table name with default value "ISTA 131 F17", a class standing string with default value None, and a maximum number of results to return with default value 10. This function returns a list containing the names of the students that got A's up to the specified maximum number (it may be less if there aren't that many in the table) in the format "last, first". If the class argument is None, take the students from the whole table, otherwise just from students with the specified class standing. Your query should be case insensitive regarding the class standing. Within in the group, sort on the names. Don't pull all of the data into Python and then do the logic there, do it with properly constructed queries. You may have two queries, one that executes if class standing is None; the other if it is either 'freshman', 'sophomore', etc. Here is something to get you started: make 2 queries and pick which one to use depending on whether a standing was passed c.execute (query) return [row[0] for row in c.fetchall()] A students: This function takes a connection object, a table name with default value "ISTA 131 F17", a class standing string with default value None, and a maximum number of results to return with default value 10. This function returns a list containing the names of the students that got A's up to the specified maximum number (it may be less if there aren't that many in the table) in the format "last, first". If the class argument is None, take the students from the whole table, otherwise just from students with the specified class standing. Your query should be case insensitive regarding the class standing. Within in the group, sort on the names. Don't pull all of the data into Python and then do the logic there, do it with properly constructed queries. You may have two queries, one that executes if class standing is None; the other if it is either 'freshman', 'sophomore', etc. Here is something to get you started: make 2 queries and pick which one to use depending on whether a standing was passed c.execute (query) return [row[0] for row in c.fetchall()]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!