1 / 83

Everything that has a beginning has an end…

Everything that has a beginning has an end…. เอกสารประกอบการบรรยายรายวิชา 204204 การออกแบบและพัฒนาฐานข้อมูล. DBMATRIX Revolutions. เอกสารประกอบการบรรยายรายวิชา 204204 การออกแบบและพัฒนาฐานข้อมูล. Examples of Design & Development. Garage Book Rental Selected Applications in IC, MIS, IS.

Télécharger la présentation

Everything that has a beginning has an end…

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. Everything that has a beginning has an end… เอกสารประกอบการบรรยายรายวิชา 204204 การออกแบบและพัฒนาฐานข้อมูล

  2. DBMATRIX Revolutions เอกสารประกอบการบรรยายรายวิชา 204204 การออกแบบและพัฒนาฐานข้อมูล

  3. Examples of Design & Development • Garage • Book Rental • Selected Applications in IC, MIS, IS

  4. Garage • อู่ซ่อมรถแห่งหนึ่งต้องการระบบจัดเก็บข้อมูลลูกค้า ช่าง และการซ่อม เพื่อที่จะจัดการกับอู่ได้ง่ายและมีประสิทธิภาพกว่าเดิม

  5. Garage • อู่ซ่อมรถยนต์มีช่างซ่อมรถที่ชำนาญในการซ่อมรถยนต์เฉพาะยี่ห้อ ลูกค้าของอู่โดยปกติเป็นเจ้าของรถประมาณ 1-2 คัน การซ่อมรถใช้เวลาเพียงวันเดียวจะแล้วเสร็จ

  6. Garage • ทางอู่ต้องการระบบที่สามารถ 1) จัดเก็บข้อมูลลูกค้า รถ และช่างได้ 2) แสดงรายการรถที่ซ่อมอยู่ในวันปัจจุบัน 3) แสดงรายชื่อช่าง และปริมาณงาน และเงินที่ทำได้ตลอดปี 4) ค้นหาข้อมูลรถยนต์และชื่อที่อยู่ลูกค้าเพื่อจัดการลูกค้าสัมพันธ์

  7. Garage owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  8. Garage Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  9. Garage owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  10. Garage Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  11. Garage Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  12. Garage Customer (cust_id, name, address, phone, balance, car_make, car_model, car_year)

  13. Garage repairs Mechanic Car (mech_id, name, address, salary, skill) (car_id, make, model, year, owner)

  14. Garage repairs Mechanic Car (mech_id, name, address, salary, skill) (car_id, make, model, year, owner)

  15. Garage Mechanic Repairs Car (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) (car_id, make, model, …)

  16. Garage Mechanic Repairs Car (mecht_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) (car_id, make, model, …)

  17. Garage Mechanic Repairs Car (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) (car_id, make, model, …)

  18. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  19. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  20. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  21. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner)

  22. Garage • ทางอู่ต้องการระบบที่สามารถ 1) จัดเก็บข้อมูลลูกค้า รถ และช่างได้ 2) แสดงรายการรถที่ซ่อมอยู่ในวันปัจจุบัน 3) แสดงรายชื่อช่าง และปริมาณงาน และเงินที่ทำได้ตลอดปี 4) ค้นหาข้อมูลรถยนต์และชื่อที่อยู่ลูกค้าเพื่อจัดการลูกค้าสัมพันธ์

  23. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) 1) จัดเก็บข้อมูลลูกค้า รถ และช่างได้

  24. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) 2) แสดงรายการรถที่ซ่อมอยู่ในวันปัจจุบัน: เจ้าของ, รถ, ช่าง

  25. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) 3) แสดงรายชื่อช่าง ปริมาณงาน และเงินที่ทำได้ตลอดปี

  26. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) 4) ค้นหาข้อมูลรถยนต์และชื่อที่อยู่ลูกค้าเพื่อจัดการลูกค้าสัมพันธ์

  27. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) รายละเอียดการซ่อมรถแต่ละครั้งว่าซ่อมอะไร?

  28. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) รถยนต์ยี่ห้อใดเสียบ่อยที่สุด?

  29. Garage ER Diagram Repairs does Mechanic (mech_id, name, address, salary, skill) (mech_id, car_id, repair_date, price) is owns Customer Car (cust_id, name, address, phone, balance) (car_id, make, model, year, owner) รถยนต์ช่วงราคาใดเสียบ่อยที่สุด?

  30. Visual Basic

  31. Visual Basic

  32. Visual Basic With Database dbEmployee Determine Database Connect to the Database dbEmployee Execute Command SELECT * FROM employee Use Data Close Connection

  33. Visual Basic With Database Determine Database Set conAddress = New ADODB.Connection conAddress.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=LAB10;UID=user01;PWD=password;DATABASE=dbEmployee"

  34. Visual Basic With Database Connect to the Database conAddress.Open

  35. Visual Basic With Database Execute Command Set rstAddress = New ADODB.Recordset rstAddress.Open "SELECT * FROM employee ORDER BY empname", conAddress, adOpenStatic, adLockOptimistic

  36. Visual Basic With Database Use Data Set DataGrid1.DataSource = rstAddress

  37. Visual Basic With Database Close Connection rstAddress.Close Set rstAddress = Nothing conAddress.Close Set conAddress = Nothing

  38. Visual Basic With Database Determine Database Connect to the Database Execute Command Use Data Close Connection

  39. SQL Statement in Visual Basic

  40. SQL Statement in Visual Basic • SQL_Statement = "SELECT * FROM employee ORDER BY empname WHERE empname LIKE '" & Text1.Text & "'" • SQL_Statement = "INSERT INTO employee (empno, empname, address) VALUES('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "')" • SQL_Statement = "UPDATE employee SET empno='" & Text2.Text & "' WHERE empno = '" & Text1.Text & "'"

  41. SQL Statement in Visual Basic • SQL_Statement = "SELECT * FROM employee ORDER BY empname WHERE empname LIKE '" & Text1.Text & "'"

  42. SQL Statement in Visual Basic • SQL_Statement = "SELECT * FROM employee ORDER BY empname WHERE empname LIKE ‘” & Text1.Text & “’” • SELECT * FROM employee ORDER BY empname WHERE empname LIKE ‘somchai’

  43. SQL Statement in Visual Basic • SQL_Statement = "INSERT INTO employee (empno, empname, address) VALUES('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "')"

  44. SQL Statement in Visual Basic • SQL_Statement = "INSERT INTO employee (empno, empname, address) VALUES('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "')" • INSERT INTO employee (empno, empname, address) VALUES(“0001”, “Somchai”, “111 Univers…”)

  45. SQL Statement in Visual Basic • SQL_Statement = "UPDATE employee SET empno='" & Text2.Text & "' WHERE empno = '" & Text1.Text & "'"

  46. SQL Statement in Visual Basic • SQL_Statement = "UPDATE employee SET empname='" & Text2.Text & "' WHERE empno = '" & Text1.Text & "'" • UPDATE employee SET empname = ‘Somsak’ WHERE empno = ‘0001’

  47. ภาษาสำหรับจัดการข้อมูล Data Manipulation Language (DML)

  48. ภาษาสำหรับจัดการข้อมูล Data Manipulation Language (DML)

  49. ภาษาสำหรับจัดการข้อมูล Data Manipulation Language (DML) book rental member

  50. ภาษาสำหรับจัดการข้อมูล Data Manipulation Language (DML) book rental member

More Related