Publisher's Synopsis
The purpose of the book is to introduce the essential functionalities in SQL, in order to be able to move on with the more advanced possibilities. Only when the basic concepts are known it is possible to learn the more advanced options. This knowledge could be learning about 'The 8 Algebra Operations' to write statements that give the correct result, but also a statement that performs as well as possible. Knowing the basics can help you ignore some of the statements that are posted over and over again on the web and are stated as essential. Consider whether these statements are important to you.
SQL - Structured Query Language - is a standard language for defining and manipulating objects and data in a relational database. There are many implementations of the language and none of these comply with the standard completely. Only the basic constructions are the same in all implementations. Therefore, it is important to know which product and even which version of the product is being used. This book uses Microsoft SQL Server version 2022 syntax. In this book, the focus is primarily on the SELECT statement. Other statements are reviewed and used without knowledge of the details. When developing a SELECT statement, the focus should be as follows in order of priority.- The query must give the correct result in relation to the data currently available in the tables.
- The result must be correct in relation to the data that may be in the tables tomorrow due to new inserts or updates.
- Statements must be written in a way that makes them easy to maintain. This means that it is immediately understandable, and that the various functionalities are used correctly and as intended. But it also means that the many - well-intentioned - suggestions from the web must be evaluated before they are used, to be sure whether they are as smart as claimed.
- The execution of the statement should be acceptable. Not as fast as possible, but fast enough for the purpose it is designed for. But never faster than it still gives a correct result. Solutions also appear on the web that perform very fast but do not necessarily always give the correct result.