English | November 27, 2017 | ASIN: B077SNZLK3 | 103 pages | AZW3 | 3.48 MB
This book is all about the SELECT statement, which is often tested in job interviews. It is made up of SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY. We’ll look at when you would use each, and how to remember the order of these clauses. We’ll then look at how you can retrieve SELECT statements, saving them as views and procedures, and creating a connection from SQL Server in Excel. This book is for you if you want to focus on the SELECT statement quickly, or if you want a brief taster of SQL Server, to see if it is right for you.
There are six clauses to the SELECT statement: 1. The SELECT clause identifies the fields you want to retrieve, 2. The FROM clause tells SQL Server the source of the data, 3. The WHERE clause can narrow down the number of rows retrieved, 4. The results can then be summarised using the GROUP BY clause, 5. The HAVING clause can narrow down the summarised results, and 6. The ORDER BY clause then orders the final list.
We'll then encapsulate (save) the query as a view and as a stored procedure. Finally, we'll import the results into Excel, both using copy and paste and as a live connection.
All of this, within 60 minutes. So why not start your SQL Server journey?