CPSC 350

  • Syllabus
  • Office
  • Readings
  • Sheets
  • Levels
  • XP
  • Scoreboard
  • Class canceled; office hours virtual today

    Sorry guys! I just got back from Richmond. Plan B it is.

    Today’s class (both sections) is canceled, and I will be having Office Hours virtually (over Zoom) at the usual time (12-2pm). See the Canvas page for the Zoom link (which is the same Zoom link as always).

    See everybody in person on Wednesday!

    Mar 9
  • Monday’s class

    Plan A is to have class on time on Monday morning as usual (10am).

    There’s a 30% chance that I’ll be running late, since I have an early morning doctors appointment in Richmond. I think I’ve allowed enough time for it, but just in case traffic or other woes come into play, I might be running a bit late.

    So Plan B is: if I’m not there at the start of class, you should wait for me up to 15 minutes. If I don’t show my lovely face by 10:15, class will be canceled that day. But do please wait until 10:15 if I’m not there at the start.

    Mar 7
  • Accessing the galactic database

    Just to be clear, for assignment #4 you do not have to have MariaDB client running on your laptop. And you certainly do not (and should not) have an instance of the MariaDB DBMS server running on your laptop!

    Instead, you should follow this two-step process to poke around and inspect the galactic database:

    1. Log on to the cpsc.umw.edu server, however you do that (PuTTy, ssh, etc.)
    2. On the cpsc.umw.edu command line, type:

      cpsc$ mariadb -u theSecretUsername -ptheSecretPassword

      and voila, you’re in. (Substitute the actual username and the actual password for those placeholders, of course. And don’t forget: there is no space between the “-p” and the password!)

    The only MariaDB-ish installation required for assignment #4 is the mariadb Python package, which you can install using pip:

    yourLaptop$ pip install mariadb

    This is required not to simply explore the database, but rather for your Python code to access it.

    Send email with any questions!

    Mar 5
  • Spot checking assignment #4

    Here are some checks to confirm that you did assignment #4 correctly:

    1. You should have exactly 42 pilots in your database (this includes the five from assignment #2).

      • Exactly nine of these pilots should be certified to fly the Millenium Falcon.
      • Four pilots should be certified to fly a colonial Viper.
      • Only two pilots should be certified on the U.S.S. Enterprise.
    2. There should be exactly ten regularly scheduled flights servicing planet Vulcan, either departing from, or arriving at, that planet.
    3. The earliest flight (where “earliest” means “the earliest date”) to Centauri Prime in your database should have had exactly 51 passengers, while the latest flight to this planet has only 5 so far.
    4. Exactly one of the scheduled flights should be sold out. The other 600 scheduled flights should have (or did have, at the time) tickets still available for purchase. (Note that this 600 figure includes the five flights scheduled in assignment #2.)


    If all these check out, I think it’s pretty darn likely that your bulk import was successful.

    Mar 4
  • Intergalactic airport abbreviations

    The flightplans table only has names of planets, not airports. You can overcome this mismatch by assigning your own reasonable three-letter airport codes to planets. (For example, using “DGB” for “Dagobah airport” would be acceptable.)

    Mar 4
  • Quiz #3 posted!

    Quiz #3 has been posted to Canvas, and is due Tuesday, March 10th at midnight. It is open book, open notes, closed other humans, closed AI, closed SQL, closed Python, and timed at 60 minutes. Good luck!

    Feb 25
  • Bulk import example code posted

    From today’s (and Monday’s) class, the bulk import example code for:

    • the 10am’ers
    • the 2pm’ers
    Feb 25
  • Assignments 4 and 5 posted!

    Assignments #4 and #5 have been posted! They are both due Thursday March 12th at midnight. You can do them in either order, but be advised that procrastination is doubly important in this case! Start both of them early and often.

    Feb 25
  • XP ca$h out

    If you’d like to cash in your XP cards mid-semester, there will be one opportunity to do so: Wednesday’s class (2/25). To redeem these, your XP cash must be:

    • Stapled together with a staple, using a stapler.
    • Have your name clearly printed on the back of the bottom-most card in the stack.
    • Have the sum total of the XP also written on the back of the bottom-most card (so I don’t have to count).

    You may hand me your stapled (using a stapler) stack of cards on Wednesday, and I will put your points up on the scoreboard over spring break. If you don’t do this on Wednesday, there is no penalty; you can just hold on to your cards until the final exam, and turn them all in then.

    Feb 23
  • Halloween query solutions posted

    Here are my solutions to the Halloween activity.

    Feb 23
  • Tuesday’s (tomorrow’s) office hours

    I’m going to see a specialist tomorrow morning about my back pain, and so might be late to my office hours. I’ll get there as soon as I can!

    Feb 23
  • All systems go!

    Class will be in person, on campus, at the usual time tomorrow. Dress warm!

    Feb 23
  • “the current date”

    To get the current date in Python, the best tool is the datetime package. Here’s a demo:


    from datetime import date
    today = date.today()
    valentines_day = date(2026, 2, 14)
    if valentines_day < today: print("Valentine's Day already happened.") elif valentines_day > today:
    print("Valentine's Day is coming up!")
    else:
    print("Valentine's Day is TODAY!!! (Hope you remembered!)")


    Feb 20
  • B&J console app posted

    From class yesterday, here are:

    • The 10am version of the console app
    • The 2pm version of the console app
    • The SQLite database itself
    Feb 19
  • Not necessarily bullet-proof

    For assignment #3, you don’t have to worry too much about things like “what if they enter an invalid formatted date?” “What if they type ‘bob‘ for the number of tickets to purchase?” Etc. You do need to make sure to properly handle these two errors, though: attempts to (1) an attempt to purchase a ticket when the flight is sold out, and (2) an attempt to purchase a ticket “in the past.”

    Also, just a heads-up to something I would think would be obvious, but which students have messed up on in the past: if there are no tickets yet sold for a particular day’s flight, that should not stop a user from buying (the first) ticket for that day. If you think about it, it would be ridiculous for your program not to allow that — you’d be in an infinite loop, never able to buy tickets for a flight!

    Feb 18
  • Answers to in-class B&J practice queries

    Here are Stephen’s solutions to the practice Ben & Jerry’s queries from this week’s class.

    Feb 18
  • Assignment #3 posted!

    Assignment #3 has been posted, and is due next Wednesday at midnight. Happy Python coding!

    Feb 18
  • B&J query solutions

    The solutions to the B&J example SQL queries we did in class today.

    Feb 16
  • Assignment #2 rubric

    I’ve started grading the assignment #2’s, and if you’re interested in this level of detail, I’m using this rubric to assign points.

    Feb 14
  • Quiz #2 posted!

    Quiz #2 has been posted to Canvas, and is due this Friday by midnight. It is open-book, open-notes, closed-other-humans, closed-AI, and timed at 45 minutes. Good luck!

    Feb 9
  • B&J schema handout

    Here’s today’s handout if you had to miss class.

    Feb 9
  • Runways and reservations

    I got a good question about runways and reservations today, specifically about why I’m saying that a flight can only have one runway reserved at a time. Here’s my justification.

    Admittedly I’m making up stuff about runways here, since I’m not in the airline industry. But my idea was as follows: only one aircraft can reserve a specific runway at a time; otherwise there would be a collision when two airplanes tried to simultaneously land/takeoff. If there’s heavy traffic at the airport, it’s possible for several airborne flights to be “queued up” (not represented in the database) waiting to be given the reservation to land, but only one would have the reservation at any given time. Same thing for departures — there can be lots of airplanes waiting on the tarmac full of passengers and ready to take off, but who have to wait their turn to get a runway reservation so they can do so.

    As for why a flight can’t reserve multiple runways, my assumption is that runway reservations are a pretty quick thing (on the order of minutes for waiting for one, and then using it and getting off the runway so other flights can use it) and therefore a flight wouldn’t “reserve in advance” a runway at its destination airport that it’s not even going to reach for several hours.

    Feb 6
  • .mode table

    If you’d like your SQLite terminal to show tables in the “prettier” format I demo’d in class yesterday, type this command before running your select * from tablename command:

    sqlite> .mode table
    

    If you like the way this displays, and want it to permanently be that way for you, create a file in your home directory called literally .sqliterc and put this line in it:

    .mode table
    
    Feb 5
  • Assignment #2 posted!

    Assignment #2 has been posted, and is due next Thursday. Happy flying!

    Feb 4
  • Stephen’s assignment #1 solution posted

    For your reference, here’s my own solution to assignment #1 (click on the figure to enlarge):





    Feb 3
  • Campus open tomorrow; assignment #1 due tomorrow

    They’ve just announced that UMW campus will be open as usual tomorrow (Monday, Feb. 2nd) and so as promised, assignment #1 will be due tomorrow by 5pm.

    Feb 1
  • Office hours tweak next Tuesday

    I have a short meeting at 10am next Tuesday (2/3), so office hours will be 10:30am-11:30am that day.

    Jan 31
  • Weirdly imbalanced attendance issues

    So, our first week of Zoom is now done. (Hopefully it’s our only week of Zoom, but who knows.) Here’s what I observed:

    • Morning section (10am):
      • Monday ‐ near perfect attendance
      • today ‐ near perfect attendance
    • Afternoon section (2pm):
      • Monday ‐ about half the students showed up
      • today ‐ about half the students (the same half) showed up

    I have no explanation for why this would be, but it is troubling, because as most of you are aware, we covered a loooot of theoretical ground this week. Those in either section who didn’t come to class (and who I haven’t heard from any other way) are in danger of not only bombing the first couple quizzes, but also getting stuck in a can’t-get-caught-up loop.

    So. If you missed class this week, I strongly urge you to (1) get the notes from a classmate, and (2) ask questions about those notes in office hours. Like most Computer/Data Science classes, everything in here builds and builds and builds, so you don’t want an incomplete foundation!

    Just a word to the wise. See you guys one way or the other on Monday!

    Jan 28
  • Campus closed all week (!!)

    Apparently, they just closed campus for the rest of the week. For us, this means:

    • Class will be on Zoom tomorrow, just as it was yesterday (same Zoom link).
    • Office hours will be at the usual times, but on Zoom (same Zoom link).
    • Assignment #1 is now due Monday, Feb. 2nd, at 5pm.

    Stay warm!

    Jan 27
  • Quiz #1 posted!

    Quiz #1 has been posted to Canvas, and must be taken before midnight on Friday, Jan. 30th. It is open book, open notes, closed AI, closed other humans, and timed at 30 minutes.

    Good luck!

    Reminder to those with accommodations: you must remind me before you take each and every quiz that you need your extra time added! Canvas will not do it automatically.

    Jan 26
  • Assignment #1 hint

    Remember that your database must know who the pilot was, and who the co-pilot was, for each individual flight. It is not sufficient for it to know that “these two people were the crew members, but I don’t know which one was the pilot and which one was the co-pilot that day.”

    (Hint: instead of a many-to-many association, where “many” is “exactly 2,” use two different many-to-one associations, one for the pilot, and one for the co-pilot.)

    The same thing is true for departure and arrival airports. It’s not enough for your database to know “Frontier Airlines 77 connects Boston and Detroit, but I’m not sure whether it goes from Boston to Detroit or from Detroit to Boston.” It must know that the origin airport is Detroit, and the destination airport is Boston.

    Jan 26
  • Virtual office hours Tuesday

    I just saw that campus was closed again for tomorrow (Tues), so office hours will be over Zoom tomorrow (at the usual time).

    Jan 26
  • B&J conceptual model

    Here’s the UML diagram for reference during today’s Zoom class.

    Jan 26
  • Virtual office hours Monday

    I’ll be available via Zoom on Monday at the usual office hours time. (See the “Office” tab, above.) My Zoom link is the same one we use for class tomorrow (and the only link I ever use), and is in a Canvas announcement.

    Jan 25
  • *Possible* extension to assignment #1

    If campus is open on Wednesday (Jan 28), assignment #1 will be due 5pm that day, as scheduled.

    If campus remains closed through Wednesday, it will instead be due at 5pm the next day after that that campus is re-opened.

    Jan 24
  • Monday class reminder

    Just a friendly reminder: we WILL have class on Monday, at the usual time, and it will be on Zoom. (The Zoom meeting ID and link are in Canvas, in the Announcements section.)

    Jan 23
  • Assignment #1 posted!

    Assignment #1 has been posted, and is due next Wednesday (Jan 28). Note that this is earlier than assignment #0 is due! That’s because assignment #0 is the Python practice stuff, which isn’t as urgent, since we won’t be actually touching Python for a couple more weeks. Assignment #1, however, is due next week.

    Also, note: unlike most assignments for this class, which are due at midnight, this one is due at 5pm since you’ll be turning in a hardcopy, and the building may close.

    Good luck, start early, and ask questions!  

    Jan 21
  • Lab aide / tutor hours posted

    I’ve added this semester’s lab aide / tutor hours to the “Office” link on this website. Feel free to drop-in and take advantage of these excellent 350 alumni!

    Jan 19
  • Get on the scoreboard!

    To earn any points for anything this semester, you first have to be on the class scoreboard! Click on the “New Student” tab, and provide:

    1. Your real full name (do use any nickname you’re commonly known by — i.e., put “Lizzie Bennet” not “Elizabeth Bennet” if you go by Lizzie)
    2. A super secret screen name that you will never share with anyone.

    You get your first XP for doing this!

    Jan 9
  • Welcome!

    Hey everybody, welcome back from winter break, and welcome to the spring 2026 edition of DATA/CPSC 350: Applications of Databases!

    This site is gonna be hip-hoppin’ with all kinds of great stuff real soon, so stay tuned!

    Jan 7
CPSC 350

CPSC 350

stephendavies.org