Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

STUDY PROGRAM D-IV

TEKNIK INFORMATIKA POLITEKNIK NEGERI MALANG

Jl. Soekarno Hatta No. 9 Malang 65144

Student name : Hammam abdullah Saeed B.G

Nim : ( 2341720203)

N.a : 12

Class : TI_I1
Jobsheet-2:
Entity Relationship Diagram (ERD) Mata Kuliah Basis Data

TUGAS!
1. Buatlah rancangan sebuah database untuk toko online. Data-data yang akan ditanganinya adalah:

data pembeli atau customer, data produk, data order, data pembayaran dan data admin. Perlu

dicatat data transaksi pembelian seperti kode yang unik, tgl_pembelian, total_pembayaran.

Pembeli bisa membeli banyak barang dalam satu transaksi, produk bisa dibeli oleh banyak

pembeli. Perlu dicatat jumlah dan harga dari barang yang dibeli dalam satu transaksi pembelian.

Dalam pembelian juga perlu dicatat admin yang menangani pembelian. Setiap admin perlu dicatat

kode yang unik, nama, alamat, dan nomor_hp. Data pembeli yang perlu dicatat adalah kode yang

unik, nama, alamat, no_hp. Sedangkan data produk yang perlu dicatat adalah kode yang unik,

nama, satuan, harga, stok, dan keterangan. Buatlah ER Diagram manual untuk kasus tersebut dari

tahap 1 sampai 4!

❖ Answer!

➢ Tahab 1 :Determining Entities (Basic Objects):

Customer:

stores buyer data, with attributes customer_code (key), name, address and cellphone_no.

Product: stores product data, with attributes product_code (key), name, unit, price, stock and
description.

Order:

stores order data, with attributes order_code (key), purchase_date, and payment_total.

Payment:

stores payment data, with the payment_code (key) attribute.

Admin:

stores admin data, with admin_code (key), name, address and cellphone_number attributes.
➢ Tahab 2 : Determines the Attributes (Traits) of Each Entity:

• Customers

- customer_code (key attribute)

- name (simple attribute)

- address (simple attribute)

- cellphone_no(simple attribute)

• Products

- product_code (key attribute)

- name (simple attribute)

- unit (simple attribute)

- price (simple attribute)

- stock(simple attribute)

- description (simple attribute)

• Orders

- order_code (key attribute)

- purchase_date (simple attribute)

- total_payment (simple attribute)

• Payments

- payment_code (key attribute)

• Admin

- admin_code (key attribute)

- name (simple attribute)

- address (simple attribute)

- cellphone_number (simple attribute)


• Tahab 3 Determines the Relationship between Entities:
1.Customers and Orders

• Cardinality: One-to-Many (1:N)

• One customer can have many orders, but one order is associated with only one customer.

2.Products and Orders

• Cardinality: Many-to-Many (M:N)

• A single product can be in multiple orders, and a single order can contain multiple products.

3. Order and Payment

• Cardinality: One-to-One (1:1)

• Each order can only have one payment, and each payment relates to only one order.

4.Admin and Orders

• Cardinality: One-to-Many (1:N)

• One admin can handle multiple orders, but one order can only be handled by one admin.

➢ Tahab 4: Create a Manual ER Diagram:


2. Ambil contoh sembarang database, boleh dari sistem atau aplikasi yang sudah ada. Buatlah

rancangan ER Diagram manual database tersebut dari tahap 1-4 dengan ketentuan database

minimal mengandung 4 buah entitas.

Answer :
Digital Retail Platform

• Stage 1: Determining Entities (Basic Objects):

User: Represents the user of the Digital Retail Platform.

Product: Represents the product sold in the Digital Retail Platform.

Orders: Represents orders placed by the user.

Transaction: Represents financial transactions between users and Digital Retail Platform.

• Stage 2: Determines the Attributes (Traits) of Each Entity:

• User:

User ID (UserID)

Username (Username)

Email Address (Email)

Password (Password)

• Product:

Product ID (ProductID)

Product Name (ProductName)

Price

Description

• Orders:

Order ID (OrderID)

Order Date (OrderDate)

Amount (Quantity)

Total Price (TotalPrice)


• Transaction (Transaction):

Transaction ID (TransactionID)

Transaction Date (TransactionDate)

Transaction Type (TransactionType)

Amount.

• Stage 3: Determines the Relationship between Entities:

Relationship between Users and Orders: One user can place many orders (One-to-Many).

Relationship between Orders and Products: One order can consist of many products, and one product
can be in many orders (Many-to-Many).

Relationship between Users and Transactions: One user can carry out many transactions (One-to-Many).

Stage 4: Create a Manual ER Diagram

https://miro.com/app/board/uXjVNmcifQI=/?share_link_id=99843133839

You might also like