MySQL

  • MySQL is a language (or set of tools) that interacts with a relational database.
  • SQL is Structured Query Language
  • The way it works:
  • You create a database with N columns (of any type) -- imagine a listing of people in this room, their heights, their ages, and whether they are left- or right-handed
  • You can then query on the database like this:
  • %> SELECT name FROM table_name WHERE name LIKE 'trill'

  • You can do lots of complicated things here. You can update certain values
  • %> SET handedness = 'left' WHERE name = 'trilling'

  • MySQL is used a lot for web stuff, for database administration, and for many different kinds of science applications.
  • Naturally, Perl and Python (and PHP, Java) interact with MySQL with a lot of canned routines.

  • Check out Wikipedia and mysqltutorial.org.

  • MySQL is good (excellent) at databases. Therefore, in the era of big data (already here for physics, and coming soon for astronomy) you will see that SQL fluency could be critically important.
  • An example from astronomy is the Sloan Digital Sky Survey (SDSS). SDSS has a simple push-button query interface (actually, several of them), but sometimes that's not enough, and for those cases they also have a SQL query page.
  • SDSS has a lot of good tutorials on their web pages about how to use their SQL query interface (and about how to use SQL). You should read some of those tutorials and then do the exercise.