Find the answer to your Linux question:
Results 1 to 4 of 4

Thread: NEW MYSQL user

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    NEW MYSQL user

    I am learning mysql. Its a difficult language to get my head round. Is it right that everything has to be done using mysql statements eg select,update, delete

    I am having difficulty working out how to do certain complex operations. Is it OK to do the following. You set up a SELECT which loops through records . But within the loop you place specific UPDATES.

    Also if I wanted to update a specific record going by the actual record number... eg the simple sequential number. How would I refer to that in mysql.

  2. #2
    You can start from here
    Registered Linux user #471256
    Don`t give up so easy...

  3. #3
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Well there's a couple of things to get you started. First off, the language is SQL and MySQL is a product which uses this language. That should help when searching for resources on it. You should check out RDBMS principles in general before you attempt to learn the language. Some of the functions won't make any sense until you understand how tables relate, primary/foreign keys etc.

    With regards to your question about selecting and then's best not to think of things in such a linear way. SQL is quite advanced and isn't your usual shopping-list basic scripting. Why select and the update? Why not use the where condition to specify what you want updated?
    update address_table set post_code = 'AA11AA' where line_4 like '%dublin%'
    Your reference to index numbers....well you're halfway on the right track. Don't depend on a random index. Look at the data you have and try to find a key. Say for instance if it was bills and invoices, you could use the invoice number. If it was customers, it could be a customer number. Hell it could even be a firstname or surname if you found it to be suitable and an individual idea.

    As I said above it's really a subject you should get a good feeling for and understanding of relational databases before jumping in. The hello_world of SQL doesn't even scratch the surface

  4. $spacer_open
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    North Carolina
    I also prefer phpmyadmin for my interface to mysql.

Posting Permissions

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