[DB-SIG] More questions from a stubborn beginner.
26 Mar 2002 23:48:03 -0500
On Tue, 2002-03-26 at 22:38, Ignacio Guerrero wrote:
> - Can anyone tell me the difference between PRIMARY_KEY, KEY and INDEX?
Well, obviously they are all indexes. PRIMARY KEY is generally going to
be the fastest type of index. It also must be UNIQUE and NOT NULL. Other
types of INDEX don't have to be UNIQUE or NOT NULL. The PRIMARY KEY is
also the default used by REFERENCES <table>. Recent versions of MySQL
with InnoDB tables support foreign key references.
> - Suppose I want a row to show only fixed data like, for instance,
> ('LivingRoom', 'BathRoom', 'BedRoom', 'Kitchen', 'Garage'). Should I use SET
> or is there another way?
You may want ENUM instead of SET; SET allows you to indicate multiple
values for a given row. Another way to do it (more standard, more
expandable) is to create a RoomTypes table and ensure that the column
matches an existing room type.
> - So, in general terms, how could I distribute this program without other
> people having to install Python and MySQL?
You don't, or at least not very easily. py2exe will produce a large
executable, and may not even work, due to the required shared libraries.
Andy Dustman PGP: 0x930B8AB6
@ .net http://dustman.net/andy
You can have my keys when you pry them from my dead, cold neurons.