{"id":20572814,"url":"https://github.com/mouni2619/sql_bolt","last_synced_at":"2026-03-06T23:32:03.565Z","repository":{"id":224094010,"uuid":"762371318","full_name":"mouni2619/SQL_BOLT","owner":"mouni2619","description":"SQLBolt is a free interactive SQL tutorial that teaches SQL concepts and commands through a series of interactive exercises. It covers topics like querying databases, filtering results, joining tables, and more. It's a great resource for beginners to learn SQL in a practical and hands-on way.","archived":false,"fork":false,"pushed_at":"2024-02-23T17:52:36.000Z","size":3445,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T10:25:16.818Z","etag":null,"topics":["sql"],"latest_commit_sha":null,"homepage":"https://github.com/mouni2619/SQL_BOLT/blob/main/sqlbolt.pdf","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mouni2619.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-23T16:34:03.000Z","updated_at":"2024-02-26T05:58:47.000Z","dependencies_parsed_at":"2024-02-23T18:52:44.838Z","dependency_job_id":null,"html_url":"https://github.com/mouni2619/SQL_BOLT","commit_stats":null,"previous_names":["mouni2619/sql_bolt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mouni2619/SQL_BOLT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouni2619%2FSQL_BOLT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouni2619%2FSQL_BOLT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouni2619%2FSQL_BOLT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouni2619%2FSQL_BOLT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mouni2619","download_url":"https://codeload.github.com/mouni2619/SQL_BOLT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mouni2619%2FSQL_BOLT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30203337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sql"],"created_at":"2024-11-16T05:24:04.310Z","updated_at":"2026-03-06T23:32:03.548Z","avatar_url":"https://github.com/mouni2619.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# TASK IS ABOUT SQL BOLT\n\n# Below I provided Notes Regarding SQL BOLT TASK\n\n# SQL Lesson 1: SELECT queries 101\n\n Exercise 1 — Tasks\n\n1)Find the title of each film ✓\n\n SELECT title FROM movies;\n\n2)Find the director of each film ✓\n\n SELECT director FROM movies;\n\n3)Find the title and director of each film ✓\n\n SELECT title,director FROM movies;\n\n4)Find the title and year of each film ✓\n\n SELECT title,year FROM movies;\n\n5)Find all the information about each film ✓\n\n SELECT * FROM movies;\n\n------------------------------------------------------------------------------------------------------------\n\n# SQL Lesson 2: Queries with constraints (Pt. 1)\n\nExercise 2 — Tasks\n\n1)Find the movie with a row id of 6 ✓\n\nSELECT title FROM movies\nwhere id=6;\n\n2)Find the movies released in the years between 2000 and 2010 ✓\n\nSELECT * FROM movies\nwhere year  between 2000 and 2010\n\n3)Find the movies not released in the years between 2000 and 2010 ✓\n\nSELECT * FROM movies\nwhere year not between 2000 and 2010\n\n4)Find the first 5 Pixar movies and their release year ✓\n\nSELECT title,year FROM movies\nwhere  id in (1,2,3,4,5)\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 3: Queries with constraints (Pt. 2)\n\nExercise 3 — Tasks\n1)Find all the Toy Story movies ✓\n\nSELECT title FROM movies\nwhere title like \"%Toy Story%\";\n\n2)Find all the movies directed by John Lasseter ✓\n\nSELECT title FROM movies\nwhere director like \"%John Lasseter%\";\n\n3)Find all the movies (and director) not directed by John Lasseter ✓\n\nSELECT title FROM movies\nwhere director not like \"%John Lasseter%\";\n\n4)Find all the WALL-* movies ✓\n\nSELECT title FROM movies\nwhere title  like \"%WALL-%\";\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 4: Filtering and sorting Query results\n\nExercise 4 — Tasks\n\n1)List all directors of Pixar movies (alphabetically), without duplicates ✓\n\nSELECT distinct director FROM movies order by director; \n\n2)List the last four Pixar movies released (ordered from most recent to least) ✓\n\nSELECT title,year FROM movies order by year desc limit 4 ; \n\n3)List the first five Pixar movies sorted alphabetically ✓\n\nSELECT title,year FROM movies order by title  limit 5 ; \n\n4)List the next five Pixar movies sorted alphabetically ✓\n\nSELECT title,year FROM movies order by title  limit 5 offset 5 ; \n\n------------------------------------------------------------------------------------------------------------\n# SQL Review: Simple SELECT Queries\n\nReview 1 — Tasks\n\n1)List all the Canadian cities and their populations ✓\n\nSELECT city, population FROM north_american_cities\nwhere country like \"canada\";\n\n\n2)Order all the cities in the United States by their latitude from north to south ✓\n\nSELECT * FROM north_american_cities where country like \"%United States%\" order by Latitude desc\n\n\n3)List all the cities west of Chicago, ordered from west to east ✓\n\nSELECT City FROM north_american_cities \nwhere longitude \u003c (\n SELECT  longitude FROM \n north_american_cities\n WHERE city like \"chicago\")\n order by longitude;\n\n\n4)List the two largest cities in Mexico (by population) ✓\n\nSELECT * FROM north_american_cities where country like \"%mexico%\" order by population desc limit 2\n\n\n5)List the third and fourth largest cities (by population) in the United States and their population ✓\n\nSELECT city, population FROM north_american_cities where country like \"%United States%\" order by population desc limit 2 offset 2\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 6: Multi-table queries with JOINs\n\n\nExercise 6 — Tasks\n\n1)Find the domestic and international sales for each movie ✓\n\nSELECT title,Domestic_sales,International_sales FROM Boxoffice \nINNER JOIN Movies   \n    ON Movies .Id = Boxoffice.Movie_id\n    \n\n2)Show the sales numbers for each movie that did better internationally rather than domestically ✓\n\nSELECT * FROM Boxoffice \nINNER JOIN Movies   \n    ON Movies .Id = Boxoffice.Movie_id where International_sales \u003e Domestic_sales\n    \n3)List all the movies by their ratings in descending order ✓\n\nSELECT * FROM Boxoffice \nINNER JOIN Movies   \nON Movies .Id = Boxoffice.Movie_id order by rating desc\n\n ------------------------------------------------------------------------------------------------------------\n\n# SQL Lesson 7: OUTER JOINs\n\nExercise 7 — Tasks\n1)Find the list of all buildings that have employees ✓\n\nSELECT distinct Building FROM employees \n\n2)Find the list of all buildings and their capacity ✓\n\nSELECT  * FROM Buildings \n\n\n3)List all buildings and the distinct employee roles in each building (including empty buildings)  ✓ \n\nSELECT distinct Building_name, role FROM  Buildings  left join Employees on Buildings .Building_name=Employees .Building\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 8: A short note on NULLs\n\n\nExercise 8 — Tasks\n1)Find the name and role of all employees who have not been assigned to a building ✓\n\nSELECT Name,role FROM employees\nwhere building is null;\n\n2)Find the names of the buildings that hold no employees ✓\n\nSELECT * from Buildings left join Employees on Buildings.Building_name = Employees .Building where Years_employed is null\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 9: Queries with expressions\n\nExercise 9 — Tasks\n\n1)List all movies and their combined sales in millions of dollars ✓\n\nSELECT title, (Domestic_sales+International_sales)/1000000 as sales \nFROM movies\ninner join Boxoffice on movies.id = Boxoffice.Movie_id ;\n\n2)List all movies and their ratings in percent ✓\n\nSELECT title,rating*10 as ratings\nFROM movies\ninner join Boxoffice on movies.id = Boxoffice.Movie_id ;\n\n3)List all movies that were released on even number years ✓\n\nSELECT title, year\nFROM movies\ninner join Boxoffice ON movies.id=Boxoffice.Movie_id\nWHERE year%2=0\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 10: Queries with aggregates (Pt. 1)\n\nExercise 10 — Tasks\n\n1)Find the longest time that an employee has been at the studio ✓\n\n  SELECT max(Years_employed) FROM employees;\n\n2)For each role, find the average number of years employed by employees in that role ✓\n\n  SELECT avg(Years_employed) as avg_employee, role FROM employees group by role;\n\n3)Find the total number of employee years worked in each building ✓\n\n  SELECT Building,sum(Years_employed) FROM employees group by building\n\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 11: Queries with aggregates (Pt. 2)\n\nExercise 11 — Tasks\n\n1)Find the number of Artists in the studio (without a HAVING clause) ✓\n\nSELECT count(Role) as number_of_Artists FROM employees\nwhere role= \"Artist\";\n\n2)Find the number of Employees of each role in the studio ✓\n\nSELECT role, count(Role) as number_of_Artists FROM employees\ngroup by role\n\n3)Find the total number of years employed by all Engineers ✓\n\nSELECT  role, sum(years_employed) as number_of_Artists FROM employees\ngroup by role HAVING role=\"Engineer\"\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 12: Order of execution of a Query\n\nExercise 12 — Tasks\n\n1)Find the number of movies each director has directed ✓\n\nSELECT director, count(*) as director_movies FROM movies\ngroup by director;\n\n2)Find the total domestic and international sales that can be attributed to each director ✓\n\nSELECT director, sum(International_sales+Domestic_sales) as director_movies\nFROM movies inner join Boxoffice\non Movies .id= Boxoffice.Movie_id\ngroup by director;\n\n------------------------------------------------------------------------------------------------------------\n\n# SQL Lesson 13: Inserting rows\n\nExercise 13 — Tasks\n\n1)Add the studio's new production, Toy Story 4 to the list of movies (you can use any director) ✓\n\nINSERT INTO Movies \nVALUES (4, \"Toy Story 4\",\"John Lasseter\",2,80);\n\n2)Toy Story 4 has been released to critical acclaim! It had a rating of 8.7, and made 340 million domestically and 270 million internationally. Add the record to the BoxOffice table. ✓\n\nINSERT INTO Boxoffice  \nVALUES (4, \"8.7\",340000000,270000000)\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 14: Updating rows\n\nExercise 14 — Tasks\n\n1)The director for A Bug's Life is incorrect, it was actually directed by John Lasseter ✓\n\nUPDATE Movies\nSET Director = \"John Lasseter\"\n   where title=\"A Bug's Life\"\n\n2)The year that Toy Story 2 was released is incorrect, it was actually released in 1999 ✓\n\nUPDATE Movies\nSET year = 1999\n   where title=\"Toy Story 2\"\n\n3)Both the title and director for Toy Story 8 is incorrect! The title should be \"Toy Story 3\" and it was directed by Lee Unkrich ✓\n\nUPDATE Movies\nSET director = \"Lee Unkrich\",\ntitle=\"Toy Story 3\"\n   where title=\"Toy Story 8\"\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 15: Deleting rows\n\nExercise 15 — Tasks\n\n1)This database is getting too big, lets remove all movies that were released before 2005. ✓\n\n  DELETE FROM Movies\n  WHERE year\u003c2005;\n\n2)Andrew Stanton has also left the studio, so please remove all movies directed by him. ✓\n\n DELETE FROM Movies\n WHERE Director=\"Andrew Stanton\";\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 16: Creating tables\n\nExercise 16 — Tasks\n\n1)Create a new table named Database with the following columns:\n– Name A string (text) describing the name of the database\n– Version A number (floating point) of the latest version of this database\n– Download_count An integer count of the number of times this database was downloaded\nThis table has no constraints. ✓\n\n\n CREATE TABLE Database (\n name text,\n version float,\n download_count integer\n );\n\n------------------------------------------------------------------------------------------------------------\n# SQL Lesson 17: Altering tables\n\nExercise 17 — Tasks\n\n1)Add a column named Aspect_ratio with a FLOAT data type to store the aspect-ratio each movie was released in. ✓\n\n ALTER TABLE Movies\n ADD Aspect_ratio FLOAT \n    DEFAULT 16;\n\n2)Add another column named Language with a TEXT data type to store the language that the movie was released in. Ensure that the default for this language is English. ✓\n\n ALTER TABLE Movies\n ADD Language  TEXT  \n DEFAULT English;\n\n------------------------------------------------------------------------------------------------------------\n\n# SQL Lesson 18: Dropping tables\n\nExercise 18 — Tasks\n\n1)We've sadly reached the end of our lessons, lets clean up by removing the Movies table ✓\n\n DROP TABLE IF EXISTS Movies ;\n\n2)And drop the BoxOffice table as well ✓\n\n DROP TABLE IF EXISTS BoxOffice  ;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmouni2619%2Fsql_bolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmouni2619%2Fsql_bolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmouni2619%2Fsql_bolt/lists"}