Quick help with MySQL 'create table' command
-
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:
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 at Google Answers Visit the source
Related Q & A:
- How does MySQL reindex a table?Best solution by Stack Overflow
- How to skip columns empty in CSV file when importing into MySQL table using LOAD DATA INFILE?Best solution by Stack Overflow
- Can I estimate the row count of a large mysql table using the disk space?Best solution by Database Administrators
- What is Hash Table, how to create a hash table?Best solution by Stack Overflow
- How to create a table in PHP with MySQL?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.