How do you create Database Objects

How do you prefer to create database objects (i.e. tables, queries, etc.) in MySQL?

Back in my dark days as an MS Access Developer, I just used Access’s nifty wizards and friendly Developer GUI to build things.

And back in college in an Oracle class, I seem to remember that we wrote all the SQL for our databases, and then put it in “.sql” files and ran it in SQL*Plus.

I think I’d like to do something more like the latter than the former.

One goal in building my own e-commerce site is LEARNING!!

And becoming too dependent on IDE’s and CASE tools takes away from the learning experience.

Is there a way to write my DCL, DDL, and DML and place them in files/scripts that I can then run?

How do you do things?

And why?

TomTees

my condolences :wink:

I should mention I am on a MacBook… :wink:

Okay, let me clarify.

I already know that you can create SQL in a text editor, but what I am uncertain of is…

1.) Do you name the file with a particular extension so it works for MySQL?

Maybe I would write SQL to build several tables. So there would be several separate DDL statements that I want to collectively group together in one file.

2.) What are my options to then run said file?

As mentioned before, I vaguely remember in an Oracle class I took, that we wrote several SQL statements, saved them in a MyScripts.sql file and then used SQL*Plus to run the script.

I guess you need MySQL “client” to do something similar?

TomTees

i should also mention that i use HeidiSQL, it’s not a “GUI” per se, but it’s a lot easier to use than phpmyadmin

yes, that’s the way everybody does it (who isn’t using a GUI)

how do i do it? with a text editor