Working with SQL Querys and How to Make them! menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Abdullaah's Avatar Member
    Reputation
    13
    Join Date
    Mar 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Working with SQL Querys and How to Make them!

    Hey All!!
    Im making a Shot Guide which teaches you how to make some easy SQL Queries.

    there are 4 Most Common Commands for everyone to remember:
    Insert:
    Delete:
    Update:
    Select:

    Alright, Lets work with the Insert Query Now.

    Lets Suppose you want to Add an Npc in creature_names with entry Id 123456
    and add more stuff to it e.t.c, e.t.c...
    Now we will type the Query in the "Query" Box or you can also type it in notepad. I recommend using Notepad atm for better understanding...
    Alright so here is the Query i typed till now:
    Code:
    Insert into `creature_names` ( `entry`, `name`, `Subname`)
    The above query only commands the Database to add fields into the Column Creature_names, but this Query will fail if you execute it cause its Half and it has no values. We will want to type in all the columns creature_names have with a comma and a space between them all.
    So lets do all of them now:
    Code:
    insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
    So, these are all the tables in creature_names and notice how all of them have a `` on them.
    Now lets make the same query but put in the values with it:

    Code:
    insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`) 
    values ('123456', "Tigerresse", "", '', '0', '7', '0', '0', '0', '0', '14330', '0', '0', '0', '1', '1', '0', '0');
    You should have understood which value is for which field. We started with entry then name, then Subname and in the Values the 1st number 123456 tells us that its for entry Id, for Name its Tigerresse and you would have noticed that "" is also there for Subname. It actually means the field is Blank.

    This is How you can work with every table and every column in the database. For example Items, for that you ll have to start with
    Code:
    Insert into `items` and e.t.c e.t.c
    the name after Insert into tells what column you want to insert it in.


    Now the Second Command is Delete:
    Okay, this is like the easiest Query ever!!!

    Now for example you want to delete some record from the database.

    Well 1st you need to know what column it is and what Entry Id is that record saved with.

    Lets Suppose we want to delete the Tigerresse we made above.
    So we will use the following:

    Code:
    Delete from `creature_names` where `entry` = 123456
    I think the Query itself explains what its doing.

    Its deleting a Record which starts with the Entry Id 123456 and its deleting from the table creature_names.


    Update:
    This Query is for updating some Old Record saved in the database.

    For example if we want to Update the Entry Id of the Tigerresse we made above.
    So we will use the following query:
    Code:
    Update `creature_names` Set `entry` = 654321 where `entry` = 123456
    Okay this 1 also self explains like any other Query.
    Its telling the DB to Update the field with Entry ID 654321 whose entry Id is 123456 in the Creature_names Column.

    Now if we want to Update the name too, we would use the following Query:
    Code:
    Update `creature_names` Set `entry` = 654321 where `entry` = 123456;
    Update `creature_names` Set `name` = Panther Where `entry` = 654321
    You would have noticed how this time i inserted a ";" at the end of the 1st line.
    It shows how there is a Line break and how the Sql Query is continuing.


    Now the 4th Query Select is what i will teach you later, as I gtg atm. But if you learned above 3, you would be able to make up your own Query and work with it.


    Anyways!
    Thanks For Reading!!!
    Last edited by Abdullaah; 06-30-2009 at 06:00 AM. Reason: oO!

    Working with SQL Querys and How to Make them!
  2. #2
    Cripto's Avatar Active Member
    Reputation
    33
    Join Date
    Jul 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump! This is good

    Aka Milation

  3. #3
    alj03's Avatar Contributor
    Reputation
    91
    Join Date
    Feb 2008
    Posts
    1,103
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like effort was put into it.
    Death to all but Metal.

  4. #4
    Abdullaah's Avatar Member
    Reputation
    13
    Join Date
    Mar 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!!

    Bump!

  5. #5
    daniel3896's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx :P I think most people need to read this^^

  6. #6
    Abdullaah's Avatar Member
    Reputation
    13
    Join Date
    Mar 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by daniel3896 View Post
    Thx :P I think most people need to read this^^

    hahaha yeah:P

Similar Threads

  1. 2.4.2 Mangos pack and how to make it Public 100% Working!
    By Ltleontis54321 in forum WoW EMU Guides & Tutorials
    Replies: 31
    Last Post: 12-28-2008, 08:10 PM
  2. How to Make Ascent Server 2.3.3+ and How to make it public with hamachi
    By Joonak in forum WoW EMU Guides & Tutorials
    Replies: 25
    Last Post: 03-06-2008, 04:29 PM
  3. Replies: 4
    Last Post: 02-08-2008, 11:34 PM
  4. how to make new MPQ's with mac and how to make it work?
    By jaspervdg in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 02-06-2008, 01:50 PM
All times are GMT -5. The time now is 12:20 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search