Download our latest
Android and iPhone apps ...
At a glance ...
Pages
280
Exercises
10
Sections
15
Public
On-Site
Level
1
Days
2

Course Name: MySQL

Duration:
Minimum skill level required:
On-Site course:
Public course:
Sections:
No of exercises:
No of pages in the manual:
Pre-Requisite course(s):
Suggested further course(s):
Price guide:
2 days
1 (1 - Beginner, 2 - Experienced 3 - Advanced)
Yes
No
15
10
280
PHP
None
Contact us for the latest pricing

Synopsis for course

This is the course to take if you need to further your PHP knowledge by learning how to access a MySql database within it.

The course expects the delegate to be already conversant with PHP techniques and teaches the Delegate how to use this knowledge to communicate with the MySQL database.

Exercise highlights

Selecting and limiting records in MySQL
Joining Tables in MySQL
Creating indexes in MySQL
Exporting and importing using a MySql database

Course Contents

Section
Section Name
Pages

One
Introduction to MySql
2

 
- What is SQL used for ?
3

 
- Why use MySql with PHP ?
4

 
- Definition of a Database
5

 
- Using MySql with PHP
6

Two
Simple MySql Queries in PHP
8

 
- Introduction
9

 
- Show Tables
10

 
- Show Columns
14

 
- Describe
17

 
- Selecting Data from a Table
18

 
- Counting records in a Table
21

 
- Selecting Data from a Table
23

 
- Selecting Columns from a Table
24

 
- Selecting Literals from a Table
25

 
- Selecting Literals from Dual
26

 
- Exercise One
27

 
- Column Manipulation with MySql Functions
29

 
- Concatenating Columns in MySql
33

 
- Performing Calculations in MySql
34

 
- Using Variables in MySql
35

 
- Using mysqli_fetch_array()
37

 
- Using Aliases in MySql
38

 
- Ordering Data in MySql
41

 
- Ordering more than One Column
43

 
- Manipulating Dates using date_add()
44

 
- Displaying Dates using date_format()
46

 
- Exercise Two
48

Three
MySQL Errors
56

 
- Determining Errors in the SQL
57

 
- Using mysqli_errno() and mysqli_error()
58

Four
Limiting Data Selected with a Where Clause
59

 
- Limiting Data in MySql
60

 
- Different types of MySql Where Clauses
62

 
- Using Table Aliases
73

 
- Combining Where Clauses
75

 
- Different types of MySql Where Clauses
76

 
- Handling Nulls in Where Clauses
77

 
- Using Functions in Where Clauses
78

 
- Using PHP Variables in Where Clauses
80

 
- Exercise Three
81

Five
Aggregating Values in MySQL
85

 
- Introduction
86

 
- Using Group By
88

 
- Using Having with Group By
90

 
- Using With Rollup to Total Grouping
91

 
- Using Distinct()
92

 
- Exercise Four
93

Six
Regular Expressions in MySql
96

 
- Introduction
97

 
- Testing for 'Contains' within a String
98

 
- Starts or Ends using Line Anchors
99

 
- Starts and Ends using Line Anchors (or)
100

 
- Using the Dot (Any Character)
101

 
- Using {Intervals}
102

 
- Using Character Lists []
104

 
- Using Character Lists to exclude matches
107

 
- POSIX
108

 
- Using the Question Mark (Optional)
110

 
- Using the Plus sign (Mandatory)
112

 
- Using the Star sign (Optional)
113

 
- Exercise Five
114

