Professional Documents
Culture Documents
MIS Note 3
MIS Note 3
Access DB Tutorial
1 2
Database Database
eet
adsh
e
Spr
3 4
3 4
Database Databases
Relationships: Values in one table may relate rows to those in other tables
5 6
5 6
1
2023. 4. 13.
Database Database
Table Primary Key § Relational databases store data in tables that represent
relationships using primary key and foreign key
§ Primary Key
Attributes
§ Column (or group of columns) that makes each row unique in a
table
§ E.g. “student number” can be the primary of the “student” table
§ Composite primary keys if a group of columns are primary key
§ Foreign Key
§ Non-key column or field in one table that links to a primary key
in another table
§ E.g., “student number” in “email” and “office visit” tables
7 8
7 8
9 10
實體聯繫圖
Entity Relationship Diagram (ERD) or E-R Diagram Database Management Systems (DBMS)
} Cardinality
} Software for creating, storing, organizing, and accessing data
from a database
} Separates the logical and physical views of the data
} Logical view: how end users view data
} Physical view: how data are actually structured and
§ Relationship between two entities organized
§ 1 to 1 (1:1) } Examples: Microsoft Access, DB2, Oracle Database, Microsoft
§ 1 to Many (1:N) SQLServer, MySQL
§ Many to Many (N:M)
§ Many to Many is not allowed
§ Use join table – converts “Many to Many” to “1 to Many” and “Many to 1”
11 12
12
11 12
2
2023. 4. 13.
關聯資料庫管理系統
13 14
13 14
15 16
15 16
} We can keep track of the patients, the doctors and when the patients
last saw their doctors, what happened at each visit and so on
17 18
17 18
3
2023. 4. 13.
19 20
19 20
21 22
21 22
23 24
23 24
4
2023. 4. 13.
25 26
25 26
27 28
27 28
29 30
29 30
5
2023. 4. 13.
2. In the Show Table Window, push the Add button and the close the
window
3. Double-clicking on the field names to the add Pt First Name, Pt
Last Name, and Pt Gender
31 32
31 32
33 34
35 36
35 36
6
2023. 4. 13.
37 38
37 38
39 40
39 40
SQL code:
41 42
7
2023. 4. 13.
43 44