Introduction to MySQL — A 3-Day Course
Course Synopsis
This course covers the basics of the SQL language as implemented by MySQL. The course is designed to give delegates practical experience in writing SQL statements using the MySQL client program and MySQL Query Browser. The basic SQL statements, including the use of SQL functions and the basic table and view handling statements are introduced.
Course Objectives
To provide the skills needed to create and alter a MySQL database and query and modify data held within such a database.
The delegates will practise:
- Using client programs to access a MySQL database
- Creating, altering and dropping a MySQL database
- Writing SQL statements to select data from a MySQL database
- Writing joins and subqueries
- Using SQL expressions
- Using SQL aggregate functions and scalar functions
- Inserting, updating, deleting and replacing rows
- Creating and altering tables, indexes and views
- Using transactions
- Granting and revoking access privileges on tables and views
- Exporting and importing data
Suitable For
- Anyone who needs to access and work with a MySQL Database
Course Prerequisities
There are no formal pre-requisites, although an understanding of databases and exposure to information technology in general would be useful.
Note
This course covers the topics required for the Certified MySQL Associate examination. Together with the MySQL for Developers course, this course covers the topics required for the Certified MySQL Developer I and Certified MySQL Developer II examinations. Together with the MySQL Database Administration course, this course covers the topics required for the Certified MySQL DBA I and Certified MySQL DBA II examinations.
Before taking any exam, ensure you have the recommended experience. The Sun Microsystems website lists all exam requirements and these are updated regularly.
Exams are not included as part of the course.
Publicly scheduled dates, locations, and prices
London — £895 (+VAT)
- 29–31 Mar 2010
- 5–7 May 2010
- 7–9 Jul 2010
- 18–20 Aug 2010
- 13–15 Oct 2010
- 8–10 Dec 2010
Manchester — £895 (+VAT)
- 2–4 Jun 2010
- 4–6 Aug 2010
- 6–8 Oct 2010
- 24–26 Nov 2010
Contents
Database Concepts
- What is a database?
- Database management systems
- Tables, rows and columns
- Indexes, primary keys, unique constraints and foreign keys
- Client-Server architecture
- Supported data types
- Storage engines and table types
- The Information_Schema and MySQL Databases
- Exercise: Using a MySQL Database
Using The MySQL client
- What is the MySQL client?
- Getting started and Logging in
- Selecting a database
- Status
- Listing tables
- Quitting
- Describing tables
- Help
- Entering and executing SQL statements
- Retrieving previous commands
- The Clear command
- Creating, editing and executing SQL files
- Redirecting output into a file
- Command line execution
- Exercise: Using the MySQL Client
Basic SELECT
- The SQL SELECT statement
- Case sensitivity
- Quotes
- Statement terminator
- Syntax conventions
- The select clause
- The FROM clause
- Conditions and the WHERE clause
- Logical operators
- The ORDER BY clause
- Column aliases
- Arithmetic expressions
- Precedence of operators
- Exercises: Querying the sample database
LIMIT, UNION and Aggregate functions
- The LIMIT clause
- UNION
- UNION ALL
- Aggregate functions
- The GROUP BY clause
- Rollup
- The HAVING clause
- Exercises: Using Limit, Union and Aggregate Functions
Subqueries and Joins
- Subqueries
- Cartesian products
- Joins with original syntax
- Table aliases
- Natural joins
- Join using
- Join on
- Multi-table joins
- Exercises: Using Subqueries and Joins
Numeric and Character functions
- Function types
- Testing functions
- Numeric functions
- Character functions
- Exercise: Using Numeric and Character Functions
Date, Time and Other Functions
- Date and time column types
- Date and time formats
- The date format function
- Functions to return date time
- Functions to extract components from date time
- Date time arithmetic
- Miscellaneous functions
- Exercise: Using Date, Time and other functions
Databases and Tables
- Creating a database
- Selecting a database
- Creating tables
- Auto_increment
- Show create table
- Column operations
- Constraint operations
- Copying tables
- Renaming tables
- Changing engine for tables
- Dropping tables
- Temporary tables
- Exercises: Maintaining databases and tables
Indexesand Views
- What is an index?
- Creating an index
- Reviewing indexes
- Dropping indexes
- What is a view?
- Creating views
- View restrictions
- Dropping views
- Exercise: Maintaining indexes and views
Managing Data
- Inserting rows
- Replacing rows
- Updating rows
- Deleting rows
- The truncate statement
- Transactions
- Autocommit
- The COMMIT and ROLLBACK commands
- Savepoints
- Implicit commits
- Exercise: Managing data
Access Control
- Creating users
- Renaming users
- Dropping users
- Granting privileges
- Revoking privileges
- Exercise: Creating users, granting and revoking
Import and Export
- Exporting using SQL
- Importing using SQL
- Exporting from the command line
- Importing from the command line
- Exercise: Export and import data
