SQL Assignment
SQL Assignment
Statement: Write the following simple SQL Queries on the University Schema.
Find the names of all the students whose total credits are greater than 100 .
Find the course id and grades of all courses taken by any student named 'Tanaka'.
Find the ID and name of instructors who have taught a course in the Comp. Sci.
department, even if they are themselves not from the Comp. Sci. department. To test this
query, make sure you add appropriate data, and include the corresponding insert
statements along with your query.
Find the courses which are offered in both 'Fall' and 'Spring' semester (not necessarily in
the same year).
Optional:
Find the names of all the instructors from Comp. Sci. department.
Find the course id and titles of all courses taught by an instructor named 'Srinivasan'
Find names of instructors who have taught at least one course in Spring 2009.
Next Task:
Create the Railway schema using the commands in the Railway DDL script; the commands can
be copy-pasted into pgAdmin3. The DDL script also contains a description of the railway
Schema..
Insert sample data using the command in the file SampleRailwayData.
Try inserting more data into these tables. Refer to the populate script above for examples.
Statement : Write the following Queries for Railway Schema.
Find pairs of stations (station codes) that have a track (direct connection) with distance
less than 20Kms between them.
Find the IDs of all the trains which have a stop at THANE