CPSC 350

  • Syllabus
  • Office
  • Readings
  • Sheets
  • Levels
  • XP
  • Scoreboard
  • Final exam scores posted

    The final exam proved pretty challenging:




    Props to Laur, who got a +99XP, and to Gabe, the only perfect +100XP!

    Incidentally, the hardest question by far was: “a table with three attributes A, B, and C has one FD: {C}→{A}. What is the key, and is this normalized?” The correct answer is: “the key is {C,B}, and no it’s not normalized.” Only four out of 45 got this right! :-O



    Great job everyone this semester, and have a terrific summer!   

    May 3
  • Viewing your Demo-Day feedback

    To see what your friends (and enemies?) wrote about you and your Demo project, log on to the Redis server on cpsc and select instance #49. Then look for the key that starts with “feedback:” and has your first name. This is a list, and so the lrange command applies.

    All in one go:

    cpsc$ redis-cli
    127.0.0.1:6379> auth SuperSecretClassPassword
    OK
    127.0.0.1:6379> select 49
    OK
    127.0.0.1:6379[49]> keys feedback:*
     1) "feedback:ethan"
     2) "feedback:dimitrie"
     3) "feedback:caleb-with-a-c"
       .  .  and many others  .  .
    127.0.0.1:6379[49]> lrange feedback:yourName 0 -1
     1) "Your site totally sucked!"
     2) "What a shameless rip-off of Wikipedia!"
     3) "Consider Art History as a major!"
       .  .  more feedback  .  .
    

    As you can see, there’s nothing stopping you from viewing (or even editing) other students’ feedback as well. This is another place that the “don’t be a jerk” rule comes into play.

    May 2
  • Demo Day scheduled posted!

    Today’s Demo-Day® schedules have now been posted!

    • Sec 01
    • Sec 02

    You may double check your own link but DO NOT click on any of the others until I give the go-ahead!

    Kickoff in one hour. Get excited!

    May 1
  • Earn an easy 2XP (but act soon!)

    Strong? Studly? Hungry? In the first section of the class? Well, then, this is the opportunity for you!

    I need to drop by Giant tomorrow to buy ice cream and such before the first final exam period. I need a friend to help me carry stuff. Ideally two friends, actually, since I’ll need two strong backs (mine doesn’t count) to carry the cooler up the Farmer parking lot stairs and wheel it into the room.

    To be eligible for this event (at which you will have some influence over which ice cream flavors get chosen) you must email me immediately with subject line “I’ll do it, Stephen!” I will then pick you up at the bottom of the Farmer basement stairs at exactly 11:30am tomorrow.

    Apr 30
  • Assignment #9 submission instructions

    Important: you may not touch your own website after 11am on Thursday, period. This is true even during the “other section’s” demo day, and even more especially true during your own section’s Demos. Trying to stealthily work on your own last-minute bugs while your teammates are presenting their work is a sure-fire way to lose major points the moment I catch you.

    Okay, to actually register your final project for Demo Day®, send me an email with subject line CPSC/DATA 350 Demo-Day turnin before midnight tonight, and with these items in the body:

    1. The URL to your landing page. I promise no one (including me) will access that URL before Demo Day actually begins on Thursday. You, however, can still make changes up until the hard 11am Thursday deadline.
    2. A clever name of your site.
    3. Whether you plan to attend the “other section’s” final exam period instead of your own. (If you’re officially in the 12:30pm section of the class (sec 01), your official final exam slot is noon on Thursday. If you’re officially in the 3:30pm section (sec 02), your slot is 3:30 on Thursday. You only need to say anything in this regard if you would like to switch and attend the other one. Switches will be evaluated by me and accommodated at my discretion.)
    4. Whether you care about your order in the sequence: you can say things like “please don’t make me go first” or “please not last” or “please right after Jason.” I make no promises, but will try to play around and see if these requests are possible.
    5. A link to a Spotify song of at least 3 minutes, 3 minutes of which I will play (from the beginning of the song) during your Three Minutes of Chaos™ Please no sexual or insensitive lyrics in these songs.
    6. A statement of whether you’d like dairy-free B&J’s ice cream options. (I already know about Caleb, so this is to gather intel on whether there may be others.)

    Get excited!

    Apr 30
  • Grading assignment #8

    I’m in the middle of these this weekend. Just a note: if you feel you did something above-and-beyond, and it was not noticed or rewarded with extra credit, please do write back and tell me what you did that was above-and-beyond so I can judge and possibly rectify.

    Apr 26
  • Cypher practice queries posted

    For some additional practice before quiz #8 and/or the final, here are some practice Cypher query challenges, and sample solutions.

    Apr 23
  • Quiz #8 posted!

    Quiz #8 (and last) has been posted to Canvas, and is due Sunday at midnight. Good luck!

    Apr 23
  • Today’s ballots

    If you’re curious as to the result, today’s vote counts were as follows:

    • A — 7 votes
    • B — 26 votes

    (This jibes with my own perspective.)

    Apr 22
  • Possible exception

    If you feel that you will be unprepared for Thursday the 24’ths final exam because today’s announcement was so sudden — and you had set aside time to study for it after this week is over — I will allow students (on a case by case basis) to take the final exam instead during the “opposite” final exam period from their own. (The two final exam periods are noon-2:30pm and 3:30-6pm on Thursday May 1st.)

    Important: if you want to do this, you need to make your case to me in person, no later than end of class tomorrow (Wednesday). If I do not hear from you by the end of class tomorrow, and if I have not approved this exception, you will need to take the final on Thursday April 24th with everyone else, as announced today.

    Apr 22
  • Important final exam note

    As mentioned in class today, the final exam this semester will be in-person on Thursday, April 24th during regular class time.

    It is an open-notes, open-anything-printed-out, open-calculator, closed-computer, closed-other-humans, closed-electronic-devices (other than a calculator), closed-Python, and timed (at 1 hour 15 minutes).

    All materials that you use for this exam must be printed out on paper beforehand. During the exam, you are permitted only to work with pencil and paper. You may not use your computer at all for the exam.

    Feel free to browse the class website and print out any of the cheat sheets or other materials. Feel free to print out any of the code examples I posted this year. Feel free to print out your own code from any of your homeworks. Feel free to print out all of Wikipedia, if you have the paper and ink. But it must all be printed out and accessed that way during the exam, not using your computer or the Internet.

    Apr 22
  • Class is ON for tomorrow

    I think I may have finally licked this thing. See you guys tomorrow.

    Apr 21
  • Same diff

    Blech. See you guys Tuesday (I hope).

    Apr 17
  • Quiz #7 posted!

    Quiz #7 has been posted to Canvas, and is due this coming Monday at midnight. You can go ahead and take the quiz now if you’d like — it doesn’t contain anything we haven’t already covered in class.

    “No more training do you require. Already know you, that which you need.” — Yoda



    Apr 16
  • Assignment #8 extension

    Also, the assignment #8 deadline has been postponed until Friday at midnight.

    Apr 16
  • Game plan

    Okay, so I feel like it’s unfair of me to expect you guys to incorporate Neo4j into your project databases by the end of the semester, considering we’ve missed so much class and I haven’t even taught you guys how to query in it yet, lol. So here’s what we’re going to do for “assignment #9“:

    Assignment #9 will be your final presentation (on demo day, a.k.a. the final exam period, a.k.a. May 1st). As I’ll explain more fully in class, you’re going to have two minutes to coherently and compellingly demonstrate your website’s functionality, in all its glory, followed by Three Minutes of Chaos® during which everyone in the class will be accessing your website all at once and adding (clean, tasteful) data to it.

    Here’s what I’ll be looking for:

    1. That your two-minute explanation is cogent, understandable, and non-rambly. You should think through, plan, and practice this presentation. Yes it’s only two minutes, but you’ll be surprised how difficult it is to explain your website to a newcomer off-the-cuff. In particular, I’m going to be looking for things that are not obvious to a user how they would work, but which you seem to think are obvious and therefore never thought of articulating them. Such cases will result in points taken off. I suggest you give your presentation to a friend or two who has never seen your website, and ask them “what questions remain unanswered? After my explanation, what are you still unsure about?” You’ll find that some things you never even thought of mentioning are actually confusing to a newcomer, and will force them to guess (often wrongly) how your site is supposed to work.
    2. That your website contains information from MariaDB, Redis, and MongoDB; that you clearly explain which information is stored in which database; and that you use the session in some way to give different users different meaningful experiences. If you didn’t do some of these items earlier in the semester, and thus got less than full XP for some stages, now is your time to remedy these!
    3. That your website doesn’t break. If on the off-chance that a timing glitch causes your system a problem, I will verify with you later whether it’s a “real” (i.e., reproducible) bug. But this won’t happen in most cases. It would be a good idea to battle test your website over the next week and a half — ideally by having your friends and family bang on it, ideally at the same time — to verify it’s ready for action! You should not run it once, see that it works, and assume that it will work under all circumstances.
    4. Finally, that you are present, paying attention, and not rude during your classmates’ presentations. And also that you do not in any circumstances add data to their (or your) database that involves pornography, profanity, gender-insensitive material, racial/ethnic slurs, etc. Err on the side of caution here.

    Send questions!

    Apr 16
  • Flu day answers

    Here are my answers to part 1 of yesterday’s extra credit activities. For part 2, I created a checker script on the cpsc server that lives at:

    /home/faculty/stephen/mongoActivity2check.py
    

    You should have read permissions to view this file in vim, run it yourself, etc., to see what you may have missed.

    Apr 16
  • Just not gonna happen

    Sorry guys, I’m just not feeling any better. I’m going to try and go to the urgent care today. In the meantime, class and office hours are canceled.

    Apr 16
  • Programming contest points

    If you attended the department programming contest on Friday, and would like your points, please send me email and tell me how many problems your team solved!

    Apr 16
  • Importing Star Wars

    You may have noticed on the cheat sheet that if you’re importing a JSON file that contains a list of documents (rather than a single document) you have to give an additional argument to the end of the mongoimport command:

      --jsonArray
    

    I apparently left this off the instructions for part 2 of today’s activity, but you will need it to import starwars.json.

    Apr 15
  • Office hours canceled tomorrow

    Office hours will regrettably be canceled for Tuesday, April 15th.

    Apr 14
  • Please bring your laptops to class tomorrow

    If not everybody reads this in time, that’s okay, but I’d like over half the students to have a working laptop during lecture tomorrow (Tuesday, April 15).

    Apr 14
  • Mongo activity, and additional practice

    Here’s the activity from today’s class (the answer was “happee e-star“) and also another one from last semester to help you practice (the answer is at the bottom of this post).

    happea terkey day

    Apr 10
  • Must read

    The single best computer science book ever written, in my opinion, and mandatory reading for everyone in the discipline at some point in their career.

    True story: when I finished the last page on my first read-through, I literally cried. ;_;

    Apr 10
  • Galaxy explorer (console and Flask versions) posted

    So, it seems that Stephen’s git skills are not as sharp as he thought, because I have managed to thoroughly screw up and lose the early class’s Flask code. 🙁 The good news is that we had the exact same agenda in both sections, and added the same features. (The code will vary, of course, as two programs that do the same basic thing always vary.)

    All I can say is I’m sorry! And offer a free XP for your pain and suffering.

    Here’s the code from yesterday and today:

    • The console Galaxy Explorer
      • Early class version
      • Late class version
    • The Flask Galaxy Explorer
      • Early class version
      • Late class version
    Apr 9
  • Assignment #8 posted!

    Hot on the heels of your Redis expansion will be your MongoDB expansion.

    It’s due next week! So why are you still reading this?!

    Apr 8
  • Quiz #6 posted!

    Quiz #6 has been posted, and is due Friday at midnight. You can take it any time (including right now) — we’ve already covered all the material on it.

    Apr 7
  • Aggregation pipelines from today

    Here are the more complex aggregation pipeline examples from today’s class.

    Apr 3
  • Assignment #7 extended to Saturday night

    Just because Garrett wanted to.

    Apr 3
  • Practicing with the Kahoot

    Here’s the Kahoot from yesterday’s class, if you’d like to practice with it.

    Apr 3
  • Flush your Redis instance

    Btw, I believe that last semester’s students still have all their stuff in the Redis instances you guys are now using. Feel free to flush their work (the command is “FLUSHDB” at the Redis command line) before adding your stuff.

    Mar 28
  • Fear is the mind killer

    Here’s today’s XP-bearing activity if you want to practice with it before the quiz.

    Btw, the full Bene Gesserit Litany Against Fear runs like this:

    “I must not fear.
    Fear is the mind-killer.
    Fear is the little-death that brings total obliteration.
    I will face my fear.
    I will permit it to pass over me and through me.
    And when it has gone past, I will turn the inner eye to see its path.
    Where the fear has gone there will be nothing. Only I will remain.”

    — Dune, Frank Herbert

    Mar 28
  • Hobby Manager: final version

    From today’s class, here’s our final version of the “Hobby Manager” app:

    • The 12:30pm class’s git bundle
    • The 3:30pm class’s git bundle

    (To unpack a git bundle on your system, type “git clone nameOfGitBundle.git“.)

    Mar 27
  • Quiz #5 posted!

    Quiz #5 is a 60-minute, closed-Python and closed-Redis affair that is due on April 2nd at midnight. Good luck!

    Mar 27
  • Connecting to Redis on cpsc

    Remember that you’ll need to do two things to connect properly to Redis on cpsc: authenticate with the password I gave in class today, and select the correct instance.

    From the command line:

    $ redis-cli
    127.0.0.1:6379> auth theClassPassword
    OK
    127.0.0.1:6379> select yourInstanceNumber
    OK
    127.0.0.1:6379[yourInstanceNumber]>
    

    From Python:

    import redis
    
    r = redis.Redis(password="theClassPassword",
        db=yourInstanceNumber,
        decode_responses=True, charset='utf-8')
    
    Mar 26
  • Hobby Manager: in progress

    From today’s class, the first cut at our “Hobby Manager” app:

    • The 12:30pm class’s git bundle
    • The 3:30pm class’s git bundle

    (To unpack a git bundle on your system, type “git clone nameOfGitBundle.git“.)

    Mar 26
  • Assignment #7 posted!

    As promised, assignment #7 has arrived and is due next Friday. Good luck, and happy coding!

    Mar 26
  • Maddie’s survey

    Madelyn Maddie would appreciate it if you would take the time to complete this survey that she’s using as part of an independent study.

    Mar 23
  • CPSC programming contest!

    This year’s CPSC Programming Contest will take place on April 11th at 6pm! It involves free pizza, snacks, music, and fun! You should definitely mark this on your calendar if you haven’t already, and be sure to sign up with or without teammates. (You can indicate on the form if you’d like to be paired up on a team, and Ian, the contest maestro, will assign you companions.)

    Additionally, I will award extra credit for all participants: +1XP for each problem your team gets correct. Also, any team that beats yours truly will receive the coveted opportunity to throw a whipped cream pie in my face in a public setting! This is a great way to humiliate me that you should be sure to take advantage of.

    Mar 23
  • sick today

    no class or office hours today (mar 20) – send email

    Mar 20
  • Final bundles posted

    From today’s class, the “final” versions of our SQLite-backed ice cream database:

    • The 12:30pm class’s git bundle
    • The 3:30pm class’s git bundle

    (To unpack a git bundle on your system, type “git clone nameOfGitBundle.git“.)

    Mar 18
  • The “Details” tab

    Several people have asked me questions of the form “hey Stephen, have you graded my X yet?” Note that you can check this yourself by clicking on the “Details” tab of the scoreboard and entering your info. This will show you all the XP you’ve earned so far this semester, in all their glory.

    Mar 16
  • Therapeutic

    The scoreboard has been updated with lots of stuff, including assignments 3 through 5, quiz #3, and the latest codingbat/leetcode points. Also, a sweet surprise for Stephen: nobody in the class managed to mess up the Honor pledge for quiz #3, which requires a clumsy email back and forth to correct! As a reward for this collective ability to follow instructions, everyone gets +1XP. Enjoy!

     

    Also: props to kanarwithdamar, Lisan al-Gaib, P@$$WORD, GoldCannon, and suspiciouslyEven for reaching the “Chocolate Therapy” level, and to John Database for climbing up to “Minter Wonderland“!


            

    Mar 15
  • Quiz #4 posted!

    Quiz #4 has been posted, and is due on March 18th at midnight. It contains no material from today (or even anything post-spring-break, actually) so fire away!

    Mar 13
  • DB World Tour stop 1 (a.k.a. assignment #6) posted!!

    Okay, time to get excited!! The first milestone for your most excellent DB Tour project has been posted, and is due in little over a week. Get those creative juices flowing, and get cracking!!

    Mar 13
  • Buy ice cream here!

    From today’s class:

    • The 12:30pm class’s git bundle
    • The 3:30pm class’s git bundle

    (To unpack a git bundle on your system, type “git clone nameOfGitBundle.git“.)

    Mar 12
  • Important: homework turn-in confusion

    Hmm. What I meant for you guys to turn in for your “assignment #4’s” was:

    • A git repo, with these contents:
      1. Your customer_service.py program that allows the user to interactively purchase tickets
      2. Your SQLite database file that has all the stuff from galactic in it (and optionally, other rows left over from your assignment #3)
      3. Optionally, Python code in some other file (perhaps “bulk_import.py” or some such) that does your assignment #4 bulk-import loading, although I don’t actually need that for grading.

    Instead, I’m getting lots of people whose “customer_service.py” file isn’t actually their customer service program at all, but appears instead to be their assignment #4 bulk-import code. I’m also getting people seem to have expected me to run their bulk-import code to populate their database with galactic stuff, instead of including an SQLite database that already has the galactic stuff included.

    All this is taking me longer than I want to mess around with. And it has proven to be too onerous to try to dig up old assignment #3 submission emails, which may not even be compatible with any schema changes you had to make to accommodate galactic in assignment #4, etc.

    **So, since I’m old and tired and want to make the process of grading 52 of these as streamlined as possible, I’m going to have everyone resubmit your assignment #3/#4 according to the above specifications. The subject line for the email should be “CPSC/DATA 350 Assignment #3/#4 resubmission”.

    To be crystal clear: when I open your email, it should contain a git bundle as an attachment. When I clone that git bundle, I should then have (1) a customer_service.py file which does the whole assignment #3 thing, and which works on (2) your assignment #4 database file that contains all the galactic data. Also note: I will not be running any code to actually perform the bulk import; the results of that importing process should already be reflected in the database.

    Submissions will be graded in the order they are received.

    Mar 11
  • To run your flask app on cpsc.umw.edu

    We’ve been working on localhost so much that I think I forgot to ever tell you guys how to get your Flask app running on the actual internet on the cpsc server. Duh.

    The answer is, when you start Flask, do it this way:

    $ flask run -h 0.0.0.0 -p yourPortNumber
    

    The 0.0.0.0 is literal. The yourPortNumber” should be replaced with your port number.

    Mar 11
  • First “real” DB-powered Flask apps

    From last week’s class:

    • The 12:30pm class’s git bundle
    • The 3:30pm class’s git bundle

    (To unpack a git bundle on your system, type “git clone nameOfGitBundle.git“.)

    Mar 2
  • Quiz #3 posted!

    Quiz #3 has been posted to Canvas, and is due after spring break. It’s a short one, timed at 30 minutes.

    Feb 27
  • Assignment #5 posted!

    In case you want to get ahead over spring break, assignment #5 has been posted and is beckoning to you. It is actually due the Thursday after we get back.

    Feb 27
  • Another possible workaround for connecting to Maria

    At least one student has reported that if they include the “--skip-ssl” at the end of their connnection command, like this:

    $ mariadb -u yourusername -pyourpassword -h cpsc.umw.edu -P 3306 galactic --skip-ssl
    

    that it worked for him. Give it a shot if nothing else is working.

    Feb 26
  • Practice query solutions posted

    Here are my solutions to the extra credit activity that was due today.

    Feb 25
  • Assignments 3 and 4, and spring break

    I’ve been having so much fun that I sorta forgot that next week is spring break. 😀

    So, here’s some important news regarding assignments 3 and 4:

    1. Assignment 4 is now due the Sunday after spring break, not before. Organize your time however you wish. (Obviously I will still accept the assignment if it’s turned in by the original date!)
    2. I’m actually not going to grade Assignment 3 separately at all. Wait, hear me out. To grade your console interface, I’m going to query your database, order tickets, etc., only after it’s populated with the galactic stuff. That way, I know what the contents should be, how many tickets should be left on each flight, etc.

    A few implications for point #2, above:

    • If you didn’t submit assignment 3, it’s your lucky day: you get a reprieve. I’m not even going to check who turned it in and who didn’t. (However, you’ll have significantly extra work to do for assignment 4, because you’re going to have to write the Python console interface for assignment 3 in addition to doing the bulk import for assignment 4. Happy spring break.)
    • If you did get assignment 3 submitted, but for some reason fail to submit assignment 4, yes I’ll go back and grade your assignment 3 and give you points for it. Fair is fair.
    • If you don’t ever get assignment 3 submitted, but do submit assignment 4, yes I’ll figure out a way to grade your assignment 4 and give you points for it. Fair is fair.
    • For most of you — who did submit assignment 3 and who will submit assignment 4 by March 9 — you will receive one lump sum of up to +80XP when I grade assignment 4 sometime during the second week of March.
    Feb 25
  • Temporary MariaDB connection woes

    If you’re having trouble reaching the galactic database, read carefully.

    1. You already have a MariaDB account, but the question is what password you’re using. The password should still be the original one that Ian sent you when you got an account on the cpsc.umw.edu server at all. So if you’ve changed your cpsc password since then with the passwd Linux command, be advised that this does not change your MariaDB password. You’re still on the old one.
    2. Btw, if you’d like to change your MariaDB password (either to match your Linux system password, or anything else) you can do so at the MariaDB command line with the command: “SET PASSWORD = 'new_password';“.
    3. Ian is working on getting everyone read-only access to the galactic database needed for the homework. Until then, you are free to access the read-write version using the username and password I used in class. If you’ve forgotten that username/password, here’s a hint: the username is someone you know, and I mentioned that the specific password was chosen “because Ian is a smart-aleck.” If you still don’t know, email me and I’ll tell you these values. Please DO NOT post them anywhere publicly.
    Feb 25
  • Homework #4 is posted!

    No rest for the weary — get ready for the impedance mismatch of the century: a bulk import assignment from mine to yours. It’s due next Sunday, and is not for the faint of heart. Happy importing!

    Feb 23
  • Last week’s code posted

    From last week:

    1. The final versions of our B&J console programs:
      • 12:30pm version
      • 3:30pm version
    2. The bulk import programs:
      • 12:30pm version
      • 3:30pm version
    Feb 23
  • Clarification on extra credit example tables

    The “sample answer tables” I gave for each question in the extra credit activity are only intended to give the shape of the answer, not any actual answer on any particular database. Apparently I posted a previous version of my SQLite Ben & Jerry’s database at some point, and some students were entering their queries against that database and expecting to come up with the same numerical answers as on the activity. Do not expect this to be the case.

    (Btw, I intended this activity to be a pencil-and-paper affair where you figured out the correct query by looking at the schema page we’ve been using in class, not a use-the-computer affair where you typed SQL queries at the SQLite prompt. I guess now that people are doing it that second way, I can’t really outlaw it, but it wasn’t my intent.)

    Feb 22
  • Transaction demonstration

    From yesterday’s class, the code that used transactions so that multiple copies of it simultaneously accessing the same SQLite database didn’t interfere with each other in a destructive way.

    Feb 21
  • Extra credit query practice

    You can earn up to +5XP by legibly writing queries to answer this set of questions. You are allowed to work in groups of up to 4 on this activity.

    To claim these XP, turn in your legible solutions to my “350” manila envelope no later than 5pm, Monday 24. If you worked in a group, be sure to write everyone’s name on your submission.

    Feb 19
  • SQLite command line atrocities

    For those of you following the SQLite formatting hassle, here’s today’s ChatGPT debugging session, which ended ambiguously.

    Feb 18
  • Today’s code posted

    From today’s class:

    1. The additional practice queries (and sample solutions)
    2. The B&J console program:
      • 12:30pm version
      • 3:30pm version

    Taking the time to go through the rest of the questions on item #1 on your own would be an excellent and praiseworthy idea.

    Feb 18
  • Assignment #3 posted!

    Assignment #3 has been posted, and is due next Sunday Feb. 23rd at midnight. Good luck!

    Feb 18
  • Beet it!

    A quick shout out to John Database and GoldCannon for being the first to reach the “Beet It” level!

    Trivia question for the masses: what’s different about “Beet it” than any of the other semester’s levels?



    Feb 17
  • Question 9 on quiz #2: explanation

    A couple students asked a question about Item 9 on the quiz: why is the answer 5, not 4? The tables in question were PETS:

    +----------------------+----------+----------+
    |        owner         |   dog    | numYears |
    +----------------------+----------+----------+
    | Laura Ingalls Wilder | Jack     | 5        |
    | Veronica Mars        | Backup   | 3        |
    | Robert Barone        | Chamsky  | 9        |
    | Laura Ingalls Wilder | Bandit   | 2        |
    | Fourth Doctor        | K9       | 4        |
    | Sarah Jane Smith     | K9       | 8        |
    | Raj Koothrappali     | Cinnamon | 5        |
    | Emily Elizabeth      | Clifford | 6        |
    +----------------------+----------+----------+
    

    and CHARACTERS:

    +-----------------------------+----------------------+-------+
    |            show             |      character       | debut |
    +-----------------------------+----------------------+-------+
    | Little House on the Prairie | Laura Ingalls Wilder | 1974  |
    | Clifford the Big Red Dog    | Emily Elizabeth      | 2000  |
    | Doctor Who                  | Fourth Doctor        | 1974  |
    | Doctor Who                  | Sarah Jane Smith     | 1973  |
    | The Mandalorian             | Greef Karga          | 2019  |
    +-----------------------------+----------------------+-------+
    

    The query in question was this:

    select count(*) from pets join characters on owner=character;
    

    The students asked, “why doesn’t this give you 4 rows, since table rows must be unique and therefore Laura Ingalls Wilder can’t appear twice?”

    But realize that this query isn’t a “select owner” or “select distinct(owner)“; rather, it’s a “select *“. So therefore, you’re counting the entire number of rows returned by the join, not the number of distinct owner names (or any other attribute).

    If you get rid of the count(*) and just use * to see the whole table of results, you get:

    +----------------------+----------+----------+-----------------------------+----------------------+-------+
    |        owner         |   dog    | numYears |            show             |      character       | debut |
    +----------------------+----------+----------+-----------------------------+----------------------+-------+
    | Laura Ingalls Wilder | Jack     | 5        | Little House on the Prairie | Laura Ingalls Wilder | 1974  |
    | Laura Ingalls Wilder | Bandit   | 2        | Little House on the Prairie | Laura Ingalls Wilder | 1974  |
    | Fourth Doctor        | K9       | 4        | Doctor Who                  | Fourth Doctor        | 1974  |
    | Sarah Jane Smith     | K9       | 8        | Doctor Who                  | Sarah Jane Smith     | 1973  |
    | Emily Elizabeth      | Clifford | 6        | Clifford the Big Red Dog    | Emily Elizabeth      | 2000  |
    +----------------------+----------+----------+-----------------------------+----------------------+-------+
    

    As you can see: 5 rows, with no duplicate rows.

    Feb 17
  • Please tell me about incorrectly scored quiz items

    If you miss points on a quiz question that you clearly had correct, but simply entered in a different format than I was expecting, please don’t just accept the loss and sulk. Instead, tell me about it.

    For example, suppose the answer to some question was:

    stephen

    but for your answer you entered:

    "stephen"

    Depending on the exact nature of the question, this is quite possibly just as “correct” an answer as the one the quiz was looking for, yet it will be marked wrong because it wasn’t expecting you to put quotation marks.

    All such answers should be regraded, and you should tell me about them. (Note that this is not an open invitation for you to tell be about the individual items you legitimately missed because you put the wrong answer. Only the ones where your obvious intent was to give the correct answer, but differences in formatting choices got in the way.)

    Feb 15
  • No, SQLite is not allowed on the quiz

    I thought this would have been obvious, I guess, but in case not: no, you are not permitted to use the SQLite command line while taking the quiz. (If you think about it, the quiz would be pointless if you could do that, since anyone who knew how to type could get the questions right, even if they knew nothing about databases. The quiz is testing your understanding of the material in class, not your ability to type.)

    Feb 15
  • Office hours partially canceled next Tuesday

    Unfortunately, I won’t be able to make my usual 11:30am-12:30pm office hours on Tuesday, Feb. 18th. I will be there for the 2-3:30pm block, though.

    Feb 14
  • Clarification on “open-notes” quizzes

    For quizzes, you are allowed to use all handouts from class, any “cheat sheets” or other things posted on the class website, etc. Basically, anything written down that you want to use is okay. The only things that are not okay are programs (like the Python command line, or ChatGPT.)

    Feb 14
  • From today’s class

    From today’s class:

    • Sample solutions to the first nine queries on the page I handed out
    • the beginnings of the ice cream purchasing console app we started on
    Feb 13
  • Today’s queries posted

    From today’s class, the queries against the B&J database that (1) reviewed selects, wheres, froms, Cartesian products, and joins, and (2) introduced group bys, havings, order bys, limits, and offsets. (Whew!)

    Feb 12
  • Office hours on Zoom today

    At the usual time, at the same link we’ll be using for class (see Canvas announcement).

    Feb 12
  • Questions (and answers) about class tomorrow

    Will we have class tomorrow? Yes! See Zoom link in Canvas announcement.

    Is class mandatory? No, class is never mandatory. You are big boys and girls, and can come and go whenever you choose. If you don’t think you will benefit from being there, you are free to skip any class at all, including tomorrow’s.

    If I don’t come, should I get the notes from a classmate? Yes, as always.

    What if I don’t have the proper Zoom equipment? This situation should be exceedingly rare in the post-Covid age, but I will attempt to record tomorrow’s lecture and post it on Canvas for anybody who isn’t able to “come to class.”

    Feb 11
  • Quiz #2 posted!

    Quiz #2 has been posted, and is due Saturday, Feb 15th at midnight. It’s timed at 45 minutes, and covers all the material from class and readings up through and including Tuesday Feb 11th’s class. Good luck!

    Feb 11
  • Virginians and snow *eye-roll*

    Really? Where I come from there at least have to be a few flakes falling first.

    Anyway, we’re holding to a good pace so far this semester, and I do not want to fall behind. And given past UMW history, my bet is that class is canceled for more than just tomorrow. So here’s the official dealio:

    1. Enjoy your day off tomorrow. Fair’s fair. But:
    2. If class is also canceled for Wednesday and/or Thursday, we will have class those days at the appointed time on Zoom. If you need to bust out your webcam or dust off your lens, you’ve got over 24 hours to do that.

    See you guys Wednesday, regardless!

    Feb 10
  • Today’s code posted

    From today’s class, the SQL code to recreate our bootstrapped database:

    • early class version
    • late class version
    Feb 5
  • Code and handout posted

    From today’s classes:

    • The SQL code (first section)
    • The SQL code (second section)
    • The handout for which I ran out of copies
    Feb 4
  • Assignment #2 posted!

    Assignment #2 has been posted, and is due next Thursday at midnight. Note carefully: this assignment will probably take a medium amount of time if your assignment #1 was pretty clean, but a large amount of time if your assignment #1 had lots of mistakes. (This is because you’ll need to fix all those mistakes — or use Stephen’s solution instead — for assignment #2.)

    Feb 4
  • Stephen’s assignment #1 solution

    Here’s my solution to assignment #1. If you got less than 35XP or so for this assignment, I strongly suggest you carefully look over my solution, and perhaps use it instead of your own as a basis for assignment #2.




    Feb 2
  • Quiz #1 posted!

    Quiz #1 has been posted to Canvas, and is due on Friday at midnight. It is open-book and open-notes, closed-other-humans and closed-AI-assistants-such-as-ChatGPT, and timed at 60 minutes.

    Good luck!

    Jan 28
  • “Tail numbers”

    Abe, a pilot in our class, just now told me that there is in fact an “AID-type thing,” which is called a tail number, and it’s written on the fuselage. Call it what you wish on your homework!

    Jan 28
  • Walk-in tutoring

    Walk-in tutoring is available for this class (and others)!

    • Kenzie: Wednesdays, 6-8pm, Farmer 025
    • Matt: Thursdays, 6-8pm, Farmer 026
    Jan 28
  • The present and the past

    This may seem inconsistent, but it’s the law in Stephenworld: your database does need to know who flew last October 29th’s United 277, but it does not need to know what runway United 277 might have had reserved on that date — all that it needs to know about runway reservations is what runways are currently reserved. (In other words, information about flight crew assignments must be kept in perpetuity, whereas your database only needs to know what current flight has each runway reserved, if any.)

    Jan 25
  • On pilots and copilots

    Clarifications around crew members:

    1. Crew assignments are not normally the same from day to day. (If Charlie/Julie were the pilot/co-pilot on this morning’s United 678, they are very likely not going to be the pilot/co-pilot on tomorrow’s United 678.)
    2. All crew members who are certified to fly a type of plane can be either the pilot, or the co-pilot, for a flight that uses that type of plane. (There’s no such thing as “being certified to co-pilot a Boeing 747, but not certified to pilot it.”)
    3. Every crew member is a pilot on some flights, and a co-pilot on others. (They’re rotated so they don’t get too fatigued.)
    4. Your database does need to know who the pilot is, and who the co-pilot is, for a given day’s flight, not merely “who the two crew members are.” If I go to your database and ask “who was the co-pilot for yesterday’s American 113?” your database is not allowed to respond, “well, Sallie and Jeff were the two crew members, but I’m really not sure which one was the pilot and which was the co-pilot.” (Hint: I think you’ll want two different one-to-many associations in this part of your design, not a single many-to-many association.)
    Jan 24
  • AID

    I don’t know if there is something like this in reality (I’m sure there is, though) but we’re going to say that all physical airplanes have an “AID” (“airplane ID”) which is globally unique.

    Jan 24
  • Email means email

    Clarification: when I say to “email me” (with questions, to turn in an assignment, etc.) I really do mean “email me” (to stephen _AT_ umw _DOT_ edu), not “send me a Canvas message” (which I normally do not see and do not read).

    Jan 22
  • Assignment #1 posted!

    Assignment #1 has been posted, and is due a week from today at 5pm (not midnight) to the “350” manila folder hanging outside my office door. If you have any uncertainty about what any of the requirements mean, please be sure to ask! If you don’t ask, and misinterpret a requirement as a result, you’ll miss out on points that you might otherwise have received.

    Procrastinate on this to your peril!

    Jan 21
  • codingbat.com practice

    You can earn up to +2XP per week by spending 30 minutes (per week) completing codingbat.com problems. All you need to do to claim these points each week is send me an email on Friday of the given week with subject line “CPSC/DATA 350 codingbat XP“. In the body of the email, you should type “I spent 30 minutes this week working Python exercises on codingbat.com,” followed by the Honor Pledge and your full name as a signature.

    Happy coding!

    Jan 14
  • Assignment #0 posted!

    Your first graded assignment of the semester — getting used to Python or brushing out the cobwebs — has been posted, and is due Tuesday, Jan 21st at midnight. Send questions!

    Jan 14
  • Scoreboard sign-up!

    Okay everybody, it’s time to earn your very first XP (experience point) of the semester, which is not only admirable in itself but is also required in order to earn any other XP at all!

    All you need to do is head over to the Scoreboard (see link at top of page) and add yourself as a new student. Be sure to choose a screen name that is super secret, that you have never used before, and that you will not reveal to anyone.

    Jan 14
  • Welcome!

    Greetings, Earthlings, and welcome to the spring 2025 version of CPSC/DATA 350: Applications of Databases with Stephen! This site is gonna be hip-hoppin’ with all kinds of great stuff real soon, so stay tuned!

    Jan 12
CPSC 350

CPSC 350

stephendavies.org