radhiyahfahra
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Modul Praktikum: Kondisi dan Tindakan Menggunakan phpMyAdmin ## 1. Pendahuluan Dalam pengembangan aplikasi berbasis web, database memegang peranan penting untuk menyimpan, mengelola, dan mengambil data. Salah satu alat yang paling umum digunakan untuk manajemen database adalah phpMyAdmin. Dalam modul ini, kita akan mempelajari bagaimana membuat dan mengelola database serta tabel menggunakan phpMyAdmin, termasuk mengisi data, membuat relasi antar tabel, dan menerapkan kondisi serta tindakan dalam konteks medis. ## 2. Dasar Teori ### 2.1 Database Database adalah kumpulan data yang disimpan secara sistematis. Dalam database, data disimpan dalam bentuk tabel yang terdiri dari baris dan kolom. Setiap tabel merepresentasikan sebuah entitas dalam sistem. ### 2.2 Relasi Antar Tabel Relasi antar tabel digunakan untuk menghubungkan data yang ada di tabel satu dengan tabel lainnya. Relasi ini biasanya diterapkan untuk memastikan konsistensi data. Ada beberapa jenis relasi dalam database, seperti: - **One to One**: Satu baris di tabel A hanya berhubungan dengan satu baris di tabel B. - **One to Many**: Satu baris di tabel A bisa berhubungan dengan banyak baris di tabel B. - **Many to Many**: Banyak baris di tabel A berhubungan dengan banyak baris di tabel B. ### 2.3 Auto Increment Auto Increment adalah fitur di mana nilai kolom secara otomatis meningkat setiap kali ada data baru yang dimasukkan. Biasanya digunakan untuk kolom ID atau primary key. ### 2.4 phpMyAdmin phpMyAdmin adalah alat berbasis web yang digunakan untuk mengelola MySQL atau MariaDB. Dengan phpMyAdmin, pengguna dapat membuat, memodifikasi, dan menghapus database, tabel, serta mengatur relasi antar tabel. ## 3. Langkah-Langkah Praktikum ### 3.1 Membuat Database 1. Buka phpMyAdmin di browser Anda. 2. Klik menu **Databases** di bagian atas. 3. Masukkan nama database, misalnya `medis`, dan klik **Create**. ### 3.2 Membuat Tabel `patients` 1. Klik pada database `medis`. 2. Klik **Create Table** dan masukkan nama tabel `patients` dengan 5 kolom. 3. Buat struktur tabel seperti berikut: - `id`: INT, AUTO_INCREMENT, Primary Key - `name`: VARCHAR(100) - `age`: INT - `gender`: ENUM('Male', 'Female') - `address`: TEXT 4. Klik **Save** untuk menyimpan. #### Penjelasan: - Kolom `id` menggunakan auto increment untuk otomatis menambahkan nilai setiap kali ada data baru. - Kolom `gender` menggunakan tipe ENUM untuk membatasi pilihan hanya pada 'Male' dan 'Female'. ### 3.3 Membuat Tabel `doctors` 1. Di database yang sama, buat tabel `doctors` dengan struktur: - `id`: INT, AUTO_INCREMENT, Primary Key - `name`: VARCHAR(100) - `specialization`: VARCHAR(100) - `phone`: VARCHAR(15) ### 3.4 Membuat Tabel `appointments` 1. Buat tabel ketiga dengan nama `appointments` yang berfungsi mencatat janji temu pasien dengan dokter. Struktur tabel: - `id`: INT, AUTO_INCREMENT, Primary Key - `patient_id`: INT - `doctor_id`: INT - `appointment_date`: DATE 2. Tambahkan relasi antar tabel: - Pada tabel `appointments`, tambahkan foreign key `patient_id` yang merujuk ke kolom `id` di tabel `patients`. - Tambahkan foreign key `doctor_id` yang merujuk ke kolom `id` di tabel `doctors`. #### Penjelasan: - Tabel `appointments` menyimpan data tentang janji temu, di mana `patient_id` menghubungkan pasien dengan tabel `patients`, dan `doctor_id` menghubungkan dokter dengan tabel `doctors`. ### 3.5 Mengisi Data ke dalam Tabel 1. Untuk mengisi data ke tabel `patients`, pilih tabel `patients` lalu klik **Insert** dan masukkan data seperti berikut: - `name`: John Doe - `age`: 30 - `gender`: Male - `address`: 123 Main St. 2. Lakukan hal yang sama untuk tabel `doctors`, contoh data: - `name`: Dr. Smith - `specialization`: Cardiology - `phone`: 555-1234 3. Untuk tabel `appointments`, masukkan data dengan memilih `patient_id` dan `doctor_id` yang sesuai: - `patient_id`: 1 (John Doe) - `doctor_id`: 1 (Dr. Smith) - `appointment_date`: 2024-09-30 ### 3.6 Melihat Relasi dan Data 1. Klik **Structure** di tabel `appointments`, dan Anda akan melihat relasi antara `patients` dan `doctors`. 2. Pilih **Browse** di setiap tabel untuk melihat data yang sudah diisi. ## 4. Analisa - Relasi yang dibuat memungkinkan untuk melacak janji temu antara pasien dan dokter dengan mudah. Tabel `appointments` bertindak sebagai penghubung antara pasien dan dokter, di mana setiap janji temu memiliki referensi yang jelas ke pasien dan dokter. - Auto Increment di kolom `id` mempermudah pembuatan primary key secara otomatis, menghindari kesalahan dalam input data manual. - Penggunaan foreign key memastikan konsistensi data, misalnya pasien atau dokter yang dihapus tidak akan menyebabkan kesalahan dalam tabel `appointments`. ## 5. Kesimpulan Dalam praktikum ini, kita telah belajar bagaimana membuat database, tabel, mengisi data, dan membuat relasi antar tabel menggunakan phpMyAdmin. Pemahaman ini sangat penting dalam pengelolaan database yang efisien dan terstruktur, terutama di bidang medis di mana integritas dan keterkaitan data sangat dibutuhkan.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully