We understand you want to get help and I will deal with ONE of your questions - the ONE in the Topic.
Please make a topic for each SEPARATE query - it makes it virtually impossible for anyone using search to find answers otherwise.
Ok your answers -
there are a couple of ways to make SQL queries in XAMPP - the thing I don't know is how you want your output.
A - 'most SQL standard method' - CMD line queries with the mySQL monitor/ the program mysql.exe is effectively a MySQL shell for windows, you will get a mysql > prompt.
Start the MySQL service
open a Command Window at c:\xampp\mysql\bin
c:\xampp\mysql\bin>mysql -u 'root' -p 'yourrootpassword' (press enter)
mysql > (is what you will see when it starts)
now you can enter SQL commands. such as "show databases;" (no quote marks obviously - and it has to be correct SQL syntax, commands end with the semicolon ";") once you switch to the right database, you can enter queries!
B. 'more options with phpMyAdmin'
phpMyAdmin was designed with PHP amd MySQL in mind. IT has a complete database administration tool and a place to build and save/export queries (and create the PHP code for them) . There's even a tab called SQL!!! http://localhost/phpmyadmin
C. 'more even betterer"
MySQL has a free developer's package 'MySQL Workbench' its a full GUI SQL toolkit with visual database design and testing in mind. (its what I use to architect new databases) its a downloaded executable that installs and runs on your machine. (again, you will need to start the MySQL service before you can run MySQL Workbench) http://wb.mysql.com/