Google Answers Logo
View Question
 
Q: Quick help with MySQL 'create table' command ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Quick help with MySQL 'create table' command
Category: Computers > Programming
Asked by: jhabley-ga
List Price: $2.00
Posted: 21 Dec 2003 12:43 PST
Expires: 20 Jan 2004 12:43 PST
Question ID: 289305
I'm trying to create a table called review_main with the following fields:

primary key (I guess? do I need one?)
company_name (40 chars)
city (40 chars)
rating (40 chars)
phone (12 chars)
review_text (need lots of room for this)

Could you please provide the MySQL query I need to execute this?
Answer  
Subject: Re: Quick help with MySQL 'create table' command
Answered By: googleexpert-ga on 21 Dec 2003 13:05 PST
Rated:5 out of 5 stars
 
If there will be multiple ratings for each company,
Here is the SQL statement to create such review_main:

CREATE TABLE review_main ( 
company_name VARCHAR(40) NOT NULL, 
city VARCHAR(40) NOT NULL,
rating VARCHAR(40) NOT NULL,
phone VARCHAR(12) NOT NULL,
review_text MEDIUMTEXT NOT NULL,
PRIMARY KEY (company_name,rating)
);

Note:
TEXT provides a maximum of 64KB space
MEDIUMTEXT provides a maximum of 16MB space

Please let me know if you have anymore questions.
Thank you.
-googleexpert
jhabley-ga rated this answer:5 out of 5 stars
Worked like a charm. Thanks!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy