Selma Phpmyadmin
Selma Phpmyadmin
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 14 Jan 2024 pada 06.23
-- Versi server: 10.4.22-MariaDB
-- Versi PHP: 7.4.26
--
-- Database: `dbtokoobat_selma`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `product`
--
--
-- Dumping data untuk tabel `product`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `transaction`
--
--
-- Dumping data untuk tabel `transaction`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `transaction_product`
--
--
-- Dumping data untuk tabel `transaction_product`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `user`
--
--
-- Dumping data untuk tabel `user`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `user_type`
--
--
-- Dumping data untuk tabel `user_type`
--
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`product_id`);
--
-- Indeks untuk tabel `transaction`
--
ALTER TABLE `transaction`
ADD PRIMARY KEY (`transaction_id`),
ADD KEY `user_id` (`user_id`);
--
-- Indeks untuk tabel `transaction_product`
--
ALTER TABLE `transaction_product`
ADD PRIMARY KEY (`transaction_product_id`),
ADD KEY `product_id` (`product_id`),
ADD KEY `transaction_id` (`transaction_id`);
--
-- Indeks untuk tabel `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`),
ADD KEY `user_type_id` (`user_type_id`);
--
-- Indeks untuk tabel `user_type`
--
ALTER TABLE `user_type`
ADD PRIMARY KEY (`user_type_id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `product`
--
ALTER TABLE `product`
MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `transaction`
--
ALTER TABLE `transaction`
MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `transaction_product`
--
ALTER TABLE `transaction_product`
MODIFY `transaction_product_id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `user_type`
--
ALTER TABLE `user_type`
MODIFY `user_type_id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=2;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `transaction`
--
ALTER TABLE `transaction`
ADD CONSTRAINT `transaction_ibfk_1` FOREIGN KEY (`user_id`)
REFERENCES `user` (`user_id`);
--
-- Ketidakleluasaan untuk tabel `transaction_product`
--
ALTER TABLE `transaction_product`
ADD CONSTRAINT `transaction_product_ibfk_1` FOREIGN KEY
(`product_id`) REFERENCES `product` (`product_id`),
ADD CONSTRAINT `transaction_product_ibfk_2` FOREIGN KEY
(`transaction_id`) REFERENCES `transaction` (`transaction_id`);
--
-- Ketidakleluasaan untuk tabel `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`user_type_id`) REFERENCES
`user_type` (`user_type_id`);
COMMIT;