Untitled

This is another SQL demo that illustrates the process of designing tables and creating complex SELECT statements from those tables to get different views of the data. The primary table we want to create is as follows:

name email github courses
Greg D. Benson [email protected] @gdbenson CS 315, CS 326
David Guy Brizan [email protected] @dbrizan CS 245, CS 463
Christopher Brooks [email protected] CS 462
Mehmet Emre [email protected] @maemre CS 345, CS 414
Sophie J. Engle [email protected] @sjengle CS 186, CS 272, CS 360
Alark Joshi [email protected] @alark CS 110, CS 112, CS 360, CS 480
EJ Jung [email protected] CS 112, CS 221, CS 245
Olga Karpenko [email protected] @okarpenko CS 112, CS 245, CS 272, CS 490
Michael C. Kremer [email protected] CS 110, CS 386
Matthew Malensek [email protected] @malensek CS 220, CS 326
Phil Peterson [email protected] @phpeterson-usf CS 221, CS 272, CS 315
Vahab Pournaghshband [email protected] @vhbsoft CS 221, CS 336
Kelsey Urgo [email protected] @kelseyurgo CS 110, CS 486
Ellen Veomett [email protected] @eveomett CS 245
David Wolber [email protected] @wolberd CS 107, CS 110, CS 112
Beste F. Yuksel [email protected] CS 107, CS 110, CS 490

Before viewing the rest of this demonstration, see if you can determine the tables and columns that should be created first.

Following Along

If you do not want to copy/paste the commands for this example, they can be found in the sql subdirectory of the cs272 public folder on the lab computers.

For example, you can create the tables and insert the rows for this example by doing:

SOURCE /home/public/cs272/sql/faculty.sql

To double check this created the necessary tables, do:

SHOW TABLES;

The other faculty_????.sql files contain the various SELECT statements from this demonstration.

Next Steps

The next step is to create the underlying tables in the database. Click the link below to get started.

<aside> <img src="/icons/arrow-right_gray.svg" alt="/icons/arrow-right_gray.svg" width="40px" /> Next: Creating Faculty Tables

</aside>