SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Help required ::

    Hi Champs.

    I want to know something regarding mysql tables and database (for Website). Like ::

    1- What shoud be the size of structure of a TABLE in KBs ?
    2- How many columns can a table have ?
    3- How to make Backups ?
    4- If i have a field and its type is VARCHAR(255) how many space it will use for my name "ZEESHAN" ? will it use 7 and discard the rest ? or it will use all the 255.
    5- How many tables there can be in a Database ?
    6- If i have 40 fields in a table, so should i seperate them like 15 in one table and 25 in another table and add same primary key field to both ? for better optimization ? like the 25 fileds table will be used as required only ? and 15 fields table will be use commonly .... ?

    these are SILLY questions , actually i know SQL but i m not very much good with MySQL. Hope u will understand.

    Thanks

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    all of your questions can easily be answered by the mysql manual. start by reading the section on myisam tables to answer question 1, 2 and 4: http://dev.mysql.com/doc/refman/5.0/...ge-engine.html

    for question 3, there's a whole section in the mysql manual about backing up a database: http://dev.mysql.com/doc/refman/5.0/...revention.html

    for question 5, your filesystem is the limiting factor when dealing with myisam tables. that is also partially true for innodb. in both cases, the number is generally so large it's not worth worrying about unless you are not following DB normalization rules.

    question 6: BAD idea.

  3. #3
    SitePoint Zealot newspire's Avatar
    Join Date
    Mar 2005
    Location
    Houston, TX
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1- What shoud be the size of structure of a TABLE in KBs ?
    I don't know understand what you are asking here.

    2- How many columns can a table have ?
    This changes based on the version of MySQL and the size of the column names. It ranges from ~1000 - ~3000.

    3- How to make Backups ?
    In most cases you can use mysqldump or just copy that database files where the db is locked or shutdown.

    4- If i have a field and its type is VARCHAR(255) how many space it will use for my name "ZEESHAN" ? will it use 7 and discard the rest ? or it will use all the 255.
    The rest will be discarded.

    5- How many tables there can be in a Database ?
    I don't know of a limit.

    6- If i have 40 fields in a table, so should i seperate them like 15 in one table and 25 in another table and add same primary key field to both ? for better optimization ? like the 25 fileds table will be used as required only ? and 15 fields table will be use commonly .... ?
    There is not a short answer to this question. I'd need to know more about the data.

  4. #4
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi longneck, about question 6 u said that it is a BAD approach. Would u please mention it further ? By your answer what i have understand is that i shoul not spearate them I should have all 40 in 1 table.... am i right ?

  5. #5
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi longneck i read the manual , but so far i did not get any idea, the manual is about its internal working. Would u plz highlight further where i can find that in the manual ? or plz reply wih the answer if u can do it without any inconvinience....

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    1- What shoud be the size of structure of a TABLE in KBs ?
    as large as necessary

    2- How many columns can a table have ?
    as many as necessary

    3- How to make Backups ?
    with one of the utilities provided for this purpose

    4- If i have a field and its type is VARCHAR(255) how many space it will use
    trailing spaces are removed

    5- How many tables there can be in a Database ?
    as many as you need

    6- If i have 40 fields in a table, so should i seperate them
    no
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks r937, its great to have your help. U are really the GURU of Database.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •