AI Hints
Home›SQL Tutorial›Interview Questions, Part 3
SQL · Lesson 103 of 126

Quick-Fire Quiz

Test yourself.

⏱ 2 min read▶ Video at 2:25:13🎓 Free
Watch this lesson in the SQL courseWatch on YouTube ↗Full SQL course

Let's finish the interview section with a quick fire quiz. Five questions. Pause before each answer, and say it out loud, just like in a real interview.

Quick-Fire Quiz
From the video: Quick-Fire Quiz
  • Five questions
  • Pause before each answer
  • Say it out loud

Question 1

Question one. Which clause runs first, when SQL processes a query? Pause and choose. The answer is C. From runs first, to pick the tables. Select runs much later, which is why you can't use a select alias in where.

Quick check
Which clause runs first?

Question 2

Question two. A table has one hundred rows, and the email column has ten nulls. What does count of email return? Pause and choose. The answer is B, ninety. Count of a column skips nulls.

Quick check
COUNT(email): 100 rows, 10 NULL emails

Question 3

Question three. Which function gives tied values the same number, and leaves no gaps after them? Pause and choose. The answer is D, dense rank. Rank would leave a gap.

Quick check
Ties share a number, no gaps afterwards

Question 4

Question four. What does an index mainly speed up? Pause and choose. The answer is A. Indexes speed up finding rows, with where and join. They actually make inserts a little slower.

Quick check
An index mainly speeds up ...

Question 5

Last one. You run update books, set price equals ten, and forget the where clause. What happens? Pause and choose. The answer is C. Every book now costs ten dollars. That's why we always write the where first.

Quick check
UPDATE books SET price = 10; (no WHERE)

Summary

How did you do? If you got four or five, you're ready for SQL interviews. Next, the errors you'll see, and how to fix them fast.

Key takeaways
  • Execution order
  • COUNT and NULLs
  • Ranks, indexes, WHERE
Next up: Reading Error Messages — fix mistakes fast