Coding SQL on Mak
Hey does anyone know of any ways I could code SQL on Mak? I need to create a database for one of my assignments for my cource Bachelar of Information technology at JCU.
I have tried MYSQl, however it's not accessible.
Also, if the program could draw database models that would be great.
Any help would be appreciated.
I don't know about GUIs on macOS for SQL, but I do know you can manage this with the command line. I suggest writing the queries in a text editor like Text Edit (with spellchecking disabled), then pasting them in. Once you install MySQL and set up a user and a database, you can run queries against it in Terminal. You can also save your text file as a script, then run that. To get the output, pipe it to a file. For example:
First, assuming your database is myDB, write this in a text editor:
create table if not exists newTable (
id int unsigned auto_increment primary key not null,
name varchar(25) not null
Save this as myScript.sql. Be sure to save it as a text file, not a rich text file.
Second, switch over to Terminal and type this:
mysql -u yourUser -p < /path/to/myScript.sql
You're prompted for your MySQL user account's password, and then your script will run.