Conversation
Adding SQL queries for the first time to meet the requirements of Homework 5.
Fix WHERE condition in DELETE. The question asks for the deletion of the OLDER record, not the latest one. Replace hard-coded values in INSERT with results from a query over the same table being updated. Don't overwrite the snapshot_timestamp in the UPDATE.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Adding SQL queries for the first time to meet the requirements of Homework 5.
What did you learn from the changes you have made?
SQLite is a bit more lenient than other flavors of SQL I'm more used to, like MySQL, Postgres, etc. That might sound like a benefit, but it could make it harder to migrate to other database. (Which is rare and challenging no matter what. But still.)
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
For the last question, I think I used a different approach because I didn't feel the need to use a
WHEREwith multiple values, as stated in the question's comments.Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Not sure if there is an issue with my version of SQLite 3 (), or if DB Browser for SQLite is the one to be blamed for it, but I noticed that running the whole script doesn't always proceeds as expected when you have
CREATE TABLE <table>andDROP TABLE <table>commands for the same<table>in the same script. Also, it seems there a bug with SQL commands inside block comments (/* ... */), which sometimes seem to be executed (?). Really weird stuff that slowed me down a bit.How were these changes tested?
I created the queries and other commands in incremental or piecewise manner, inspecting the results visually or checking them with other queries to make sure I was on the right track.
A reference to a related issue in your repository (if applicable)
N/A.
Checklist