Muutke küpsiste eelistusi

MySQL Crash Course: A Hands-on Introduction to Database Development [Pehme köide]

  • Formaat: Paperback / softback, 352 pages, kõrgus x laius: 234x177 mm
  • Ilmumisaeg: 23-May-2023
  • Kirjastus: No Starch Press,US
  • ISBN-10: 1718503008
  • ISBN-13: 9781718503007
Teised raamatud teemal:
  • Formaat: Paperback / softback, 352 pages, kõrgus x laius: 234x177 mm
  • Ilmumisaeg: 23-May-2023
  • Kirjastus: No Starch Press,US
  • ISBN-10: 1718503008
  • ISBN-13: 9781718503007
Teised raamatud teemal:
With databases lurking in the background of every website, knowing how to manage them with MySQL is a no-brainer. This practical, hands-on introduction teaches readers all they need to know.

This complete guide to all things MySQL will take readers from the absolute basics of creating a table to the complexities of managing an entire database. Learn to build efficient databases through interesting examples, exercises, and three hands-on projects creating databases for weather, voter, and salary data. The book leads readers through all of MySQL’s intricacies, without the technical jargon. It’s designed to help build confidence in creating simple databases and tables before learning more advanced concepts, including how to update and delete data, work with multiple tables, and avoid common mishaps. By the end of the book, readers will be database management pros, who know how to carry out comprehensive data projects with ease.

Arvustused

A fantastic resource for anyone who wants to learn about MySQL . . . and an excellent refresher for more seasoned developers. Scott Stroz, MySQL Developer Advocate

Understand not just the 'what,' but the 'why' behind MySQL development." Steven Sian, Web and Mobile Application Developer

"If youre looking to learn MySQL (and specifically 8.0) quickly and efficiently, Rick Silvas [ MySQL Crash Course] is the perfect resource. With its practical approach, clear examples, and step-by-step guidance, as [ a] developer, this book will help you master MySQL!" Frédéric Descamps, MySQL Architect at Oracle and technical reviewer of MySQL Crash Course

