473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Organization of tables/rows in mysql

Hey, I'm kind of new to mysql, and I'm not sure which is a better
method of organizing data. I have 10 chat rooms, and for each room I
want to store 10 messages. Does this mean I should create 10 tables,
one for each chat room, and have each of the 10 messages as one row
entry in the chat room table? Or should I create one main table that
stores all 100 messages as 100 row entries, and identify for each
message which chat room it belongs to? Or is there a different way I
should be managing this?

Thanks,

bgold12
Sep 3 '08 #1
3 1046
On 3 Sep, 16:03, bgold12 <bgol...@gmail.comwrote:
Hey, I'm kind of new to mysql, and I'm not sure which is a better
method of organizing data. I have 10 chat rooms, and for each room I
want to store 10 messages. Does this mean I should create 10 tables,
one for each chat room, and have each of the 10 messages as one row
entry in the chat room table? Or should I create one main table that
stores all 100 messages as 100 row entries, and identify for each
message which chat room it belongs to? Or is there a different way I
should be managing this?

Thanks,

bgold12
The latter.
Sep 3 '08 #2
On 3 Sep, 16:03, bgold12 <bgol...@gmail.comwrote:
Hey, I'm kind of new to mysql, and I'm not sure which is a better
method of organizing data. I have 10 chat rooms, and for each room I
want to store 10 messages. Does this mean I should create 10 tables,
one for each chat room, and have each of the 10 messages as one row
entry in the chat room table? Or should I create one main table that
stores all 100 messages as 100 row entries, and identify for each
message which chat room it belongs to? Or is there a different way I
should be managing this?

Thanks,

bgold12
Also, this should be asked in comp.databases.mysql
Sep 3 '08 #3
On Sep 3, 9:03*am, bgold12 <bgol...@gmail.comwrote:
Hey, I'm kind of new to mysql, and I'm not sure which is a better
method of organizing data. I have 10 chat rooms, and for each room I
want to store 10 messages. Does this mean I should create 10 tables,
one for each chat room, and have each of the 10 messages as one row
entry in the chat room table? Or should I create one main table that
stores all 100 messages as 100 row entries, and identify for each
message which chat room it belongs to? Or is there a different way I
should be managing this?

Thanks,

bgold12
create a table called tblChatRoom
chatRoomId autonumber (pk)
chatRoom varchar

create a table called tblMessage
messageId autonumber (pk)
chatRoomId int (fk)
message varchar
this will allow many chatrooms, and many messages
Sep 4 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chris | last post by:
Hi, sorry to post OT but i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two...
13
by: StealthBananaT | last post by:
My database has two tables - films has 10,000 records and reviews has 20,000 records. Whenever I try to list all the films and the count of its reviews, MySQL locks and I have to restart the...
0
by: Stefan Hinz | last post by:
Jim, >> Does MySQL automatically handle deleted row cleanup, or is it necessary to >> periodically do this manually for tables with a lot of deletions? If it's >> manual, what are the SQL...
0
by: Eric B. | last post by:
Hi, I'm somewhat new to MySql. I've been using it for a while, but pretty much out of the box setup, and am starting to suffer heavily with my larger tables. I have a table with 5,000,000+...
8
by: Greg | last post by:
Hello, I've to manage many 'table' (having same scheme) on the same server. And I ask myself what could be the best to do (and if you know, why) : Creating as many database (the name would...
3
by: mark1822 | last post by:
Hello, I am working on designing a Web site using PHP and MySQL and I am currently figuring out how to best build my MySQL database. My Web site is going to use a MySQL database extensively...
1
by: Prakash RudraRaju | last post by:
Hi, I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test successful migration I want to compare all tables. I have linked MySQL tables through ODBC connection. I want to...
1
by: J | last post by:
I'm using codebehind in ASP.Net. public partial class edit : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // populate the dataset, etc. txtFirstName.Text =...
2
by: amit2781 | last post by:
Hi, I have created 4 tables in 'amit' database and then I deleted them. Still I able to get information about the table_schema for the table deleted. After drop table when I fire a query for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.