SQL isn't a language like that, it's used in other languages to help communicate with databases (MySQL, Postgre, Oracle, Access)
it is used in another language, like PHP or ASP.
here is an example PHP (.php) script:
<?
mysql_connect("localhost", "username", "password");
mysql_select_db("database");
$query = mysql_query("INSERT INTO table (column1, column2) values ('row1a', 'row1b')");
$query2 = mysql_query("SELECT * FROM table WHERE column1 = 'row1a'");
$data = mysql_fetch_assoc($query2);
echo $data['column1']; // prints 'row1a'
echo $data['column2']; // prints 'row1b'
?>
[edit]
Sometimes, large series of queries, such as backups, are stored in files and then loaded to execute, their extension doesn't really matter as it is just a text file, but they are usually either named *.sql. phpMyAdmin supports running queries from files.