Hi Thomas,
You don't need to put your column or table names into the INSERT statement.
Just put the values in the same order as the columns.
So, if your papers table has the columns author_id and title, then type:
INSERT INTO papers VALUES(42, 'Mu Mesons and Quark Emissions');

Then, to select all papers with an author_id of 42, just type:
SELECT * FROM papers WHERE author_id = 42;

It looks like you're very close.  Remember, anything in quotes is case
sensitive.
There is some good docs included with the Mandrake MySQL, I access them
through Webmin, but they're also on the MySQL website.

HTH

Edmund

> -----Original Message-----
> From: Thomas Sourmail [mailto:[EMAIL PROTECTED]]
> Sorry if that's obvious to some, I'm just starting with databases..
> 
> So, I read it's good to normalise databases and so I do, I 
> have a table
> for papers, one for author and one for journal, with, in 
> paper, the id of
> author and journal.
> 
> So far so good, but how do I enter my data ?? Supposing I 
> have filled in
> authors and journals, I now want to enter data for papers, is 
> there a way
> to do something like:
> 
> INSERT INTO papers(title, journal_id, author_id, whatever) 
> values ('The title',
> select journal_id from journal where name='The journal',
> select author_id from author where name='The author',
> etc..);
> 
> Obviously the above doesn't work, or I wouldn't be writing this but is
> there a way to build similar command (ie without going for script) ?
> 
> Thanks,
> 
> Thomas.
 

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to