Results 1 to 19 of 19

Thread: MySQL Tip of the day

  1. #1

    Thread Starter
    Lively Member Spetnik's Avatar
    Join Date
    Jan 2002
    Posts
    121

    MySQL Tip of the day

    Typing "2070" instead of "2010" will seriously screw up results that are sorted by date.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: MySQL Tip of the day

    Typing ALTAR TABLE will not work - it's either an ALTAR or a TABLE, it can't be both.

  3. #3

    Thread Starter
    Lively Member Spetnik's Avatar
    Join Date
    Jan 2002
    Posts
    121

    Re: MySQL Tip of the day

    We should write a book

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: MySQL Tip of the day

    Quote Originally Posted by Spetnik View Post
    Typing "2070" instead of "2010" will seriously screw up results that are sorted by date.
    Wishing your life away? Sounds like a cry for help.
    I don't live here any more.

  5. #5
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: MySQL Tip of the day

    The command drop cascade is NOT your friend.

    Was my first major cock up as a developer... well, that and not keeping a backup of my schema *D'oh!*

  6. #6
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: MySQL Tip of the day

    You could have delegated the schema backup to the DBA.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  7. #7
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: MySQL Tip of the day

    I think I coined another programming term.

    "A cock-up": The error that results in the feeling that database and system administrators get. As in, the file deletion resulted in a major cock-up error for the windows admin.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  8. #8
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: MySQL Tip of the day

    Don't use VARCHAR(5) for storing booleans...
    Delete it. They just clutter threads anyway.

  9. #9
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: MySQL Tip of the day

    'A cock-up' though is a general term when someone messes up, how is it also a programming term ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: MySQL Tip of the day

    Quote Originally Posted by I_Love_My_Vans View Post
    The command drop cascade is NOT your friend.

    Was my first major cock up as a developer... well, that and not keeping a backup of my schema *D'oh!*
    It's an oversight, though. On one hand, you forget it's there and you do 'something' which cascades. OTOH it isn't there and you end up having to perform several transactions to remove related records out of a DB.

    What's better? I like the option with more control...

  11. #11
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: MySQL Tip of the day

    Drop cascade and Delete cascade you be removed from the ANSI standard. Any professional DBA (even developer) would never allow them to be used in code on a database.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  12. #12
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: MySQL Tip of the day

    Quote Originally Posted by NeedSomeAnswers View Post
    'A cock-up' though is a general term when someone messes up, how is it also a programming term ?
    You're quite right, but look at the definition I coined in my other thread.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: MySQL Tip of the day

    Quote Originally Posted by GaryMazzone View Post
    Drop cascade and Delete cascade you be removed from the ANSI standard. Any professional DBA (even developer) would never allow them to be used in code on a database.
    Wut u say? not understnading.

  14. #14
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Wink Re: MySQL Tip of the day

    Quote Originally Posted by GaryMazzone View Post
    Drop cascade and Delete cascade you be removed from the ANSI standard. Any professional DBA (even developer) would never allow them to be used in code on a database.
    You are being facetious, right?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  15. #15
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: MySQL Tip of the day

    NO... I really believe that Delete and Drop Cascades should never be allowed to be used in a database.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  16. #16
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: MySQL Tip of the day

    I'd slam you for your incompetence, but it would probably garner the same satisfaction as winning a 'dunk the retard' contest.

  17. #17
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: MySQL Tip of the day

    Another tip:

    Don't copy/paste a query a large number of times before testing it. I wrote "SELECT * FORM" instead of "FROM" by accident once and copied that like 50 times throughout a project. Then I used Replace All to replace FORM with FROM, not realizing half the table names contained the word 'FORM'.

  18. #18
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: MySQL Tip of the day

    Quote Originally Posted by GaryMazzone View Post
    NO... I really believe that Delete and Drop Cascades should never be allowed to be used in a database.
    They're good in the sense that you're maintaining relationships and the integrity of those relationships. It's sort of like a patriarchal nihilistic/fatalist society - if a guy dies, then the wife, children and dog must kill each other. It's convenient in the sense that the police don't need to go around and do it, they just do it themselves.

  19. #19
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: MySQL Tip of the day

    They're good in the sense that you're maintaining relationships and the integrity of those relationships. It's sort of like a patriarchal nihilistic/fatalist society - if a guy dies, then the wife, children and dog must kill each other. It's convenient in the sense that the police don't need to go around and do it, they just do it themselves.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



Posting Permissions

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



Click Here to Expand Forum to Full Width