Learn-SQL
Learn-SQL copied to clipboard
Exercises for beginners to learn SQL
The data.sql file should not have the "id" column values as the "id" column has been set to be a primary key and auto_increment. Or am I missing something trivial...
First off, thanks for creating this repo. It really has helped me a lot in getting started with SQL. Now as posted in the solutions for exercise 7, the solution,...
since the **LIMIT** keyword do not exist in sql server you can use this syntaxe to solve the problem `SELECT * FROM albums WHERE release_year = (SELECT MIN(release_year) FROM albums)`
I'm still learning SQL so maybe my solution doesn't work under other conditions but in the case of the data given, it's valid.
MySQL
The solution for exercise 5 didn't work for me, it returned an error, so I thought that I could submit a fix. Thank you.
Solution query doesn't give any result for me. I changed between primary keys doesn't help. Help please
Given: SELECT bands.name AS 'Band Name' FROM bands LEFT JOIN albums ON bands.id = albums.band_id GROUP BY albums.band_id HAVING COUNT(albums.id) = 0; Instead it should be: SELECT bands.name AS 'Band...
/*SOLUTION 5*/ SELECT bands.name AS "band name" FROM bands LEFT JOIN albums ON bands.id=albums.band_id GROUP BY bands.name HAVING COUNT(albums.id)=0; /*including bands.name in group by is important as it is in...