[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    RE: Auto Increment
From:       <jbonnett () sola ! com ! au>
Date:       2005-04-14 0:50:31
Message-ID: CDD2448EDE5CAE4499CA5828A4CAF78859C855 () pine ! ap ! sola ! com
[Download RAW message or body]

Each table can have only one primary key (PK) but you can also access
the table by other columns. If you want this access to be efficient you
can set up indexes on those columns. Read the documentation, there are
many options.

For auto-increment keys each table is managed independently. If you
create 3 tables with an auto-increment column and insert a record in
each, then each one will have 1 in that column.

It is not clear what you are doing with your database, but do you really
need a table for each room? You may do just as well with one table that
has a column that identifies what room each row belongs to. Then you
would have only one auto-increment column to worry about.

John Bonnett

-----Original Message-----
From: david groves [mailto:grovesdavid@btconnect.com] 
Sent: Wednesday, 13 April 2005 12:41 AM
To: win32@lists.mysql.com
Subject: Auto Increment

Hello,

This is a silly question, at least for those of you who know about
MySql. I
am building a db for my site, and to, get to nf3 have created a table
for
each room in a house. The question is this.

1. Can I have more than one PK in some tables, if so
2. When someone makes an entry into those different table , if the PK is
set
to auto increments will it be the same number in each table. IE table
room1,
room2, room3 these are three different table. Someone makes the first
entry,
would id Pk = 0 in all three tables?

Explained it as well as I can do?

Kind Regards

DG


-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/win32?unsub=mysql-win32@progressive-comp.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic