Skip to content Skip to navigation

Connexions

You are here: Home » Content » 2_Table - Bảng dữ liệu

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Recently Viewed

This feature requires Javascript to be enabled.

2_Table - Bảng dữ liệu

Module by: Thu Nguyen

Summary: Table

TABLE – BẢNG DỮ LIỆU

  1. Cấu trúc của table:

Table được tổ chức thành các cột (Field) và các dòng (Record).

Khi làm việc với Table, ta sẽ ở một trong 2 chế độ: Design View hoặc Datasheet view:

Figure 1
Figure 1 (graphics1.png)

Datasheet View

  1. Chế độ Design View:

Dùng để tạo mới hoặc sửa chữa cấu trúc của Table:

Figure 2
Figure 2 (graphics2.png)
  1. Vào chế độ Design View:
  • Tạo mới table:

Ở cửa sổ CSDL, chọn lớp Table, nhắp

Figure 3
Figure 3 (graphics3.png)
-> chọn Design View-> OK

  • Sửa chữa cấu trúc của Table:

Ở cửa sổ CSDL, chọn Table cần sửa, nhắp

Figure 4
Figure 4 (graphics4.png)

  1. Cấu trúc table- cửa sổ Design View:

Cửa sổ Design view gồm 3 cột: Field Name, Data Type, Description và một bảng con Field Properties:

  • Field Name: Khai báo tên cột (Field)
  • Data Type: chọn kiểu dữ liệu cho Field:
  • Text: Kiểu chuỗi
  • Number: kiểu số
  • Date/time: Kiểu ngày
  • Yes/No: kiểu logic (đúng/sai)
  • OLE Object: Đối tượng nhúng và liên kết (hình ảnh)
  • Description: dùng để giải thích, mô tả tên cột
  • Field properties: thuộc tính Field: +Field size: kích thước field

+Format: dang hiện dữ liệu +Decimal place: số số lẻ.

  1. Ra khỏi chế độ Design View:
  • Nhắp
    Figure 5
    Figure 5 (graphics5.png)
    để lưu lại cấu trúc table
  • Nếu đang tạo mới Table thì phải đặt tên cho Table và trả lời hộp thoại: …Do you want to create a primary key now? (chọn No)

( muốn chuyển qua chế độ Datasheet thì nhắp

Figure 6
Figure 6 (graphics6.png)
)

  1. Chế độ Datasheet View:

Chế độ Datasheet View cho phép xem và cập nhật dữ liệu của Table.

Muốn vào chế độ Datasheet View:

  • Nếu đang ở cửa sổ CSDL, chọn table muốn cập nhật, nhắp
    Figure 7
    Figure 7 (graphics7.png)
  • Nếu đang ở chế độ Design View, nhắp
    Figure 8
    Figure 8 (graphics8.png)
  • Khóa chính:
  1. Khái niệm:

Mỗi Table thường có một mục khóa chính. Khóa chính của 1 Table có thể là một hay kết hợp nhiều Field để Access phân biệt một Record với các record khác trong table.

  1. Khai báo khóa chính:
  • Tại cửa sổ CSDL, chọn table muốn tạo khóa chính, nhắp
    Figure 9
    Figure 9 (graphics9.png)
  • Chọn các field được chọn làm khóa chính (nhắp ô xám bên trái)
  • Nhắp biểu tượng
    Figure 10
    Figure 10 (graphics10.png)
    -> Nhắp
    Figure 11
    Figure 11 (graphics11.png)
  • Khai báo quan hệ giữa các table:
  1. Khái niệm:

Table A có quan hệ với table B nếu dữ liệu trên Table A có thể bổ sung thêm thông tin cho table B. Field giống nhau giữa 2 table gọi là Field quan hệ.

* Mối quan hệ 1-1: nếu giá trị trên Field quan hệ của table A chỉ xuất hiện một lần trên Field quan hệ của table B và ngược lại.

* Mối quan hệ 1-nhiều: nếu giá trị trên Field quan hệ của table A xuất hiện nhiều lần trên Field quan hệ của table B.

  1. Khai báo quan hệ giữa các table:
  • Bước 1: nhắp menu Tools/ Relationships ( hoặc nhắp
    Figure 12
    Figure 12 (graphics12.png)
    )
  • Bước 2: Chọn các table cần tạo quan hệ, nhắp nút
    Figure 13
    Figure 13 (graphics13.png)
    . Sau khi chọn xong nhắp
    Figure 14
    Figure 14 (graphics14.png)
  • Bước 3: Chọn field quan hệ của Table A, bấm giữ nút trái chuột và kéo lên filed quan hệ của Table B. Xuất hiện hộp thoại:

Bước 4Chọn

Figure 15
Figure 15 (graphics15.png)

- Bước 5: Nhắp

Figure 16
Figure 16 (graphics16.png)
. Nhắp
Figure 17
Figure 17 (graphics17.png)

Comments, questions, feedback, criticisms?

Send feedback