
Master SQL interview questions by restricting and sorting data, joining multiple tables, using aggregating functions and subqueries, with live testing on Replit using SQLite or MySQL.
Build a table of movies and display all its records
List all movies in alphabetical order
-- Write a query to list all movie titles that have been streamed not in the range 0 to 100,000 times
-- Write a query to list all movie titles that have been streamed not in the range 0 to 100,000 times
-- Write a query to list the titles of all movies that have both an "a" and "o" in their title.
-- Write a query to list the title, genre, and number of streams for all movies whose genre is that of Science Fiction or Fantasy, and whose number of streams is not equal to 0 or 1
-- Write a query to list the movie titles, genre and number of streams that have exactly 7 characters in the title
-- Write a query to list the movie titles, genre and number of streams that have ‘e’ as the second character in the title
-- Write a query to list the genres available in the Movies table.
-- Write a query to list the titles, number of yearly streams, and number of monthly streams (1/12 of yearly streams) of all movies
-- Write a SQL query to find all numbers that appear at least three times consecutively.
Join the movie streams and viewers tables on viewer_id to list movie titles with viewer countries. Practice selecting from two tables, using the hinge point to display joined data.
Master the join two tables challenge by using a natural join to connect the movies table with the genres table, retrieving each movie's title, yearly streams, and genre name.
Solve a sql self-join to list each employee's first and last name with their manager id, first name, and last name by joining the employees table to itself.
List the department id, department name, and supervisor first name by inner joining departments and employees on the department supervisor id equals the employee id.
Learn to join three tables to list department name, manager name, and city by linking departments to employees on supervisor id, and to locations on location id.
Compute the average account amount by joining bank customers with bank accounts and grouping by account name to show the average across customers.
Discover how to display the difference between an employee's hourly wage and their job's minimum hourly wage by joining the employees and jobs tables and subtracting values.
List job history records for employees with hourly wage greater than 40 by joining the employees table and the job history table on employee_id, then filtering with where.
Solve the product sales analysis question by joining the product and sales tables on product_id to display product name, year, and price for sold products.
Learn to list bank customers who joined after norma blank by self-joining the bank customers table, selecting first name, last name, and join date.
Compute the capital gain or loss per stock in SQL by grouping by stock name and using a case statement to sum buys as negative and sells as positive.
Learn how to count distinct genres in a movies table using the count function with distinct, selecting from the movies table to return the number of unique genres.
Use the sum function to compute the total yearly streams from the movies table, summing the yearly streams column. See a practical SQL aggregation example and related extension ideas.
Use the min aggregate function in SQL to find the smallest yearly streams value across the movies table.
Learn to compute the maximum yearly streams for science fiction movies using the SQL max function with a where clause to filter genre, and test the query.
Learn to compute the average yearly streams and count of fantasy genre movies using SQL aggregate functions, with a practical example and validation.
Learn how to count movies by genre using count and group by in a movies table. Build queries that return the number of movies per genre from six inserted records.
Calculate the difference between the highest and lowest yearly streams in the movies table using max and min, then subtract min from max to return the result.
Write a SQL query that finds the minimum yearly streams for each genre by grouping on genre, using min and order by, and handling null or empty genres.
Learn to write a SQL query that sums yearly streams by genre, using group by to produce total streams per genre from the movies table.
Compute the average yearly streams per genre in SQL using select, group by, and a where clause to exclude fantasy, with examples from a movies table.
Learn to query the movies table to obtain the total, max, min, and average yearly streams for the science fiction genre using sum, max, min, and avg.
Write a SQL query that lists each genre with its maximum yearly streams, filtered by having max(yearly_streams) >= 600000, using group by and the max function on the movies table.
Learn to compute the average yearly streams per genre with a count filter, using group by and having to show only genres with more than two movies.
Use a subquery to find movies with yearly streams greater than Soldier of the Dead, returning the title and its yearly streams.
Learn to solve the find all of a type sql question with a subquery listing movie titles from the movies table where genre_id matches science fiction in the genres table.
Write a SQL query to list movie titles with yearly streams greater than the average. Use a subquery on the movies table to compare each record to the average.
List movie titles and yearly streams where a movie’s streams equal the genre minimum, using a subquery on the movies and genres tables linked by genre id.
Query movie titles and yearly streams for non-fiction films with above-average streams, using subqueries to compute the average and filter by genre, with examples like Leonardo Da Vinci.
List all movies with more yearly streams than appearance of the aliens by using a subquery to fetch its streams and compare against every movie's title and yearly streams.
List movie titles and yearly streams that match the overall minimum across all movies using a subquery with the min function. Enemies of the Legacy appears with 300,000 streams.
Master sql queries to list movie titles and yearly streams for films whose streams are above the genre average.
List the third maximum number of yearly streams from the movies table using distinct values, and join with the genres table on the genre idea property when required.
Learn to write a SQL query to find the second minimum number of yearly streams in the movies table by selecting distinct yearly streams and comparing records.
Learn to select the last k records from a table using the movies table: order by movie_id desc and limit 3, then order by movie_id asc.
Learn to list all genres with no movies by querying the genres table for genre id not in the movies table, using a not in subquery example.
Learn to extract the three largest distinct yearly streams from the movies table using nested constraints and ordering, ignoring the unrelated genres data.
Learn how to get the two minimum yearly streams from the movies table using a k minimum values query, including comparing m1 and m2 values and ordering results.
Identify products never sold by using a not in subquery to list product names from the product table whose ids are not in the sales table.
Learn SQL to identify the winning candidate by counting votes per candidate, joining the candidate name table, and returning the top result with a descending count.
Master a three-table sql query to list customers' first and last names in Florida by joining the bank customers, bank branches, and locations tables.
Apply a subquery to identify employees who act as supervisors by matching employee IDs with supervisor IDs, then return their first name and last name.
Refresh your SQL knowledge and solve new problems with the most common beginner interview questions asked by FANG companies.
Ultimate Coding Interview Prep
Learn the most commonly asked questions by the likes of Facebook, Google, Amazon and Spotify for beginners.
Preparing for the SQL portion of the interview is hard. You need to understand not only concepts but also be able to articulate your thought process as you plan and execute a solution.
A SCHOOL YOU CAN TRUST
Lifetime access that never expires
Project-based curriculum to superboost your portfolio
Graduation certificate for every course
Absolute beginner-friendly
New courses every month
Efficient lectures with step by step explanations
Relevant industry topics 8 years of award-winning course delivery
800,000 students in 186 countries
Learn with free tools and affordable courses
REVIEWS OF MAMMOTH COURSES
Captivating voice, easy to follow at a rapid pace, get some paper and fasten your seat-belts. I'm enjoying every second of this.
— PHILIP MURRAY
I have completed many Udemy tutorials. This one is the most outstanding one that I have seen thus far. It is doubtful that it could be topped. This is a superior tutorial. Amazing.
— JOSEPH APPLEGARTH
COURSE AUTHOR
Alexandra Kropova, Software Developer at Mammoth Interactive INC.
Alexandra Kropova is a software developer specializing in OOP and JavaScript, with extensive experience in full-stack web development and app development. She has helped produce courses for Mammoth Interactive INC. since 2016, including the Coding Interview series in Java, JavaScript, C++, C#, Python and Swift.