Category: SQL
-
Show Columns for a table in SQLite
Here’s the query you can run in SQLite to return all the columns from a specified table in SQLite.
-
Split a column with a delimiter in SQLite
Let’s say you have a column with someone’s full name stored in the format of “LastName, FirstName” and you would rather have two columns – one with the first name and one with the last name. The below code to split out the names in your results window.
-
Cleaning up non-ISO Dates in SQLite
SQLite doesn’t have a date storage class which makes working with dates a bit tricky. You’ll have to store the data as ‘Text’. You can read more about that here.
-
Bypass table create syntax with DB Browser for SQLite
Creating the syntax for new SQL tables can be a pain especially for CSV files with a lot of columns. I’ve started using DB Browser for SQLite because I prefer GUI interfaces over the command line. A big benefit of using DB Browser is that I can quickly create tables from CSV files and start…
-
Easily Append Rows to a Table from Multiple CSV files using DB Browser for SQLite
Here is a cool trick I found while working with DB Browser. I had multiple CSVs that all needed to into 1 table. This is possible and the steps to do it aren’t explicit. Here’s what you’ll need to do:
-
Update a table with values from a related table in SQLite
Updating a column in a table based on values in a second table proved to be quite a difficult operation in SQLite. It’s not as straightforward as it is in MySQL where one can use an inner join.