
CREATE TABLE "Activity" (
	actid INTEGER, 
	activity_name VARCHAR(25), 
	PRIMARY KEY (actid)
)


CREATE TABLE "Faculty" (
	"FacID" INTEGER, 
	"Lname" VARCHAR(15), 
	"Fname" VARCHAR(15), 
	"Rank" VARCHAR(15), 
	"Sex" VARCHAR(1), 
	"Phone" INTEGER, 
	"Room" VARCHAR(5), 
	"Building" VARCHAR(13), 
	PRIMARY KEY ("FacID")
)


CREATE TABLE "Faculty_Participates_in" (
	"FacID" INTEGER, 
	actid INTEGER, 
	FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), 
	FOREIGN KEY(actid) REFERENCES "Activity" (actid)
)


CREATE TABLE "Participates_in" (
	stuid INTEGER, 
	actid INTEGER, 
	FOREIGN KEY(stuid) REFERENCES "Student" ("StuID"), 
	FOREIGN KEY(actid) REFERENCES "Activity" (actid)
)


CREATE TABLE "Student" (
	"StuID" INTEGER, 
	"LName" VARCHAR(12), 
	"Fname" VARCHAR(12), 
	"Age" INTEGER, 
	"Sex" VARCHAR(1), 
	"Major" INTEGER, 
	"Advisor" INTEGER, 
	city_code VARCHAR(3), 
	PRIMARY KEY ("StuID")
)

CREATE TABLE "Activity" (
	actid INTEGER, 
	activity_name VARCHAR(25), 
	PRIMARY KEY (actid)
)

/*
2 rows from Activity table:
actid	activity_name
770	Mountain Climbing
771	Canoeing
*/


CREATE TABLE "Faculty" (
	"FacID" INTEGER, 
	"Lname" VARCHAR(15), 
	"Fname" VARCHAR(15), 
	"Rank" VARCHAR(15), 
	"Sex" VARCHAR(1), 
	"Phone" INTEGER, 
	"Room" VARCHAR(5), 
	"Building" VARCHAR(13), 
	PRIMARY KEY ("FacID")
)

/*
2 rows from Faculty table:
FacID	Lname	Fname	Rank	Sex	Phone	Room	Building
1082	Giuliano	Mark	Instructor	M	2424	224	NEB
1121	Goodrich	Michael	Professor	M	3593	219	NEB
*/


CREATE TABLE "Faculty_Participates_in" (
	"FacID" INTEGER, 
	actid INTEGER, 
	FOREIGN KEY("FacID") REFERENCES "Faculty" ("FacID"), 
	FOREIGN KEY(actid) REFERENCES "Activity" (actid)
)

/*
2 rows from Faculty_Participates_in table:
FacID	actid
1082	784
1082	785
*/


CREATE TABLE "Participates_in" (
	stuid INTEGER, 
	actid INTEGER, 
	FOREIGN KEY(stuid) REFERENCES "Student" ("StuID"), 
	FOREIGN KEY(actid) REFERENCES "Activity" (actid)
)

/*
2 rows from Participates_in table:
stuid	actid
1001	770
1001	771
*/


CREATE TABLE "Student" (
	"StuID" INTEGER, 
	"LName" VARCHAR(12), 
	"Fname" VARCHAR(12), 
	"Age" INTEGER, 
	"Sex" VARCHAR(1), 
	"Major" INTEGER, 
	"Advisor" INTEGER, 
	city_code VARCHAR(3), 
	PRIMARY KEY ("StuID")
)

