Postingan

Menampilkan postingan dari Oktober, 2023

(UTS) DATABASE ADVANCED

Gambar
  Buat Data Master Aplikasi Kasir dengan PHP & MongoDB yang collection terdiri dari: kategori_menu: _id, nama_kategori menu: _id, id_kategori, nama_menu, harga user: _id, username, password, level pelanggan: _id, nama, email, no_hp, alamat Buat list menu link yang menghubungkan antar aplikasi crud & NAMA+NIM pada header aplikasi hasil:

MongoDB for VSCode

Gambar
  MongoDB for VSCode adalah ekstensi atau plugin yang memungkinkan pengembang untuk berinteraksi dengan database MongoDB langsung dari lingkungan pengembangan Visual Studio Code. Ekstensi ini menyediakan sejumlah fitur yang mempermudah pengelolaan dan pengembangan aplikasi yang menggunakan MongoDB. Beberapa fitur umum yang disediakan oleh MongoDB for VSCode meliputi: Explorer : Memungkinkan  untuk menjelajahi dan mengelola basis data dan koleksi di server MongoDB . Query Playground : Memungkinkan untuk mengeksekusi perintah MongoDB di dalam VSCode, sehingga  dapat menguji dan mengoptimalkan kueri  tanpa harus beralih ke antarmuka baris perintah MongoDB. Import/Export Data : Memungkinkan  untuk mengimpor dan mengekspor data dari dan ke basis data MongoDB. Visual Data Explorer : Memberikan antarmuka visual untuk menjelajahi dan memanipulasi data di koleksi MongoDB. Schema Validation : Memungkinkan  untuk mendefinisikan aturan validasi untuk dokumen di koleksi...

FUNCTION FUNDAMENTAL

Gambar
  1- Functions Compute the sum of a_list (already defined in the code editor) without using sum(). Initialize a variable named sum_manual with a value of 0. Loop through a_list, and for each iteration add the current number to sum_manual. Print sum_manual and sum(a_list) to check whether the values are the same. 2- Built-in Function Generate a frequency table for the ratings list, which is already initialized in the code editor. Start by creating an empty dictionary named content_ratings. Loop through the ratings list. For each iteration: If the rating is already in content_ratings, then increment the frequency of that rating by 1. Else, initialize the rating with a value of 1 inside the content_ratings dictionary. Print content_ratings. 3- Creating our own Functions Recreate the square() function above and compute the square for numbers 10 and 16. Assign the square of 10 to a variable named squared_10. Assign the square of 16 to a variable named squared_16. 4- The Structure of Fun...

Dictionaries and Frequency Tables

Gambar
  1.Storing Data Store the data in the table above using two different lists. Assign the list ['4+', '9+', '12+', '17+'] to a variable named content_ratings. Assign the list [4433, 987, 1155, 622] to a variable named numbers. Store the data in the table above using a list of lists. Assign the list [['4+', '9+', '12+', '17+'], [4433, 987, 1155, 622]] to a variable named content_rating_numbers. 2.Dictionaries Map content ratings to their corresponding numbers by recreating the dictionary above: {'4+': 4433, '9+': 987, '12+': 1155, '17+': 622}. Assign the dictionary to a variable named content_ratings. Print content_ratings and examine the output carefully. Has the order we used to create the dictionary been preserved? In other words, is the output identical to {'4+': 4433, '9+': 987, '12+': 1155, '17+': 622}? We'll discuss more about this on the next screen....

CRUD MongoDB-PHP

  PENGERTIAN CRUD CRUD adalah singkatan dari Create, Read, Update, dan Delete. Proses ini sangat berkaitan dengan pengambilan atau transaksi data dari atau ke database.Data yang diproses  merupakan data transaksi. Create  (C) merupakan proses pembuatan data baru. Proses ini biasanya dilakukan ketika Anda mendaftar pada sebuah halaman website. Read  (R) merupakan proses pengambilan data dari database. Proses ini biasanya terjadi ketika Anda ingin melakukan proses login di halaman website tertentu. Update  (U) adalah proses mengubah data yang berada di dalam database. Contoh proses ini ketika Anda mengubah profil di dalam akun sosial media. Saat Anda klik “Ubah”,  website akan mengirimkan proses Update ke dalam database. Dalete(D)adalah proses menghapus data di database. kita perlu menghubungkan aplikasi PHP kita dengan server MongoDB. Hal ini dapat dilakukan menggunakan MongoDB PHP driver. <?php    $client = new MongoDB\Client("mongodb://localho...

Conditional Statements

Gambar
  If Cancitional  "pernyataan if," yang merupakan struktur kontrol yang digunakan untuk membuat keputusan dalam kode. Pernyataan "if" untuk menjalankan blok kode jika kondisi tertentu terpenuhi. Complete the code in the editor to find the average rating for free apps. Inside the for loop: Assign the price of an app as a float to a variable named price. The price is the fifth element in each row (don't forget that the index starts at 0). If price == 0.0, append the value stored in rating to the free_apps_ratings list using the list_name.append() command (note the free_apps_ratings is already defined in the code editor). Be careful with indentation. Outside the for loop body, compute the average rating of free apps. Assign the result to a variable named avg_rating_free. The ratings are stored in the free_apps_ratings list. Booleans Booleans (dalam pemrograman, sering disebut bool) adalah tipe data yang mewakili nilai kebenaran atau keputusan dalam pemrograman. Tip...