Yes
the    member_id int(11) NOT NULL auto_increment, starts at 1 and goes up
automaticly and is maintained by MySQL
the    PRIMARY KEY (member_id) just makes the member_id the PRIMARY KEY
Snip from Manual
A PRIMARY KEY is a unique KEY with the extra constraint that all key columns
must be defined as NOT NULL. In MySQL the key is named PRIMARY. A table can
have only one PRIMARY KEY. If you don't have a PRIMARY KEY and some
applications ask for the PRIMARY KEY in your tables, MySQL will return the
first UNIQUE key, which doesn't have any NULL columns, as the PRIMARY KEY.

I program in Delphi and use PRIMARY KEY for updating and editing.
The person to ask if you want alot of detail would be Paul DuBois or post a
PRIMARY KEY question.

-----Original Message-----
From: Ken Sommers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 04, 2001 7:50 PM
To: Mike; Shania Qiu
Cc: [EMAIL PROTECTED]
Subject: Re: asking for teaching?


HI,
when you created table:

Create a table

CREATE TABLE members (
   member_id int(11) NOT NULL auto_increment,
   fname varchar(50) NOT NULL,
   lname varchar(50) NOT NULL,
   tel varchar(15),
   email varchar(50) NOT NULL,
   member_id int(11) NOT NULL auto_increment,
);
is that primary Key also an index authomatically maintened by MySql,,or does
it do any good to define an INdex on the primary key with something like:
 Index (member_id) or whatever the proper syntax is.:)?


----- Original Message -----
From: "Mike" <[EMAIL PROTECTED]>
To: "Shania Qiu" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 7:00 PM
Subject: RE: asking for teaching?


> Try http://www.analysisandsolutions.com/code/mybasic.htm#creating for a
nice
> tutorial
>
> and http://www.devshed.com/Server_Side/MySQL/Speak/page7.html has some
> excellent tutorials
>
> To Create a database and table
>
> CREATE DATABASE member;
>
> Create a table
>
> CREATE TABLE members (
>    member_id int(11) NOT NULL auto_increment,
>    fname varchar(50) NOT NULL,
>    lname varchar(50) NOT NULL,
>    tel varchar(15),
>    email varchar(50) NOT NULL,
>    PRIMARY KEY (member_id)
> );
>
> To insert
>
>
> INSERT into <members (fname_1,lname, tel) VALUES
> (Shania, Qiu, 208-469-9999, [EMAIL PROTECTED], 16)
>
> To Delete
>
> mysql> DELETE FROM members WHERE member_id = 16;
> Query OK, 1 row affected (0.06 sec)
>
> There is a Ton of info out there and some really good books as well. There
> is also alot of other ways to do this which I am sure others will show
you.
>
>
> Have fun
>
> Cheers
>
> M;-)
>
>
>
> -----Original Message-----
> From: Shania Qiu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 04, 2001 7:29 PM
> To: 'Mike'
> Subject: RE: asking for teaching?
>
>
> Thank you, Mike,
>
> It seems to work in cmd environment. the 'mysql>' prompt appeared. The
> screen looks like:
>
> mysql>create database firsttry
>     ->use test
>     ->create table art
>     ->
>
> Right?
>
> The next i'd better to find out in the manaul what the command is to
create
> tables and such. May you could give me the clue.
>
>
> Cheers,
>
> Shania Qiu
>
>
> -----Original Message-----
> From: Mike [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 5 July 2001 1:34 p.m.
> To: Shania Qiu
> Subject: RE: asking for teaching?
>
>
> Try this
>
> Start | Run  cmd to get to the command prompt
>
> cd to Mysql the cd bin
>
> now type mysql
> now the prompt looks like
>
> mysql>
>
> then you can do what Luis said
>
> create database test; ---hit enter
>
> one you create it do this
>
> # use test;    --- this will change to this database
>
> after that you will have to create the table
>
> # create table art ; this will create the table for  you .
>
>
>
> -----Original Message-----
> From: Shania Qiu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 04, 2001 7:11 PM
> To: 'Luis'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: asking for teaching?
>
>
> Thank you, Luis,
>
> I type in 'login mysql', the system responded me with 'Welcome to
Microsoft
> Telnet Server', then back to c:\, according to your instruction, i typed
in
> create database test, the message ' 'create' is not recognized as an
> internal or external command, operable program or batch file.'
>
> I think the commands for windows are not the same as in linux. any ideas?
>
>
> Shania
>
> -----Original Message-----
> From: Luis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 5 July 2001 1:03 p.m.
> To: Shania Qiu; [EMAIL PROTECTED]
> Subject: Re: asking for teaching?
>
>
> well you should read the man pages that come with it also there are alot
of
> book on mysql.
>
> But you know what since your  a newbie. I wills how you. I dont have mysql
> installed on a windows machine, but on a linux box. i believe the commands
> are the same.
>
>
> log in
> mysql
>
> create database test; ---hit enter
>
> one you create it do this
>
> # use test;    --- this will change to this database
>
> after that you will have to create the table
>
> # create table art ; this will create the table for  you .
>
> if i'm wrong let me know
>
>
> bye Luis
> ----- Original Message -----
> From: "Shania Qiu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 04, 2001 5:55 PM
> Subject: asking for teaching?
>
>
> > Hi, all,
> >
> > I am a newer to MySQL, being learning, i have installed the bianary
> 3.23.29
> > into my pc which is running windows 2000. Can someone tell me where and
> how
> > to create tables in MySQL.
> >
> > Thank you all.
> >
> >
> > shania.
> >
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to