Today I'm looking at GalaXQL, as suggested by my friend Andrew, to revisit SQL (Structured Query Language) and not just because I'm pretty interested in anything que(e)ry related but also because he promised it was fun and wouldn't put me to sleep like the last time I touched SQL.
AND SO WE BEGIN. A little "game" that tells me with SQL I can modify the bodies of the heavens themselves... an entire galaxy at my fingertips in in all its 3D particle sprite glory!
look at that fucking hipster professor, i bet he's running linux |
Professor Guru starts off teaching you some very basic skills.. how to do math, for instance. Apparently you just use the SELECT command and then say whatever you want. "SELECT 3" returns 3. "SELECT 2+(5*4)" returns 22. Nothing special. Then we start querying the database itself, which is non-cryptically named "stars".
"SELECT * FROM" stars for example will select all columns from the stars database and return as a result. This particular database is pretty big and the results of the query were capped at 1000 stars, but the stars had attributes like "starid", "name", "intensity", etc. When used in conjunction with the "AS" command, you can turn take your results and turn them into something new and exciting! IT CAN BE WHATEVER YOU WANT IT TO BE. "SELECT x, y, z AS imagination FROM stars".. why the fuck not. Do what you want. Use that "imagination" row for whatever the hell you want to use it for. You are god now.
..if you haven't watched The Most Popular Girls In School, please unsubscribe |
But moving on from making bogus columns of data, Professor Guru (the twat) wants us to learn more clauses for use in our queeryz. WHERE, AND, OR, NOT, ORDER BY, DESC and ASC are on the menu at this moment. WHERE can be used to only display data that meets certain criteria. "WHERE starid=2348" would only display data pertaining to the stars that have the value starid equal to 2348 (only one star, in this case). You could combine certain criteria with AND, OR and NOT. So "WHERE starid>2348 AND starid<2350 2349..="" 2349.5="" a="" data="" equals="" for="" have="" like="" only="" or="" p="" probably="" return="" something.="" something="" star="" starid="" unless="" we="" where="" with="" would="">
OR and NOT work as well, and anyone who has touched basic programming before knows enough about them.. but I'll explain anyway. OR means that one of the possibilities needs to be true, but not necessarily all. NOT means that the following thing must not be true for the query to return the result.
SELECT NOT suitcolor=black FROM borat |
So say you get a list of all of Borat's suits which are black........NOT! How do you want to sort them? WELL, maybe by the price of the suit? You can throw "ORDER BY price" or something at the end of that query and BAM, they're in order (from lowest to highest value, typically)... but you can add "DESC" or "ASC" to the very end to be sure you have descending or ascending suit prices.
But you're a real madman when it comes to suits. You need them in a VERY particular order, and Borat buys most of his suits from SEARS when they're on sale so there's like 10 of them that all cost $50. You could add another thing to sort by afterward. So say...
"SELECT * FROM borat WHERE NOT suitcolor=black ORDER BY price DESC, crotch"
...maybe this will first sort by highest to lowest price, and then lowest to highest room in the crotch for your massive dong (which is really becoming a problem when looking for pants that fit).
so much crotch fashion |
Anyway I've taken a lot of time to talk about crotches and not enough time to actually start molding my galaxy. I'll get to that some other time. Bye.
2350>