Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
| /* How many albums does the artist Led Zepplin have? */ | |
| SELECT COUNT(Albumid) AS totalAlbums | |
| FROM albums | |
| WHERE Artistid = (SELECT Artistid FROM artists WHERE name = 'Led Zeppelin') | |
| /* Create a list of album titles and the unit prices for the artist Audioslave */ | |
| SELECT n.Name, u.UnitPrice | |
| FROM ((albums t INNER JOIN artists n | |
| ON t.Artistid = n.Artistid) | |
| INNER JOIN tracks u ON t.Albumid = u.Albumid) |