Tuesday, 17 June 2014

SQL and Databases

Data is great, but where do you put it so that you can access it easily?
One popular option is a relational database accessed using SQL (structured query language). Whilst SQL has a general set of commands, different database systems have their own additional commands. Examples of these systems are PostgreSQL, SQLite, and MariaDB (open source), with commercial solutions from, for example, Oracle, IBM, Microsoft and SAP.

I'm currently going through Udacity's Intro to Data Science, which introduces and has you carry out some basic SQL quieries.  However, I wanted to go further and learn SQL in more detail.  I found two really nice resources to learn SQL: sqlzoo and w3schools.  I can really recommend them!

Here are a few important basic commands:

SELECT parameter1, parameter2
FROM database
WHERE parameter1 > 10 AND parameter2 < 10
AND parameter3 IN ('X', 'Y', 'Z')
AND parameter4 = 
    (SELECT avg(parameter4)
     FROM world
     WHERE parameter5 > 10)
GROUP BY  parameter5;





No comments:

Post a Comment