Giter Site home page Giter Site logo

smpetersgithub / advancedsqlpuzzles Goto Github PK

View Code? Open in Web Editor NEW
495.0 495.0 70.0 12.75 MB

Welcome to my GitHub repository. I hope you enjoy solving these puzzles as much as I have enjoyed creating them.

Home Page: https://advancedsqlpuzzles.com

TSQL 100.00%
problems puzzles questions sql sql-query sql-server sqlserver

advancedsqlpuzzles's People

Contributors

smpetersgithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advancedsqlpuzzles's Issues

Convert DDL to Snowflake - Not an issue any more, just some code others might benefit from.

Scott:

Love your product! But forget this request. Short version, I use Snowflake, and I need to make some tweaks to get it there, but I'm good.

For reference, here is what I run to get on Snowflake:

        #
        # Convert SQL Server to Snowflake.
        #
        sed -i 's/SET NOCOUNT ON;//g' puzz.sql     # Directive at the top.
        sed -i 's/\[/\"/g' puzz.sql                # Replace opening bracket.
        sed -i 's/\]/\"/g' puzz.sql                # Replace closing bracket.
        sed -i 's/, Year)/, "Year")/g' puzz.sql    # One more in the PK clause.
        sed -i 's/^GO$//g' puzz.sql                # SQL Server's "Go" command.
        sed -i 's/MONEY/DECIMAL(38,4)/g' puzz.sql  # Change MONEY to DECIMAL.
        sed -i 's/USE test;//g' puzz.sql           # Stay in one database.
        sed -i 's/MAX/4000/g' puzz.sql             # Really big string.

Thanks!

James

Puzzle 21: Average Monthly Sales

It should be changed from this

Iowa would not show in the result set because Customer ID 3003 did
not have an average monthly value over $100 in May 2018.

to this in the problem statement

Iowa would not show in the result set because Customer ID 4004 did
not have an average monthly value over $100 in May 2018.

Simply change the CustomerID from 3003 to 4004. In May, 4004 has an average sales of 75 and 3003 doesn't even exist.

Puzzle 35

Hey,
I really appreciated you work, but there is a missing solution to puzzle 35 in file named 'Advanced SQL Puzzles Solutions'.
Instead of solution there is alternative answer to to puzzle 34.

Puzzle 1 - Dance Partners

The text for puzzle 1 states:

“Note there is a mismatch in the number of students, as one female student will be left without a dance partner. Please include this individual in your list as well.”

Shouldn’t this state “… as one male student will be left without …”?

Two minor errors in Advanced SQL Puzzles DDL.sql

Love this project!!!

In the file Advanced SQL Puzzles DDL.sql, there are two minor errors:

  • Line 335 should be /* to start the comment rather than just *.
  • Line 646 has an extra comma at the end.

Not sure if these cause issues in SQL Server, but when I run them on Snowflake, they do, and they're tricky to fix with sed, so hoping you can fix them in the source.

I have to make a bunch of other changes to work in Snowflake, but the syntax is distinct enough that it's not an issue.

Thanks!

Advanced SQL Puzzles DDL.sql

Hi!

Found a few small issues in "In Advanced SQL Puzzles DDL.sql" file. Mostly re. uppercase/lowercase which my server is sensitive to.

  • Row 284 - The query referes to "Workflow" instead of "WorkFlow".
  • Row 334 - A CRLF between / and * is breaking the comment
  • Row 1075 - "StartDAte" instead of "StartDate"
  • Row 1126 - "ScheduleID" instead of "ScheduleId"
  • Row 1134 - "ScheduleID" instead of "ScheduleId" and "StartTIme" instead of "StartTime"

/Mike

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.