Автор: Mark Simon
Издательство: Apress
Год: 2023
Страниц: 390
Язык: английский
Формат: pdf (true), epub, mobi
Размер: 10.1 MB
Learn the basics of writing SQL scripts. Using Standard SQL as the starting point, this book teaches writing SQL in various popular dialects, including PostgreSQL, MySQL/MariaDB, Microsoft SQL Server, Oracle, and SQLite.
The book starts with a general introduction to writing SQL and covers the basic concepts. Author Mark Simon then covers database principles, and how database tables are designed. He teaches you how to filter data using the WHERE clause, and you will work with NULL, numbers, dates, and strings. You will also understand sorting results using the ORDER BY clause, sorting by calculated columns, and limiting the number of results. By the end of the book, you will know how to insert and update data, and summarize data with aggregate functions and groups. Three appendices cover differences between SQL dialects, working with tables, and a crash course in PDO.
This book looks at using SQL for basic tasks. Mostly that means fetching data and possibly processing it. There are many database packages available, all with their own quirks, and all with their own variations of the SQL standard. This book covers a few of the most popular packages and makes a point of showing not only what the standard says but also how the individual packages do things. We’ll also look at how databases are designed, but not because we’ll be designing any. One of the big mysteries to any new SQL user is why do we do things this way or that, and why is the data the way it is. By understanding some design principles, you’ll be in a better position to know why. In this book, we make no assumptions about your prior knowledge, except that you have an idea what a table is. You have probably had some experience with spreadsheets as well.
Throughout the book, you’ll come across a few terms and a few expectations:
• MySQL and MariaDB are essentially the same; MariaDB is an increasingly popular spin-off. With very few exceptions (as noted), the code is interchangeable.
• The book makes a great deal of using MySQL/MariaDB in so-called ANSI mode. This is easily done, as you’ll see in the book, and makes working with standard SQL much easier.
• The Microsoft product will sometimes be referred to as Microsoft SQL Server and sometimes as MSSQL for short. If you’re looking for T-SQL (Transact SQL), it’s also the same thing.
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub.
What You Will Learn:
Filter, sort, and calculate data
Summarize data with aggregate functions
Modify data with insert, update, and delete statements
Study design principles in developing a database
Who This Book Is For:
Developers and analysts working with SQL, as well as web developers who want a stronger understanding of working with databases.
Contents:
Скачать Getting Started with SQL and Databases: Managing and Manipulating Data with SQL