
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.
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.
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 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.
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.
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.
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.
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.
Master sql queries to list movie titles and yearly streams for films whose streams are above the genre average.
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.
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.
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.