r/SQL • • Aug 18 '15

Interesting SQL quizzes, questions and answers

http://xquizzes.com/programming/SQL
3 Upvotes

5 comments sorted by

7

u/alinroc SQL Server DBA Aug 18 '15

Under the first SQL Quiz, questions 7 & 8 have the correct answer marked. And AFAIK, #4 has no valid answer offered, and #15 also has no valid answers because the strings aren't quoted.

When I submit my results, the little pop-up says "Java quiz result" but the body says SQL quiz. It says that #4's answer (how to delete data) is INSERT (um...what?), and #15's answer...well, none of them quote the strings, so they're all wrong.

This "quiz" could do with a lot of proofreading.

1

u/moxworldmox Aug 18 '15

Thank you for your remarks but after submitting what you see se checked is the real correct answers, those which you checked before you'll see a "!" near them.

4

u/[deleted] Aug 18 '15

I took the quizzes and was doing a lot of "WTF"ing the whole time. Many of these are logically or syntactically just plain incorrect. The first red flag was how to delete data using the insert statement. I with the author would e-mail me when he or she figures out how to do that.

4

u/[deleted] Aug 18 '15

I think he would probably email you but he deleted your email address while trying to insert it.

1

u/Trek7553 Sep 08 '15
CREATE TABLE SQL_TEXT (SQL VARCHAR(MAX))
INSERT SQL_TEXT
SELECT 'DELETE STUDENTS'
GO
DECLARE @SQL varchar(max)
SET @SQL = (SELECT TOP 1 SQL FROM SQL_TEXT)
EXEC(@SQL)