Drupal, like the others uses php and MySQL for data. But you can do some really cool stuff since it's database driven. There's a module called Views which allows you to create really complex SQL queries, and it's gui driven. You can write the SQL if you want, but you don't have to. You can create full database applications with relations to retrieve data and display it pretty much however you want.
Here's what Views looks like:
views.PNG
Here's the query created from that:
query.PNG
Another cool thing views can do is change output of specific items. So for this view, it takes an input of a fontawesome name (just the specific name like "news" or "flash") and rewrites it with the HTML around it. So when you fill in the form to create the content all you type in is "pencil" and a size number and it outputs it as <i class="fa fa-pencil fa-<size_number>x"></i> which is this:
pencil.PNG