Let’s assume that you aren’t creating a database, meaning that all that’s necessary is the programming, something made simple. SQL is a database language used to navigate and organize the database of your choosing and create graphics with, but for now, you will see the programming side.
Before I continue, SQL would be useful in a Digital Humanities context where you are dealing with way more data than you can handle in the usual Excel sheet. SQL makes a molehill out of a mountain when it comes to data.
Now, onto the tutorial.
- Load your database into any SQL browser of your choice (I’m using the DB Browser for SQLite). Specifically look for the .db file.
- Now that you have your database, you can start programming to navigate the database. You can
SELECT
a column from a table. in that order. For exampleSELECT * FROM people
(the star means everything, you can also specify the column) - Next, you can specify the information you are looking for such as
where shirt_or_hat = 'hat'
orWHERE state = 'TX'
. The WHERE function will find the items that matches from the columns called. - If you want to be more generalistic, you can use
%
on the beginning or end of a word, such as%Angelos or C% or %yu%
. This is specifically for theWHERE
function. - If you would like to look at a limited number of results, SQL has the function
LIMIT
, that will automatically let you look at the first to the limited response. For example,LIMIT 42, LIMIT 69
. You can also start with a number other than one usingOFFSET
, such asOFFSET 42
, so you can start with the 42nd result rather than the first.
Here some worthy resources to learn more about SQL, considering my tutorial is certainly nonexhaustive:
https://www.w3schools.com/sql/
https://www.codecademy.com/learn/learn-sql