This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbbmi.sql
145 lines (116 loc) · 3.52 KB
/
dbbmi.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 19, 2023 at 01:44 AM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `dbmi2`
--
-- --------------------------------------------------------
--
-- Table structure for table `calculator`
--
CREATE TABLE `calculator` (
`id_calculation` int(11) NOT NULL,
`tinggi_badan` int(11) DEFAULT NULL,
`berat_badan` int(11) DEFAULT NULL,
`hasil_bmi` int(11) DEFAULT NULL,
`hasil_keterangan_bmi` varchar(255) DEFAULT NULL,
`id_gender` int(11) DEFAULT NULL,
`id_user` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `calculator`
--
INSERT INTO `calculator` (`id_calculation`, `tinggi_badan`, `berat_badan`, `hasil_bmi`, `hasil_keterangan_bmi`, `id_gender`, `id_user`) VALUES
(1, 170, 70, 24, 'Normal', 1, 1),
(2, 160, 55, 21, 'Normal', 2, 2),
(3, 180, 80, 25, 'Normal', 1, 3);
-- --------------------------------------------------------
--
-- Table structure for table `gender`
--
CREATE TABLE `gender` (
`id_gender` int(11) NOT NULL,
`jenis_gender` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `gender`
--
INSERT INTO `gender` (`id_gender`, `jenis_gender`) VALUES
(1, 'Laki-laki'),
(2, 'Perempuan');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id_user` int(11) NOT NULL,
`username` varchar(255) DEFAULT NULL,
`email_user` varchar(255) DEFAULT NULL,
`password_user` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id_user`, `username`, `email_user`, `password_user`) VALUES
(1, 'Cak Lontong', '[email protected]', 'cli'),
(2, 'Joji', '[email protected]', 'jojiaja'),
(3, 'Mimosa', '[email protected]', 'password123'),
(4, 'Juki', '[email protected]', 'jukikoki');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `calculator`
--
ALTER TABLE `calculator`
ADD PRIMARY KEY (`id_calculation`),
ADD KEY `id_gender` (`id_gender`),
ADD KEY `id_user` (`id_user`);
--
-- Indexes for table `gender`
--
ALTER TABLE `gender`
ADD PRIMARY KEY (`id_gender`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id_user`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `calculator`
--
ALTER TABLE `calculator`
MODIFY `id_calculation` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `calculator`
--
ALTER TABLE `calculator`
ADD CONSTRAINT `calculator_ibfk_1` FOREIGN KEY (`id_gender`) REFERENCES `gender` (`id_gender`),
ADD CONSTRAINT `calculator_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `users` (`id_user`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;