Skip to main content

Questions tagged [sql]

For challenges related to structured query language (SQL), including but not limited to short sql code, query result challenges or fixing invalid queries. Note that challenges that require the answers to be in a specific language are generally discouraged.

Filter by
Sorted by
Tagged with
8 votes
6 answers
949 views

I was thinking when SQL can be less verbose than traditional programming languages and came up with this challenge. Input Natural number N Generating data We ...
Dr Y Wit's user avatar
  • 519
1 vote
1 answer
279 views

Challenge You find yourself in a bash terminal, and want to do some simple tests on sqlite3. So you issue the following command: ...
ChrisB's user avatar
  • 119
7 votes
2 answers
317 views

In as few bytes as possible in t-sql, return 100 rows containing the phrase 'Have a great Christmas' 92 (I think) to beat :D ...
JakeDanzels's user avatar
8 votes
3 answers
726 views

I've invented an SQL-like language. Let's call it SelectQL. You can't INSERT anything, you can only SELECT, and I don't have the ...
bigyihsuan's user avatar
  • 11.5k
5 votes
1 answer
411 views

We all know and love the corpulent DDL expressions one can write in PostgreSQL with wording like DEFERRABLE INITIALLY DEFERRED, ...
ggPeti's user avatar
  • 211
13 votes
0 answers
624 views

I was looking for this page to help me enhance my first answer with SQLite, but I couldnt find one. So here we are! What general tips do you have for golfing in SQLite? I'm looking for ideas that can ...
aloisdg's user avatar
  • 2,107
20 votes
10 answers
4k views

I found it quite hard to achieve a range of numbers as rows in MySQL. For example the range 1-5 is achieved by: ...
Dimgold's user avatar
  • 353
21 votes
16 answers
7k views

What general tips do you have for golfing in T-SQL? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to T-SQL. Please post one tip per ...
Michael B's user avatar
  • 1,631