Link to home
Start Free TrialLog in
Avatar of Member_2_7966113
Member_2_7966113

asked on

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?

Thanks
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

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?
Avatar of Member_2_7966113

ASKER

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


Thanks
Sorry but that doesn't help clear things up.

These mean the same thing:
"repository where I can lots of SQL Queries with answers?"
and
"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:
https://www.experts-exchange.com/searchResults.jsp?rtid=10&sort=10_-1&searchDisplayTypeID=1&searchTitle=&searchRow=1&clauseTypeId1=70&searchInclude1=true&questionStatusId1=40&searchTopicId=522769

>>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.
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 ...
Wikipedia/SQL

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.

---------------
@slightwv
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.
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 ...
NHS = Not a Heating System ?
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?
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.
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...  ;)
Slightwv you make a good call comment.

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

Thanks
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:
https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

SQL Server Express:
https://www.microsoft.com/en-us/sql-server/sql-server-editions-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.
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?
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks slightwv