Acknowledgments xix
Introduction xxi
About This Book xxii
Who Is This Book For? xxiv
SQL in MySQL vs. SQL in Other Database Systems xxiv
Using the Online Resources xxiv
PART I Getting Started
1(24)
1 Installing Mysql And Tools
3(6)
The MySQL Architecture
4(1)
Installing MySQL
4(3)
Summary
7(2)
2 Creating Databases And Tables
9(16)
Using MySQL Workbench
9(2)
Creating a New Database
11(1)
Creating a New Table
12(1)
Constraints
13(8)
Indexes
21(1)
Dropping and Altering Tables
22(1)
Summary
23(2)
PART II SELECTING DATA FROM A MYSQL DATABASE
25(132)
3 Introduction To Sql
27(10)
Querying Data from a Table
28(1)
Using the Wildcard Character
29(1)
Ordering Rows
29(2)
Formatting SQL Code
31(1)
Uppercase Keywords
32(1)
Backticks
32(1)
Code Comments
33(2)
Null Values
35(1)
Summary
36(1)
4 Mysql Data Types
37(14)
String Data Types
38(1)
Char
38(1)
Varchar
39(1)
Enum
40(1)
Set
40(1)
Tinytext, text, mediumtext, and longtext
40(3)
Binary Data Types
43(1)
Tinyblob, blob, mediumblob, and longblob
43(1)
Binary
43(1)
Varbinary
43(1)
Bit
44(1)
Numeric Data Types
44(1)
Tinyint, smallint, mediumint, int, and bigint
45(1)
Boolean
46(1)
Decimal Data Types
47(1)
Date and Time Data Types
48(1)
The json Data Type
48(1)
Spatial Data Types
49(1)
Summary
50(1)
5 Joining Database Tables
51(12)
Selecting Data from Multiple Tables
51(2)
Table Aliasing
53(1)
Types of Joins
54(1)
Inner Joins
54(1)
Outer Joins
55(1)
Natural Joins
56(1)
Cross Joins
56(1)
Self Joins
57(2)
Variations on Join Syntax
59(1)
Parentheses
59(1)
Old-School Inner Joins
60(1)
Column Aliasing
60(1)
Joining Tables in Different Databases
61(1)
Summary
62(1)
6 Performing Complex Joins With Multiple Tables
63(22)
Writing One Query with Two Join Types
63(3)
Joining Many Tables
66(2)
Associative Tables
68(1)
Managing the Data in Your Result Set
69(1)
The limit Keyword
70(1)
The union Keyword
70(2)
Temporary Tables
72(3)
Common Table Expressions
75(1)
Recursive Common Table Expressions
76(2)
Derived Tables
78(1)
Subqueries
78(1)
Subqueries That Return More Than One Row
79(2)
Correlated Subqueries
81(2)
Summary
83(2)
7 Comparing Values
85(14)
Comparison Operators
85(1)
Equal
86(1)
Not Equal
87(1)
Greater Than
88(1)
Greater Than or Equal To
88(1)
Less Than
88(1)
Less Than or Equal To
89
Is null
39(50)
Is not null
89(1)
In
90(1)
Not in
90(1)
Between
91(1)
Not between
91(1)
Like
91(2)
Not like
93(1)
Exists
94(1)
Checking Booleans
95(1)
Or Conditions
95(3)
Summary
98(1)
8 Calling Built-In Mysql Functions
99(44)
What Is a Function?
100(1)
Passing Arguments to a Function
100(1)
Optional Arguments
101(2)
Calling Functions Within Functions
103(1)
Calling Functions from Different Parts of Your Query
104(1)
Aggregate Functions
105(1)
Count()
105(1)
max()
106(1)
min()
107(1)
sum()
107(1)
avg()
107(2)
Group by
109(3)
String Functions
112(1)
Concat()
112(1)
Format()
113(1)
Lefty
114(1)
Right()
115(1)
Lower()
115(1)
Upper()
115(1)
Substring()
116(2)
Trim()
118(1)
Itrim()
119(1)
Rtrim()
119(1)
Date and Time Functions
120(1)
Curdate()
120(1)
Curtime()
120(1)
Now()
120(1)
Date_Add()
121(1)
Date_Sub()
121(1)
Extract()
122(1)
Datediff()
123(1)
Date_Format()
123(1)
Strjo_Date()
124(1)
Time_Format()
125(1)
Mathematical Operators and Functions
125(1)
Mathematical Operators
126(2)
Mathematical Functions
128(7)
Other Handy Functions
135(1)
Cast()
135(1)
Coalesced
136(1)
Distinct()
137(1)
Database()
138(1)
If()
138(2)
Version()
140(1)
Summary
141(2)
9 Inserting, Updating, And Deleting Data
143(14)
Inserting Data
143(1)
Inserting Null Values
144(2)
Inserting Multiple Rows at Once
146(1)
Inserting Without Listing Column Names
147(1)
Inserting Sequences of Numbers
147(2)
Inserting Data Using a Query
149(2)
Using a Query to Create and Populate a New Table
151(1)
Updating Data
152(1)
Updating Multiple Rows
153(1)
Updating Multiple Columns
153(1)
Deleting Data
154(1)
Truncating and Dropping a Table
155(1)
Summary
156(1)
PART III DATABASE OBJECTS
157(60)
10 Creating Views
159(6)
Creating a New View
159(2)
Using Views to Hide Column Values
161(2)
Inserting, Updating, and Deleting from Views
163(1)
Dropping a View
163(1)
Indexes and Views
164(1)
Summary
164(1)
11 Creating Functions And Procedures
165(30)
Functions vs. Procedures
165(2)
Creating Functions
167(1)
Redefining the Delimiter
168(2)
Adding Parameters and Returning a Value
170(1)
Specifying Characteristics
171(1)
Defining the Function Body
172(1)
Creating Procedures
173(2)
Using select to Display Values
175(1)
Defining Local Variables and User Variables
176(2)
Using Logic in Procedures
178(6)
Displaying Procedure Results with select
184(2)
Using a Cursor
186(4)
Declaring Output Parameters
190(1)
Writing Procedures That Call Other Procedures
191(1)
Listing the Stored Routines in a Database
192(1)
Summary
193(2)
12 Creating Triggers
195(14)
Triggers That Audit Data
195(1)
After Insert Triggers
196(3)
After Delete Triggers
199(1)
After Update Triggers
200(2)
Triggers That Affect Data
202(1)
Before Insert Triggers
203(1)
Before Update Triggers
204(2)
Before Delete Triggers
206(1)
Summary
207(2)
13 Creating Events
209(8)
The Event Scheduler
210(1)
Creating Events with No End Date
210(2)
Creating Events with an End Date
212(1)
Checking for Errors
213(2)
Summary
215(2)
PART IV ADVANCED TOPICS
217(42)
14 Tips And Tricks
219(18)
Common Mistakes
219(1)
Working in the Wrong Database
220(2)
Using the Wrong Server
222(1)
Leaving where Clauses Incomplete
223(2)
Running Partial SQL Statements
225(1)
Transactions
226(2)
Supporting an Existing System
228(2)
Using the MySQL Command Line Client
230(2)
Loading Data from a File
232(2)
Loading Data to a File
234(1)
MySQL Shell
235(1)
Summary
236(1)
15 Calling Mysql From Programming Languages
237(22)
PHP
238(1)
PDO
239(4)
Object-Oriented MySQLi
243(3)
Procedural MySQLi
246(4)
Python
250(1)
Selecting from a Table
251(1)
Inserting a Row into a Table
252(1)
Calling a Stored Procedure
253(1)
Java
253(1)
Selecting from a Table
254(1)
Inserting a Row into a Table
255(1)
Calling a Stored Procedure
256(1)
Summary
257(2)
PART V PROJECTS
259(54)
16 BUILDING A WEATHER DATABASE
261(16)
Technologies You'll Use
262(1)
Cron
262(1)
Bash
263(1)
SQL Scripts
263(1)
Project Overview
264(1)
The Data File
265(1)
Creating the Weather Tables
266(1)
Data Types
267(1)
Constraints
268(1)
Loading the Data File
269(2)
Copying the Data to Your Final Table
271(3)
Scheduling the Bash Script on cron
274(1)
Alternative Approaches
275(1)
Summary
276(1)
17 Tracking Changes To Voter Data With Triggers
277(24)
Setting Up the Database
278(1)
Creating the Tables
278(1)
The voter Table
279(1)
The ballot Table
280(1)
The race Table
281(1)
The candidate Table
281(1)
The ballot_candidate Table
282(1)
Adding Triggers
283(1)
Before Triggers
284(6)
After Triggers
290(9)
Alternative Approaches
299(1)
Audit Tables
299(1)
Triggers vs. Privileges
299(1)
Replacing check Constraints with New Tables
299(1)
Summary
300(1)
18 Protecting Salary Data With Views
301(12)
Creating the employee Table
301(2)
Creating the View
303(1)
Controlling Permissions
303(1)
Using MySQL Workbench to Test User Access
304(6)
An Alternative Approach
310(1)
Summary
311(2)
Afterword 313(2)
Index 315
Rick Silva is a software developer with decades of database experience. Silva has worked at Harvard Business School, Zipcar, and various financial services companies. A Boston native and a Boston College alum, he now lives in the Raleigh, North Carolina area with his wife Patti and his dog Dixie. When he's not joining database tables, he's playing banjo at a local bluegrass jam.