Jump to content

Mysql to test queries


john6384

Recommended Posts

Hello, i have just downloaded mysql 5 in order to test some queries.

 

Can anybody please give me some idea or point me in the direction of where to research how to setup a mysql table with this.

 

Its mysql server 5 and ive been told that i can create tables with it. I just need a bit of info about this as im ok with queries but not actualy setting up databases.

 

Ive also got mysql admin and the query tool.

 

Thanks anyone

Link to comment
Share on other sites

Ok thanks for that, I just needed to know where to look.

 

Im making the tables using mysql command line.

 

Here are my tables although im not sure if they will work - can you check if the foreign key and primary key are set right.

 

Once ive got the tables working ill be fine.

 

Please anyone check if these are right:

 

create table emp

(

EMPNO integer(4),

ENAME varchar(10),

JOB varchar(9),

MGR integer(4),

HIREDATE date,

SAL integer(7),

COMM integer(7),

DEPTNO integer(2),

FOREIGN KEY (EMPNO)

);

 

 

 

 

create table dept

(

DEPTNO integer(2) NOT NULL PRIMARY KEY,

DNAME char(14),

LOC char(13)

);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.