Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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]

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

explain what is meant by experiential learning

Answered: 1 week ago

Question

identify the main ways in which you learn

Answered: 1 week ago