Jump to content

Archived

This topic is now archived and is closed to further replies.

john6384

Mysql to test queries

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

Share this post


Link to post
Share on other sites

Google 'mysql tutorial'. Alternatively check out the membership systems tutorials on this site.

Share this post


Link to post
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)

);

Share this post


Link to post
Share on other sites

Or does anybody know where i could find an example of table entry where there is the use of a foriegn and primary key??

Thanks

Share this post


Link to post
Share on other sites

×

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.