/*
2 rows from Student table:
StuID	LName	Fname	Age	Sex	Major	Advisor	city_code
1001	Smith	Linda	18	F	600	1121	BAL
1002	Kim	Tracy	19	F	600	7712	HKG
*/
What are the rank, first name, and last name of the faculty members?
SELECT rank ,  Fname ,  Lname FROM Faculty
[{'Rank': 'Instructor', 'Fname': 'Mark', 'Lname': 'Giuliano'}, {'Rank': 'Professor', 'Fname': 'Michael', 'Lname': 'Goodrich'}, {'Rank': 'Professor', 'Fname': 'Gerald', 'Lname': 'Masson'}, {'Rank': 'AssocProf', 'Fname': 'Thordur', 'Lname': 'Runolfsson'}, {'Rank': 'Professor', 'Fname': 'Daniel', 'Lname': 'Naiman'}, {'Rank': 'Instructor', 'Fname': 'Stacey', 'Lname': 'Jones'}, {'Rank': 'Professor', 'Fname': 'Frederic', 'Lname': 'Davidson'}, {'Rank': 'Professor', 'Fname': 'William', 'Lname': 'Brody'}, {'Rank': 'Professor', 'Fname': 'Gerard', 'Lname': 'Meyer'}, {'Rank': 'AsstProf', 'Fname': 'David', 'Lname': 'Yarowsky'}, {'Rank': 'Professor', 'Fname': 'Edward', 'Lname': 'Scheinerman'}, {'Rank': 'AsstProf', 'Fname': 'Carey', 'Lname': 'Priebe'}, {'Rank': 'Professor', 'Fname': 'James', 'Lname': 'Fill'}, {'Rank': 'Professor', 'Fname': 'Alan', 'Lname': 'Goldman'}, {'Rank': 'AssocProf', 'Fname': 'Scott', 'Lname': 'Smith'}, {'Rank': 'Instructor', 'Fname': 'Joanne', 'Lname': 'Houlahan'}, {'Rank': 'Professor', 'Fname': 'Luigi', 'Lname': 'Burzio'}, {'Rank': 'AsstProf', 'Fname': 'Robert', 'Lname': 'Frank'}, {'Rank': 'Instructor', 'Fname': 'Louis', 'Lname': 'Beach'}, {'Rank': 'AsstProf', 'Fname': 'Cheng', 'Lname': 'Cheng'}, {'Rank': 'Professor', 'Fname': 'Alexander', 'Lname': 'Kaplan'}, {'Rank': 'Instructor', 'Fname': 'William', 'Lname': 'Byrne'}, {'Rank': 'Professor', 'Fname': 'Shih-Ping', 'Lname': 'Han'}, {'Rank': 'Professor', 'Fname': 'Paul', 'Lname': 'Smolensky'}, {'Rank': 'AsstProf', 'Fname': 'Pablo', 'Lname': 'Iglesias'}, {'Rank': 'Professor', 'Fname': 'John', 'Lname': 'Goutsias'}, {'Rank': 'Professor', 'Fname': 'Wilson', 'Lname': 'Rugh'}, {'Rank': 'Professor', 'Fname': 'Frederick', 'Lname': 'Jelinek'}, {'Rank': 'Professor', 'Fname': 'Charles', 'Lname': 'Westgate'}, {'Rank': 'Professor', 'Fname': 'Baruch', 'Lname': 'Awerbuch'}, {'Rank': 'Professor', 'Fname': 'Russell', 'Lname': 'Taylor'}, {'Rank': 'AsstProf', 'Fname': 'Eric', 'Lname': 'Brill'}, {'Rank': 'AsstProf', 'Fname': 'Lancelot', 'Lname': 'James'}, {'Rank': 'Instructor', 'Fname': 'Ellie', 'Lname': 'Angelopoulou'}, {'Rank': 'Professor', 'Fname': 'Howard', 'Lname': 'Weinert'}, {'Rank': 'Professor', 'Fname': 'John', 'Lname': 'Wierman'}, {'Rank': 'AsstProf', 'Fname': 'Subodh', 'Lname': 'Kumar'}, {'Rank': 'AssocProf', 'Fname': 'Lawrence', 'Lname': 'Wolff'}, {'Rank': 'AsstProf', 'Fname': 'Gert', 'Lname': 'Cauwenberghs'}, {'Rank': 'Professor', 'Fname': 'Andreas', 'Lname': 'Andreou'}, {'Rank': 'AssocProf', 'Fname': 'Steven', 'Lname': 'Salzberg'}, {'Rank': 'AsstProf', 'Fname': 'Lenore', 'Lname': 'Cowen'}, {'Rank': 'Professor', 'Fname': 'Michael', 'Lname': 'McCloskey'}, {'Rank': 'AsstProf', 'Fname': 'Yair', 'Lname': 'Amir'}, {'Rank': 'AsstProf', 'Fname': 'Michael', 'Lname': 'Brent'}, {'Rank': 'AsstProf', 'Fname': 'Brenda', 'Lname': 'Rapp'}, {'Rank': 'Professor', 'Fname': 'Rao', 'Lname': 'Kosaraju'}, {'Rank': 'AssocProf', 'Fname': 'Oliver', 'Lname': 'Collins'}, {'Rank': 'AssocProf', 'Fname': 'Brian', 'Lname': 'Hughes'}, {'Rank': 'Professor', 'Fname': 'Richard', 'Lname': 'Joseph'}, {'Rank': 'Professor', 'Fname': 'Jacob', 'Lname': 'Khurgin'}, {'Rank': 'AssocProf', 'Fname': 'Jerry', 'Lname': 'Prince'}, {'Rank': 'AssocProf', 'Fname': 'Geraldine', 'Lname': 'Legendre'}, {'Rank': 'AsstProf', 'Fname': 'Colin', 'Lname': 'Wu'}, {'Rank': 'Professor', 'Fname': 'Jong-Shi', 'Lname': 'Pang'}, {'Rank': 'Instructor', 'Fname': 'Robert', 'Lname': 'Glaser'}, {'Rank': 'Instructor', 'Fname': 'Arthur', 'Lname': 'Delcher'}, {'Rank': 'AsstProf', 'Fname': 'Leslie', 'Lname': 'Hall'}]