Results 1 to 4 of 4

Thread: อยากทราบวิธีการเพิ่ม Database และ table ใน mysql

  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    0


    อยากทราบวิธีการเพิ่ม Database และ table ใน mysql ใครรู้ช่วยด้วยครับ

  2. #2
    Junior Member
    Join Date
    Jul 2007
    Posts
    2


    ผมไม่แน่ใจนะ ว่าถูกบอร์ดเปล่าแต่น่าจะไปอยู่บอร์ด SQL มากกว่านะ ตอบให้ล่ะกัน สำหรับคำสั่ง SQL
    **Hidden Content: To see this hidden content your post count must be 2 or greater.**


    ตอบในความเข้าใจนะแต่ถ้าจะเอาไปให้ใช้ใน VB ก็บอกอีกทีละกัน แต่ Create DATABASE ในวีบียังไม่เคยทำนะครับ แต่สร้างตารางทำได้ครับ เดี๋ยวจะบอก CODE ที่เป็น VB ให้อีกทีล่ะกัน เพราะบางคนเขียน CODE ในการเชื่อม DATA BASE ไม่เหมือนกันมันเชื่อมได้หลายวิธีครับ

  3. #3
    Senior Member
    Join Date
    Sep 2005
    Location
    Thailand
    Posts
    121


    ถ้าเป็นตัว mySQL ใน command line ก้อ

    use db_name
    create table tbl_name(
    att_name data_type constraint,
    ....,
    ....,
    Constraint constraint_name primary key(pk_field)
    )

    db_name = ชื่อ database นะครับ
    tbl_name = ชื่อ table ที่จะสร้าง
    att_name = ชื่อ field ที่จะสร้าง
    constrainy = มากมายอ่ะคับถ้าอยากรู้ post ไว้เด๋วบอกอีกทีนะครับ
    Constraint constraint_name primary key(pk_field) = สร้าง primary key ครับ

  4. #4
    youngdek
    Guest


    Post

    USE testDb
    CREATE TABLE Employees (EmployeeID int PRIMARY KEY, LastName varchar(20) NULL,
    FirstName varchar(20) NULL, OfficeNumber int, Salary numeric)
    GO
    --Insert Rows
    INSERT INTO Employees VALUES (1,'Joe', 'Smith', 202, 40000)
    INSERT INTO Employees VALUES (2,'Sally','Jones', 203, 55000)
    INSERT INTO Employees VALUES (3, 'Sara', 'Parker', 204, 37000)
    INSERT INTO Employees VALUES (4,'Abraham', 'Varky', 205, 50000)
    INSERT INTO Employees VALUES (5,'Lisa', 'Kim', 206, 42000)
    GO
    SELECT * FROM Employees
    GO
    --Create and use the stored procedure
    CREATE PROC sp_updateSalary @percentSalary numeric AS UPDATE Employees SET salary=salary+@percentSalary*Salary/100
    GO
    sp_updateSalary 5
    SELECT * FROM Employees



    กำลังศึกษาอยู่เหมือนกานครับ

Similar Threads

  1. php mysql database application
    By phichet in forum PHP,ASP,Javascript, Html
    Replies: 5
    Last Post: 20-12-2009, 11:05 PM
  2. วิธี check ดูว่ามี table อยู่ใน database หรือเปล่า (SQL Server)
    By noahsark in forum แนะความรู้ด้าน Programming ต่างๆ
    Replies: 0
    Last Post: 06-09-2009, 12:42 PM
  3. Cain & Abel Crack MySQL old_password using Rainbow Table
    By sae in forum Hacking/Cracking's E-book
    Replies: 0
    Last Post: 14-05-2009, 06:41 PM
  4. Replies: 7
    Last Post: 01-11-2008, 11:45 AM
  5. Replies: 1
    Last Post: 06-11-2006, 01:38 AM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Posting Permissions

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