SQL Query questions and answers

Hello Experts,

Can someone let me know if there is a repository where I can lots of SQL Queries with answers?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
I'm not sure what you are asking.

There is a LOT of answered questions here if you look through the Topic Areas.

If you are looking for some sort of exam prep for SQL, there are a few if you Google around.

SQL also varies from database to database.  What database are you interested in?
Member_2_7966113Author Commented:
Sorry for the badly worded question.

I’m looking for repository of SQL queries with answers to the queries.

As regards industry, I looking for sql queries in hospitality eg NHS

slightwv (䄆 Netminder) Commented:
Sorry but that doesn't help clear things up.

These mean the same thing:
"repository where I can lots of SQL Queries with answers?"
"repository of SQL queries with answers to the queries"

I do not know what you are looking for.

So browsing the SQL Topic Area here for answered questions isn't what you are wanting?

Click on Browse, then Solutions.  There you can select the Topic:

>>As regards industry, I looking for sql queries in hospitality eg NHS

I didn't ask for industry.  I asked for the database product you wanted this SQL for.  Each database product has its own unique tweaks to the ANSI standard.

I also have no idea what NHS means.
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

PortletPaulEE Topic AdvisorCommented:
Judging by former questions from Member_2_7966113 the database might be Microsoft SQL Server. Occasionally SQL Server users refer to that database by the abbreviation  "SQL" and assume we know what that means.

SQL became a standard of the American National Standards Institute (ANSI) in 1986, ...

Despite the existence of such standards, most SQL code is not completely portable among different database systems ...

The reason why we ask to know "which database?" is because the syntax needed in (say) MS SQL Server is very different to PostgreSQL or Oracle etc. nb: The tag "SQL" does NOT indicate MS SQL Server.

If I see "NHS" I think of "National Health System" in the UK.  It could mean "National Highway System", but I believe it is more likely to be the former.
Geert GOracle dbaCommented:
the querries are questions for the database
the answers are what the database returns as data

the answers will differ depending on what data is in the database ...
Geert GOracle dbaCommented:
NHS = Not a Heating System ?
Member_2_7966113Author Commented:
Really sorry guys .. I tend to think everyone at EE lives in England @-)

NHS, means National Health Service.

So, let me try again and explain what I'm looking for with examples.

There is a book called Query Answers with SQL Server. Each chapter in that book has a query and an answer to the query, however the book relates to car industry. If you take a look inside the book from Amazon you will see what I mean https://www.amazon.co.uk/Query-Answers-SQL-Server-Depth-ebook/dp/B07DVVGFL7/ref=sr_1_1?ie=UTF8&qid=1539681984&sr=8-1&keywords=query+answers+with+sql+server+volume+ii+in+depth+querying

I looking for something similar pertains to the Healthcare industry. As I couldnt find a book I was hoping that someone from EE could point me to link with a library of various SQL Queries and Answer to  various industries including the Healthcare industry.

Does that make sense?
PortletPaulEE Topic AdvisorCommented:
Good luck locating such a specific book.

(I'm currently thinking of little britain... Margroot, do we have a purple pirate game for 14 year olds?)

Most texts will stick to "generic" topics in the expectation you can extrapolate to your own situation.
slightwv (䄆 Netminder) Commented:
Personally, I wouldn't spend money on that book.  They rely way too much on inline views that hit the same base tables used in the outer query.

Many of those can be rewritten to take advantage of WINDOW functions and only access the tables once.

That said:
I understand the desire to learn SQL in a filed where you will be applying it but data is data is data.  SQL to access the data is SQL.

Learning how to compute average repair costs on a Ferrari should be pretty much the same as computing the average cost of a heart transplant.  Except the Ferrari is cheaper...  ;)
Member_2_7966113Author Commented:
Slightwv you make a good call comment.

Therefore, do you of any links to any databases that I can download and practice on?

slightwv (䄆 Netminder) Commented:
Oracle and SQL Server both have free versions.

MySQL is free.

I cannot say for sure but I would bet most products also have them.

Oracle Express Edition:

SQL Server Express:

Oracle also has a pretty liberal development and education license if the Express Edition doesn't have a component you wish to experiment with.  For basic SQL, it should be fine.
Member_2_7966113Author Commented:
Hi Slightwv, I don’t I made myself clear.

I meant sample databases like a sample sales, marketing etc database of tables that I can download and attach to my SQL server and run queries on.

Does that make sense?
slightwv (䄆 Netminder) Commented:
Sorry but I don't know SQL Server.

Oracle has several sample schemas you can install:  HR, OE, PM, IX, and SH.

A quick Google points me to a WideWorldImporters  and AdventureWorks samples for SQL Server:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Member_2_7966113Author Commented:
Thanks slightwv
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.