1 / 35

Database programming

Database programming. Visual Basic .NET 2008 (Database ). การจัดการฐานข้อมูลด้วยคำสั่ง. Visual Basic Program. Connection (ADO.NET). Access. Oracle. SQL Server. MySQL. อื่น ๆ. Create by . Suwitchan Kaewsuwan. Visual Basic .NET 2008 ( การเรียกใช้ฐานข้อมูล). Form. SQL. Database.

Télécharger la présentation

Database programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database programming

  2. Visual Basic .NET 2008 (Database) การจัดการฐานข้อมูลด้วยคำสั่ง Visual Basic Program Connection (ADO.NET) Access Oracle SQL Server MySQL อื่น ๆ Create by . Suwitchan Kaewsuwan

  3. Visual Basic .NET 2008 (การเรียกใช้ฐานข้อมูล) Form SQL Database Create by . Suwitchan Kaewsuwan

  4. Visual Basic .NET 2008 (Database) ฐานข้อมูล (Database) คือ กลุ่มของแฟ้มข้อมูลที่มีความสัมพันธ์และถูกนำมารวมกันเป็นโครงสร้างข้อมูลอีกชนิดหนึ่ง Create by . Suwitchan Kaewsuwan

  5. Visual Basic .NET 2008 (Database) องค์ประกอบของฐานข้อมูล 1. ฟิลด์ (Field) Create by . Suwitchan Kaewsuwan

  6. Visual Basic .NET 2008 (Database) 2. เรคอร์ด (Record) Create by . Suwitchan Kaewsuwan

  7. Visual Basic .NET 2008 (Database) 3. รายการ (Items) Create by . Suwitchan Kaewsuwan

  8. Visual Basic .NET 2008 (Database) 4. ตาราง (Table) Create by . Suwitchan Kaewsuwan

  9. Visual Basic .NET 2008 (Database) 5. แฟ้ม (File) Table 3 Table 1 Table 2 Table 5 Table 4 Create by . Suwitchan Kaewsuwan

  10. Visual Basic .NET 2008 (Database) ระบบฐานข้อมูลเชิงสัมพันธ์ (Relational Database Systems) Table 3 Table 1 Table 2 Table 5 Table 4 Create by . Suwitchan Kaewsuwan

  11. Visual Basic .NET 2008 (Database) ระบบการจัดการฐานข้อมูล (Database Management System) คือ โปรแกรมที่ใช้จัดการฐานข้อมูล เช่น * MS Access * SQL Server * MySQL * Oracle * เป็นต้น Create by . Suwitchan Kaewsuwan

  12. Visual Basic .NET 2008 (Database) ADO .NET Visual Basic Program OLEDB Connection Access Oracle SQL Server MySQL อื่น ๆ Create by . Suwitchan Kaewsuwan

  13. สร้างฐานข้อมูลด้วย MS Access

  14. สร้าง Form

  15. เขียน Code

  16. Visual Basic .NET 2008 (SQL ) Structure Query Language (SQL) • เป็นภาษามาตรฐานที่ใช้จัดการฐานข้อมูลได้ทุกรูปแบบ • มีรูปแบบที่เป็นมาตรฐาน • เป็นภาษามาตรฐานที่ใช้จัดการฐานข้อมูลได้ทุกรูปแบบ Create by . Suwitchan Kaewsuwan

  17. Visual Basic .NET 2008 (SQL ) การเรียกข้อมูลเพื่อแสดง รูปแบบคำสั่ง รูปแบบ 1 เลือก Field เพื่อแสดงผล • select field1,field2,… fromชื่อตาราง ตัวอย่าง employee Create by . Suwitchan Kaewsuwan

  18. Visual Basic .NET 2008 (SQL ) selectid,name fromemployee Create by . Suwitchan Kaewsuwan

  19. Visual Basic .NET 2008 (SQL ) การเรียกข้อมูลเพื่อแสดง รูปแบบคำสั่ง รูปแบบ 2 เลือกทุก Field เพื่อแสดงผล • select * fromชื่อตาราง ตัวอย่าง employee Create by . Suwitchan Kaewsuwan

  20. Visual Basic .NET 2008 (SQL ) select*fromemployee Create by . Suwitchan Kaewsuwan

  21. Visual Basic .NET 2008 (SQL ) การแสดงแบบมีเงื่อนไข รูปแบบคำสั่ง 1. select field1,field2,… fromชื่อตาราง whereเงื่อนไข 2. select * fromชื่อตาราง whereเงื่อนไข Create by . Suwitchan Kaewsuwan

  22. Visual Basic .NET 2008 (SQL ) selectid,name fromemployeewhere salary > 8000 Create by . Suwitchan Kaewsuwan

  23. Visual Basic .NET 2008 (SQL ) select*fromemployeewhere salary < 8500 Create by . Suwitchan Kaewsuwan

  24. Visual Basic .NET 2008 (SQL ) การแสดงแบบมีเงื่อนไขร่วมกับ Operator ทางตรรกะ Operator ทางตรรกะ • And • Or Create by . Suwitchan Kaewsuwan

  25. Visual Basic .NET 2008 (SQL ) การแสดงแบบมีเงื่อนไขร่วมกับ Operator ทางตรรกะ รูปแบบคำสั่ง 1. select field1,field2,… fromชื่อตาราง whereเงื่อนไข1 operator เงื่อนไข2 operator เงื่อนไข n 2. select * fromชื่อตาราง whereเงื่อนไข1 operator เงื่อนไข2 operator เงื่อนไข n Create by . Suwitchan Kaewsuwan

  26. Visual Basic .NET 2008 (SQL ) selectid,name fromemployeewhere salary > 8000andid=“MK001” Create by . Suwitchan Kaewsuwan

  27. Visual Basic .NET 2008 (SQL ) select*fromemployeewhere salary < 8500 and id=“AC001” Create by . Suwitchan Kaewsuwan

  28. Visual Basic .NET 2008 (SQL ) Relationship • 1 ต่อ 1 • 1 ต่อ Many • Manyต่อ Many Create by . Suwitchan Kaewsuwan

  29. Visual Basic .NET 2008 (SQL ) Relationship • Primary key (PK) • Foreign key (FK) Create by . Suwitchan Kaewsuwan

  30. Visual Basic .NET 2008 (SQL ) • 1 ต่อ 1 PK Data FK Student PK Create by . Suwitchan Kaewsuwan

  31. Visual Basic .NET 2008 (SQL ) • 1 ต่อ Many PK Major PK FK Student Create by . Suwitchan Kaewsuwan

  32. Visual Basic .NET 2008 (SQL ) • Manyต่อ Many Regis Grade Create by . Suwitchan Kaewsuwan

  33. Visual Basic .NET 2008 (SQL ) SQL แบบใช้ร่วมกันหลายตาราง รูปแบบคำสั่ง 1. selectชื่อตาราง1.field1,ชื่อตาราง1.field2, ชื่อตาราง2.field1,ชื่อตาราง2.field2fromชื่อตาราง1,ตาราง2 whereชื่อตาราง1.field= ชื่อตาราง2.field and … 2. selectชื่อตาราง1.*, ชื่อตาราง2.*fromชื่อตาราง1,ตาราง2 whereชื่อตาราง1.field= ชื่อตาราง2.field and … Create by . Suwitchan Kaewsuwan

  34. Visual Basic .NET 2008 (SQL ) SQL แบบใช้ร่วมกันหลายตาราง ตัวอย่าง ต้องการแสดงข้อมูลว่ามีนักศึกษาคนไหนอยู่ในสาขาวิชาคอมพิวเตอร์ธุรกิจบ้าง 1. select Major.Major_ID,Major_Name,Student_ID where Major.Major_ID=Student.Major_ID and Major_ID=“0001” Create by . Suwitchan Kaewsuwan

  35. Visual Basic .NET 2008 (SQL ) คำสั่งสำหรับ เพิ่มข้อมูลเข้าไปในตาราง รูปแบบ insert into (field1,field2,…) values (ค่าที่ใส่ใน field1, ค่าที่ใส่ใน field2)whereเงื่อนไข Create by . Suwitchan Kaewsuwan

More Related