Mis Homework 4
Mis Homework 4
#Question 2-List City names where Student or Faculty live. Name the column
AS City.
txt='''
Select StdCity AS City
From Student
UNION
Select FacCity AS City
From Faculty
'''
Q2 = psql.sqldf(txt)
Q2
#Question 3-List City names where both Student and Faculty live in .
txt='''
Select StdCity AS City
From Student
INTERSECT
Select FacCity AS City
From Faculty
'''
Q3 = psql.sqldf(txt)
Q3
#Question 4-List City names where Student lives but Faculty does not
live in .
txt='''
Select StdCity AS City
From Student
EXCEPT
Select FacCity AS City
From Faculty
'''
Q4 = psql.sqldf(txt)
Q4
#Question 5-List City names where Faculty lives but Student does not live
in .
txt='''
Select FacCity AS City
From Faculty
EXCEPT
Select StdCity AS City
From Student
'''
Q5 = psql.sqldf(txt)
Q5
'''
Q7 = psql.sqldf(txt)
Q7
##Query 11-Get All student related information of student with lowest GPA.
txt='''
Select *
From Student
Order by StdGPA ASC
Limit 1 Offset 0
'''
Q11 = psql.sqldf(txt)
Q11