Seven
Joining Tables in an SQL Statement
116

 
- Introduction
117

 
- Linking Tables in an SQL Statement
118

 
- Theta style of SQL
123

 
- ANSI style of SQL
124

 
- Problems with Data matching
125

 
- Problems with Joining Tables in SQL
126

 
- Ansi SQL Standards (Natural Joins)
127

 
- Ansi SQL Standards (Cross Joins)
128

 
- Ansi SQL Standards (Joins/Using)
129

 
- Ansi SQL Standards (On)
130

 
- Ansi SQL Standards (Multiple On)
131

 
- Ansi SQL Standards (Left Outer Joins)
132

 
- Ansi SQL Standards (Right Outer Joins)
133

 
- Merging Tables in MySql
134

 
- Using Union to Merge Tables in MySql
135

 
- Using Union All to Merge Tables in MySql
136

 
- Using Intersect to Merge Tables in MySql
137

 
- Using Minus to Merge Tables in MySql
138

 
- Knowledge Check
139

 
- Knowledge Check - Union
140

 
- Union Syntax in MySql
141

 
- Knowledge Check - Union All
142

 
- Union All Syntax in MySql
143

 
- Knowledge Check - Intersect
144

 
- Intersect Syntax in MySql
145

 
- Knowledge Check - Minus
146

 
- Minus Syntax in MySql
147

 
- Using the Merge Syntax in MySql
148

 
- Exercise Six
149

Eight
Advanced MySql Query Techniques
154

 
- Using Limit in MySql
155

 
- Using If() in MySql
157

 
- Using Ifnull() in MySql
158

 
- Using Nullif in MySql
159

 
- Using Case Function in SQL
160

 
- Using Sub-queries
164

 
- Using Set to create variables
167

 
- Populating a Variable from a Query
168

 
- Exercise Seven
170

Nine
MySQL Datatypes
173

 
- Introduction
174

 
- Numeric Datatypes (Integer)
175

 
- Numeric Datatypes (Decimal)
176

 
- String Text Datatypes
177

 
- String Blob Datatypes
178

 
- String List Datatypes
179

 
- Date Datatypes
180

Ten
Creating Database Objects in MySql
181

 
- Creating Tables in MySql
182

 
- Mandatory Columns in MySql Tables
183

 
- Creation Syntax for Tables in MySql
184

 
- Column Creation in MySql
187

 
- Drop Table Syntax
189

 
- Temporary Tables in MySql
190

 
- Creating Indexes in MySql
192

 
- Primary Key Creation in MySql
195

 
- Unique Key Creation in MySql
198

 
- Foreign Key Creation in MySql
201

 
- Creating Views in MySql
203

 
- Renaming Views in MySql
206

 
- Dropping Views in MySql
207

 
- Exercise Eight
208

Eleven
Altering in MySql
210

 
- Altering Tables
211

Twelve
Inserting and Altering Data in MySql
214

 
- Rules when Populating Tables in MySql
215

 
- Syntax for Populating Tables
216

 
- Inserting using the Set syntax
222

 
- Multiple Inserts
223

 
- On Duplicate Key Update
224

 
- Using Replace for Inserting Records
225

 
- General Comments
228

 
- Updating Data in MySql Tables
229

 
- Deleting Data from MySql Tables
232

 
- Inserting Large Objects in MySql
233

Thirteen
Prepared Statements
235

 
- Introduction
236

 
- Preparing the Statement
237

 
- Removing Prepared Statements
238

 
- Using Parameters
239

 
- Using mysqli_prepare()
241

 
- Using mysqli_stmt_bind_param()
242

Fourteen
Committing Records
243

 
- DDL and DML
244

 
- mysqli_commit() and mysqli_rollback()
246

 
- What happens if disconnected ?
248

 
- Exercise Nine
249

Fifteen
Importing and Exporting in MySql
254

 
- Outfile
255

 
- Problems with Outfile
259

 
- Using Dumpfile
261

 
- Selecting into Variables
262

 
- Importing Data using Infile
263

 
- Ignoring Lines using Infile
265

 
- Using the Set command with Infile
266

 
- Using the Lines option with Infile
269

 
- Loading comma separated files
270

 
- Loading XML file into MySql
272

 
- Loading XML file into MySql using Ignore
274

 
- Loading XML file into MySql naming Columns
275

 
- Loading XML file into MySql using Set
276

 
- Exercise Ten
314