Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Python] get_students: This function takes a connection object to a student database (like the one we've been working with), a table name, and a grade

[Python] get_students: This function takes a connection object to a student database (like the one we've been working with), a table name, and a grade and returns a list of all of the student names in sorted order who received that grade in that table. Student names should be in format "last, first".

Here is test file

def test_get_students(self):

ista_130_f17_A = ['Beseboc, Chris', 'Bifedok, Alyssa', 'Burapev, Brian', 'Darefir, Parker',

'Dotasak, Zach', 'Drebegan, Scott', 'Drimaliz, Dingbo', 'Fipugax, Anmol', 'Gahejov, Vamsee',

'Gufunoz, Bri', 'Herorab, Daniyal', 'Hixawez, Matthew', 'Kariraw, Josh', 'Nafusut, Matt',

'Netiwom, Brandon', 'Noqalux, Chi', 'Peyufod, Yao', 'Pikuber, Isaac', 'Ragoziz, Brandon',

'Roruvor, Brian', 'Roxawos, Robbie', 'Sagadot, Bailie', 'Scafonis, Gordon', 'Stibolar, Hongzhi',

'Suwarij, Fengyi', 'Virabus, Christopher', 'Visigob, Jonah', 'Xaruliy, Jessie', 'Xokezer, Jorge',

'Yetazec, Jonathan']

ista_350_s15_R = ['Celukih, Felicia', 'Cozitik, Christian', 'Fogukoq, Cassidee', 'Gizoqof, Victor',

'Hutexav, Kelly', 'Jorevem, Haodong', 'Tikedax, Brennen', 'Toqoxiy, Matthew', 'Toyenad, Happy',

'Yuwuroh, Alan', 'Zufayod, Garrett']

conn = sqlite3.connect('classes_redacted.db')

self.assertEqual(ista_130_f17_A, get_students(conn, 'ISTA_130_F17', 'A'))

self.assertEqual(ista_350_s15_R, get_students(conn, 'ISTA_350_S15', 'R'))

self.assertEqual([], get_students(conn, 'ISTA_131_F17', 'T'))

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

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago