CREATE TABLE Lives_in (stuid NUMBER, dormid NUMBER, room_number NUMBER)
CREATE TABLE Dorm_amenity (amenid NUMBER, amenity_name VARCHAR2)
CREATE TABLE Dorm (dormid NUMBER, dorm_name VARCHAR2, student_capacity NUMBER, gender VARCHAR2)
CREATE TABLE Student (StuID NUMBER, LName VARCHAR2, Fname VARCHAR2, Age NUMBER, Sex VARCHAR2, Major NUMBER, Advisor NUMBER, city_code VARCHAR2)
CREATE TABLE Has_amenity (dormid NUMBER, amenid NUMBER)

A bar chart for what are the number of the first names of all students in Smith Hall?, and rank by the total number in desc.
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) DESC
SELECT "Fname", COUNT("Fname") FROM "Student" "T1" JOIN "Lives_in" "T2" ON "T1"."stuid" = "T2"."stuid" JOIN "Dorm" "T3" ON "T2"."dormid" = "T3"."dormid" AND "T3"."dorm_name" = 'Smith Hall' GROUP BY "Fname" ORDER BY COUNT("Fname") DESC