Database Programming with Perl

Kirrily Robert

Open Publications License 1.0

Copyright (c) 1999-2000 by Netizen Pty Ltd. Copyright (c) 2000 by Kirrily Robert . This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, vX.Y or later (the latest version is presently available at http://www.opencontent.org/openpub/).


Table of Contents
1. Introduction
Course outline
Assumed knowledge
Module objectives
Platform and version details
The course notes
Other materials
2. About databases
In this chapter...
What is a database?
Types of databases
Database management systems
Uses of databases
Chapter summary
3. Textfiles as databases
In this chapter...
Delimited text files
Reading delimited text files
Searching for records
Sorting records
Writing to delimited text files
Comma-separated variable (CSV) files
Problems with flat file databases
Locking
Complex data
Efficiency
Chapter summary
4. Relational databases
In this chapter...
Tables and relationships
Structured Query Language
General syntax
Chapter summary
5. MySQL
In this chapter...
MySQL features
General features
Cross-platform compatibility
Comparisions with other popular DBMSs
PostgreSQL
mSQL
Oracle, Sybase, etc
Getting MySQL
Redhat Linux
Debian Linux
Compiling from source
Binaries for other platforms
Setting up MySQL databases
Creating the Acme inventory database
Setting up permissions
Creating tables
The MySQL client
Understanding the MySQL client prompts
Exercises
Chapter summary
6. The DBI and DBD modules
In this chapter...
What is DBI?
Supported database types
How does DBI work?
DBI/DBD syntax
Variable name conventions
Connecting to the database
Executing an SQL query
Doing useful things with the data
An easier way to execute non-SELECT queries
Quoting special characters in SQL
Exercises
Advanced exercises
Chapter summary
7. Acme Widget Co. Exercises
In this chapter...
The Acme inventory application
Listing stock items
Advanced exercises:
Adding new stock items
Advanced exercises
Entering a sale into the system
Creating sales reports
Advanced exercises
Searching for stock items
Advanced exercises
8. References (Optional topic)
In this chapter...
Creating and deferencing
Complex data structures
Passing multiple arrays/hashes as arguments
Anonymous data structures
Chapter summary
9. Conclusion
What you've learnt
Where to now?
Further reading
Books
Online
A. Unix cheat sheet
B. Editor cheat sheet
vi
Running
Using
Exiting
Gotchas
Help
pico
Running
Using
Exiting
Gotchas
Help
joe
Running
Using
Exiting
Gotchas
Help
jed
Running
Using
Exiting
Gotchas
Help
C. ASCII Pronunciation Guide