Data in a Shell: SQL

Hey newbies, lets talk about data. Data is everywhere online and off, it is flowing through all of us like air… or the force, yeah lets go with the force. Much like the force it can only be used after much training and focus and it could be used for good or evil.

When learning to deal with data we look at using SQL(pronounced sequel or S.Q.L or you could even say squeal if you are feeling fiesty) or Structured Query Language a programing language specifically used for managing data. This is a programming language that we have been using since the 70’s making it basically ancient in the tech world. The way in which SQL works is that it creates databases and in those databases are tables and in those tables are rows and columns. A better way to imagine it is that in SQL we have our databases can be seen as worlds. In those worlds we have our cities (tables) and in those cities we have people (each person is a row of the table) and each of them have their own statistics or details (these would be the columns of the table).

Now lets dive into one of the citizens of our database, let us call him Bill. Bill lives in the City of Tableton. Already we know that Bill is a man and his name is Bill. To catalog that data we would use varchar (Variable Character Field) and list the data “Bill” and “male” in Bill’s row. We could not just put that data nilly willy anywhere in Bill’s row, we would create categories in our columns/data fields for name and gender and put the data under that. Next we could create another column “Alive” and enter in data for this using a boolean or a true/false statement, for now we will use true to show that Bill is alive… for now. Then we can use integers or numbers to show data like age, or Bill’s ID number. Every citizen in our database must have a unique ID number (primary key), there could be millions of Bills out there, but we need to know exactly which Bill we are dealing with when using his data(also Bill it’s what makes you so special).

Data is not static, we could change Bill’s name to Craig (sorry Bill you are Craig now), we can even add another column like demeanor and make Craig unkind (this is why no one likes you Craig), we could delete Craig’s name and then we would know him by his ID(you are now 11) or we could even just delete 11(sorry 11 you are not anything anymore). What we can’t do is delete 11’s id. If we did that all our data would start to crumble as would everything around us… everything.

Once we start looking outside of the individual we see that a bunch of people make up the city of Tableton. Using SQL we can organize Tableton however we want, maybe look at a specific age between 30–35 or find people who are just kind(see, I told you 11 we only like nice people). Our cities are not isolated from one another, if 11 (fine we can call you Craig again… but not Bill) or Craig were to decide to go to another city and go shopping there he would not be mixed up with the other Craig’s of Tabletopolis for instance because his ID is unique through out all the world. This would be useful so that we could combine data (JOIN) from two of our cities.

And this folks is data and basically how the world works in a nutshell.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.