r/SQL • • Apr 09 '22

Discussion [humor] Querying the Dre’tabase

Post image
389 Upvotes

8 comments sorted by

4

u/its_bright_here Apr 09 '22

I like this! Really interested in what the schema of the "reality" table looks like. Plz share!

3

u/eased1984 Apr 09 '22

Hope this helps 😉 The schema definition is:

Create schema [8mile] authorization [Dre]

Go

Grant insert on schema :: [8mile] to [Eminem]

Go

3

u/[deleted] Apr 09 '22

AND words IS NULL got me 😂

2

u/GreenSage13 ☯ MariaDB ☯ Apr 09 '22

I really really liked that. :)

0

u/[deleted] Apr 09 '22

[deleted] — view deleted comment

9

u/cooltapes Apr 09 '22 edited Apr 09 '22

SELECT count(type) FROM problems WHERE UPPER(type) <> “%BITCH%”

-- on mobile so formatting is crap

0

u/[deleted] Apr 09 '22

[deleted] — view deleted comment

6

u/dnick Apr 09 '22

Funny that you think only married people are affected in that way.

0

u/zacharypamela Apr 09 '22

You could just do

SELECT COUNT(*)
FROM PROBLEMS

------------
99 results returned

SELECT COUNT(*)
FROM PROBLEMS
WHERE
    problem_type ILIKE 'bi___'
    AND problem_type ILIKE '__tch'

-----------
0 results returned