SQL Equals Spreadsheets

Last week I learned about Mongo - a NoSQL data structure. This week we've covered the opposite. SQL is much more structured and rigid but does allow for an 'easier to organize' approach. More time and thought has to be put into a table's creation. Extra data can be added after the fact but it is easiest to have all of the data you know you want to collect ahead of time. Basically you're turning your raw data into a spreadsheet. That is, SQL is great for data that already exists and needs to be organized. 

Unfortunately most of this happens behind the scenes and is executed in the command line. That means I really don't have any images to share. Even when turning in my assignment I had to export my raw data into a file and upload that with a README file explaining what I did to achieve that success.  Tables are just organized data and can be joined to filter out needed information. Those queries look something like this: 

SELECT title FROM todos WHERE completed_by IS NULL;
SELECT title FROM todos WHERE priority > 1;
UPDATE todos SET completed_by = 'Victoria' WHERE id = 5;
DELETE FROM todos WHERE completed_by IS NOT null;

Those commands can be executed in the command line where the data is being entered and altered. Our instructor also introduced us to a cool interface that does a lot of that work for us. The average non-techie is probably used to manipulating a spreadsheet on line. To create a new row you just start typing in the next row. In SQL you first have to create the row from scratch, tell it where you want to put the data (as in which column), and then tell it what that data is. All line by line. It is extraordinarily tedious and excruciating without an interface. But I learned a lot and I'm glad I learned the difficult way to do it first because I have a better understanding of what is happening 'behind the scenes'.


Comments