I am working on a mobile application which takes two inputs – Source Station Name and Destination Station Names. Upon receiving these two inputs, the application would then enlist the names of trains …
Tag: sqlite
For all pairs of reviewers such that both reviewers gave a rating to the same movie, return the names of both reviewers
Stanford Self Paced Course for SQL question: For all pairs of reviewers such that both reviewers gave a rating to the same movie, return the names of both reviewers. Eliminate duplicates, don’t pair reviewers with themselves, and include each pair only once. For each pair, return the names in the pair in alphabetical order. The schema : There is a
Update referencing on subquery (sqlite)
I have a table with md5 sums for files and use the following query to find the files which exist in one hashing-run and not in the other (oldt vs newt): SELECT * FROM md5_sums as oldt WHERE NOT …
Is there a very efficient way to delete from a SQLite table records not in another SQLite table?
I have two tables: Phrase and PhraseSource. Both have an identical structure but it’s possible that PhraseSource might have less rows sometimes when I download data into it. I don’t want to change …
SQL refer Primary Key in same Table and Query
I am maintaining a table of Items (Id is Primary Key). Some Items have Parent Item ( Which is also an Item, the colum Parent holds the Id of the parent Item, which is also in the same table. Some …
Value referenced by NEW on an unchanged column in an UPDATE trigger
I have a table Group_Members with a DELETE trigger and an UPDATE trigger. The DELETE trigger updates some rows in A hence invoking the UPDATE trigger. Here’s the DELETE trigger code: UPDATE …
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed:
Error FATAL EXCEPTION: main Process: com.appmaster.akash.messageplus, PID: 14373 …
Generically identify the rowid causing a constraint conflict in SQLite
I need to identify the row that caused a constraint check to fail after an INSERT OR IGNORE statement. I need this for a tool that generates SQL statements, so I can’t tie this to a specific use case …
SQL: View Representing Missing Ranges
Given a table of rows each representing a numerical range. CREATE TABLE ranges ( start INTEGER, end INTEGER ) How could I create a view that represents the “holes” in the ranges? (Ignoring …
Aggregations in SQLite
I am looking to construct a SQL query which is able to sum up installment values by month. Ordinarily this wouldn’t be too hard as you would simply sum the installment values and group by month. …