Jump to content


Photo

Mysql to test queries


  • Please log in to reply
3 replies to this topic

#1 john6384

john6384
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 07 November 2005 - 02:31 PM

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

#2 Cook

Cook
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts
  • LocationSingapore

Posted 07 November 2005 - 02:33 PM

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

#3 john6384

john6384
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 07 November 2005 - 03:37 PM

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)
);

#4 john6384

john6384
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 07 November 2005 - 05:46 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users