Question 9 2 pts Given the following Python code: import pandas as pd a = pd.read_csv ("appointments.csv") b = pd.read_csv ("medical centres.csv") c = pd.merge(a, b, how='inner', on='cid') c[ c['centre'] == 'Sydney Medical Centre'] smc.sort_values (by=['date'], ascending=False) smc = Assume the input CSV data would have been stored in relational tables of the same schema. What would be an equivalent SQL query producing the same output than the given Python/Pandas code?
SELECT cid FROM Appointments MERGE MedicalCentres WHERE centre='Sydney Medical Centre' * SELECT FROM Appointments INNER JOIN Medical Centres ON (cid) ORDER BY date DESC * SELECT FROM Appointments NATURAL JOIN Medical Centres WHERE centre='Sydney Medical Centre' ORDER BY date ASC SELECT centre FROM Appointments INNER JOIN Medical Centres USING (cid) WHERE 'centre' = 'Sydney Medical Centre' SORT BY date ASC SELECT * FROM Appointments NATURAL JOIN Medical Centres WHERE centre='Sydney Medical Centre' ORDER BY date DESC
Question 9 2 pts Given the following Python code: import pandas as pd a = pd.read_csv ("appointments.csv") b = pd.read_c
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am