MySQL Lists are EOL. Please join:

List:Brisbane MySQL Users Group« Previous Message
From:Arjen Lentz Date:March 20 2011 11:07pm
Subject:Re: mysql questions
View as plain text  
Hi Marvin

----- Original Message -----
> a blind computing it student doing a it help desk course from
> and doing the subject use sql to create database and manipulate data,
> now, using my sql community 5.1.5 database server.
> using the jaws for windows screen reader from


> and now a fe questions:
> 1. how to write a basic script.
> 2. any documentation, on how to use variables, functions, loops, etc.
> 3. how to say import a text file and then execute a script within the
> command line editor.
> 4. will be using a text editor like notepad, text pad, and then will
> execute and create the database.
> also, any delimeters, or any other information.a
> newbie and have done a little bit of sql, using visual web developer,
> doing a star trek project, and used sql server management studio
> express 2008, as part of visual studio.
> but have never really used my sql.
> now need to use this as to do my assignments.
> and got the assignments, and enrolled in this subject.
> got the learning materials.
> but any extra, help, tips, tricks, so my coding can go smoothly.
> marvin, from devonport, tasmania.

I'm just replying to all of this in one go because I think my answer relates to the whole
rather than individual bits.

The mysql command line client just takes plain SQL and passes it to the server, so no
loops/functions or other programmatic constructs (like you may have been familiar with
from the Microsoft stuff). Inside the client, the source command is used to have a file
read and executed, or you can use input redirection with <filename.sql on the DOS/Unix
shell prompt.

The reason MySQL hasn't got programmatic constructs is that there are perfectly good
scripting languages out there: PHP, Python, Ruby/Rails, etc and it's very easy to get
start coding in those languages and interface to MySQL.

Of course MySQL does have stored procedures/functions, but the above-mentioned scripting
languages provide much more flexibility. You could also use C# or Java, but in terms of
useful generic skills that you want to gain as well as considering ease of first use
(getting nice results quickly), I'd recommend either Python or Ruby/Rails. PHP is very
easy, but perhaps *too* easy - best to learn properly first before acquiring bad habits!

Good luck

Arjen Lentz, Exec.Director @ Open Query (
Remote expertise & maintenance for MySQL/MariaDB server environments.

Follow us at &
mysql questionsMarvin Hunkin19 Mar
  • Re: mysql questionsArjen Lentz21 Mar