Pengantar Database: Minggu 3
Pengantar Database: Minggu 3
Pengantar Database: Minggu 3
PENGANTAR DATABASE
FILE VS. DATABASES
Database
Management
System
Database
Database system adalah
Fact A Fact B kombinasi database, DBMS,
Fact C Fact D dan program aplikasi yang
Fact E Fact F
dapat mengakses data base
Database
Management
System
Jr.
38%
Database
Logical View—User A Logical View—User B
Scholarship Distribution
Enrollment by Class Fr.
5%
Sr. Soph.
33% 24%
Jr.
38%
DBMS
The operating system
Operating translates DBMS requests
System into instructions to
physically retrieve data
from various disks.
Database
RELATIONAL DATABASES
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID Student ID Course
333333333-1234 333-33-3333 1234
333333333-1236 333-33-3333 1236
111111111-1235 111-11-1111 1235
111111111-1236 111-11-1111 1235
STUDENTS Each row is called a
Last First Phone tuple, which
Student ID Name Name No. rhymes with
333-33-3333 Simpson Alice 333-3333 “couple.”
111-11-1111 Sanders Ned 444-4444
123-45-6789 Moore Artie 555-5555
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
Each row contains
STUDENTS
data about a
Last First Phone
specific occurrence
Student ID Name Name No.
of the type of entity
333-33-3333 Simpson Alice 333-3333
in the table.
111-11-1111 Sanders Ned 444-4444
123-45-6789 Moore Artie 555-5555
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
STUDENTS Each column in a
Last First Phone table contains
Student ID Name Name No. information about a
333-33-3333 Simpson Alice 333-3333 specific attribute of
111-11-1111 Sanders Ned 444-4444 the entity.
123-45-6789 Moore Artie 555-5555
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234
333333333-1236
111111111-1235
111111111-1236
STUDENTS
Last First Phone
Student ID Name Name No.
333-33-3333 Simpson Alice 333-3333
111-11-1111 Sanders Ned 444-4444
123-45-6789 Moore Artie 555-5555
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
A primary key is the attribute
SCID
or combination of attributes
333333333-1234 that uniquely identifies a
333333333-1236 specific row in a table.
111111111-1235
111111111-1236
STUDENTS
Last First Phone
Student ID Name Name No.
333-33-3333 Simpson Alice 333-3333
111-11-1111 Sanders Ned 444-4444
123-45-6789 Moore Artie 555-5555
COURSES
Course ID Course Section Day Time
1234 ACCT-3603 1 MWF 8:30
1235 ACCT-3603 2 TR 9:30
1236 MGMT-2103 1 MW 8:30
STUDENT x COURSE
SCID
333333333-1234 In some tables, two or more attributes may be
333333333-1236 joined to form the primary key.
111111111-1235
111111111-1236
STUDENTS
First Advisor
Student ID Last Name Name Phone No. No.
333-33-3333 Simpson Alice 333-3333 1418
111-11-1111 Sanders Ned 444-4444 1418
123-45-6789 Moore Artie 555-5555 1503
ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Melton Amy 316
1503 Zhang Xi 202
1506 Radowski J.D. 203
ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Melton Amy 316
1503 Zhang Xi 202
1506 Radowski J.D. 203
ADVISORS
Advisor No. Last Name First Name Office No.
1418 Howard Glen 420
1419 Melton Amy 316
1503 Zhang Xi 202
1506 Radowski J.D. 203
• Suppose Alice Simpson changes her phone number. You need to make the
change in three places. If you fail to change it in all three places or change it
incorrectly in one place, then the records for Alice will be inconsistent.
• This problem is referred to as an update anomaly.
Last First
Student ID Name Name Phone No. Course No. Section Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 Th 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM
• What happens if you have a new student to add, but he hasn’t signed up for
any courses yet?
• Or what if there is a new class to add, but there are no students enrolled in it
yet? In either case, the record will be partially blank.
• This problem is referred to as an insert anomaly.
Last First
Student ID Name Name Phone No. Course No. Section Day Time
333-33-3333 Simpson Alice 333-3333 ACCT-3603 1 M 9:00 AM
333-33-3333 Simpson Alice 333-3333 FIN-3213 3 Th 11:00 AM
333-33-3333 Simpson Alice 333-3333 MGMT-3021 11 Th 12:00 PM
111-11-1111 Sanders Ned 444-4444 ACCT-3433 2 T 10:00 AM
111-11-1111 Sanders Ned 444-4444 MGMT-3021 5 W 8:00 AM
111-11-1111 Sanders Ned 444-4444 ANSI-1422 7 F 9:00 AM
123-45-6789 Moore Artie 555-5555 ACCT-3433 2 T 10:00 AM
123-45-6789 Moore Artie 555-5555 FIN-3213 3 Th 11:00 AM
• If Ned withdraws from all his classes and you eliminate all three of his rows
from the table, then you will no longer have a record of Ned. If Ned is
planning to take classes next semester, then you probably didn’t really want to
delete all records of him.
• This problem is referred to as a delete anomaly.
DATABASE SYSTEMS AND THE FUTURE OF
ACCOUNTING
Database systems dapat mempengaruhi sifat fundamental dari
akuntansi :
Memiliki potensi untuk mengubah sifat pelaporan eksternal
Contoh: External users diberikan akses untuk bisa mengkopi data base perusahaan,
sebagai ganti dari laporan keuangan tradisional
DATABASE SYSTEMS AND THE FUTURE OF
ACCOUNTING
Pengaruh adanya database dalam hal bagaimana informasi
akuntansi digunakan dalam pengambilan keputusan :
The ability to accommodate multiple views of the same underlying
phenomenon.
The ability to integrate financial and operational data.
LATIHAN