Skip to content

Commit dc6cb0d

Browse files
committed
Database file
0 parents  commit dc6cb0d

File tree

1 file changed

+241
-0
lines changed

1 file changed

+241
-0
lines changed

DB/e-booking.sql

+241
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 4.9.2
3+
-- https://www.phpmyadmin.net/
4+
--
5+
-- Host: 127.0.0.1
6+
-- Generation Time: Jul 29, 2023 at 04:13 AM
7+
-- Server version: 10.4.10-MariaDB
8+
-- PHP Version: 7.3.12
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
SET AUTOCOMMIT = 0;
12+
START TRANSACTION;
13+
SET time_zone = "+00:00";
14+
15+
16+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
17+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
18+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
19+
/*!40101 SET NAMES utf8mb4 */;
20+
21+
--
22+
-- Database: `e-booking`
23+
--
24+
25+
-- --------------------------------------------------------
26+
27+
--
28+
-- Table structure for table `accounts`
29+
--
30+
31+
CREATE TABLE `accounts` (
32+
`account_id` int(11) NOT NULL,
33+
`account_name` varchar(255) NOT NULL,
34+
`account_type` enum('asset','expense','equity','liability','income') NOT NULL
35+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
36+
37+
--
38+
-- Dumping data for table `accounts`
39+
--
40+
41+
INSERT INTO `accounts` (`account_id`, `account_name`, `account_type`) VALUES
42+
(1, 'Bank', 'asset'),
43+
(2, 'Capital', 'equity'),
44+
(3, 'Rent', 'expense'),
45+
(4, 'vehicle', 'asset'),
46+
(5, 'drawings', 'equity'),
47+
(6, 'purchase', 'expense'),
48+
(7, 'Sales', 'income'),
49+
(8, 'Inventory', 'asset'),
50+
(9, 'rent recievable', 'income'),
51+
(10, 'www', 'asset'),
52+
(11, 'leon', 'asset'),
53+
(12, 'hy', 'asset'),
54+
(13, 'ok', 'asset'),
55+
(14, 'then', 'asset'),
56+
(15, 'ttt', 'expense'),
57+
(16, 'qw', 'expense'),
58+
(17, 's', 'equity');
59+
60+
-- --------------------------------------------------------
61+
62+
--
63+
-- Table structure for table `journalentries`
64+
--
65+
66+
CREATE TABLE `journalentries` (
67+
`entry_id` int(11) NOT NULL,
68+
`transaction_id` int(11) NOT NULL,
69+
`account_id` int(11) NOT NULL,
70+
`debit_amount` decimal(10,2) DEFAULT NULL,
71+
`credit_amount` decimal(10,2) DEFAULT NULL
72+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
73+
74+
--
75+
-- Dumping data for table `journalentries`
76+
--
77+
78+
INSERT INTO `journalentries` (`entry_id`, `transaction_id`, `account_id`, `debit_amount`, `credit_amount`) VALUES
79+
(1, 1, 1, '10000000.00', '0.00'),
80+
(2, 2, 2, '0.00', '10000000.00'),
81+
(3, 3, 3, '100000.00', '0.00'),
82+
(4, 4, 1, '0.00', '100000.00'),
83+
(5, 5, 4, '15000.00', '0.00'),
84+
(6, 6, 1, '0.00', '15000.00'),
85+
(7, 7, 5, '15000.00', '0.00'),
86+
(8, 8, 1, '0.00', '15000.00'),
87+
(9, 9, 2, '15000.00', '0.00'),
88+
(10, 10, 5, '0.00', '15000.00'),
89+
(11, 11, 1, '0.00', '5000.00'),
90+
(13, 13, 6, '5000.00', '0.00'),
91+
(14, 14, 6, '0.00', '5000.00'),
92+
(15, 15, 8, '5000.00', '0.00'),
93+
(16, 16, 7, '8000.00', '0.00'),
94+
(17, 17, 7, '0.00', '8000.00'),
95+
(18, 18, 1, '8000.00', '0.00'),
96+
(19, 19, 8, '0.00', '8000.00'),
97+
(20, 20, 10, '500.00', '0.00'),
98+
(21, 20, 1, '0.00', '500.00'),
99+
(22, 21, 11, '1000.00', '0.00'),
100+
(23, 21, 1, '0.00', '1000.00'),
101+
(24, 22, 15, '100.00', '0.00'),
102+
(25, 22, 1, '0.00', '100.00'),
103+
(26, 23, 14, '10000.00', '0.00'),
104+
(27, 23, 1, '0.00', '10000.00'),
105+
(28, 24, 15, '1000.00', '0.00'),
106+
(29, 24, 1, '0.00', '1000.00');
107+
108+
-- --------------------------------------------------------
109+
110+
--
111+
-- Table structure for table `transactions`
112+
--
113+
114+
CREATE TABLE `transactions` (
115+
`transaction_id` int(11) NOT NULL,
116+
`transaction_date` date NOT NULL,
117+
`description` text DEFAULT NULL
118+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
119+
120+
--
121+
-- Dumping data for table `transactions`
122+
--
123+
124+
INSERT INTO `transactions` (`transaction_id`, `transaction_date`, `description`) VALUES
125+
(1, '2023-07-24', 'deposit'),
126+
(2, '2023-07-24', 'deposit'),
127+
(3, '2023-07-25', 'paid rent'),
128+
(4, '2023-07-25', 'paid rent'),
129+
(5, '2023-07-26', 'bought a car'),
130+
(6, '2023-07-26', 'bought a car'),
131+
(7, '2023-07-24', 'drawings for school fees'),
132+
(8, '2023-07-24', 'drawings for school fees'),
133+
(9, '2023-07-24', 'drawings for school fees'),
134+
(10, '2023-07-24', 'drawings for school fees'),
135+
(11, '2023-07-24', 'bought beans'),
136+
(13, '2023-07-24', 'bought beans'),
137+
(14, '2023-07-24', 'bought beans'),
138+
(15, '2023-07-24', 'bought beans'),
139+
(16, '2023-07-24', 'sold beans'),
140+
(17, '2023-07-24', 'sold beans'),
141+
(18, '2023-07-24', 'sold beans'),
142+
(19, '2023-07-24', 'sold beans'),
143+
(20, '2023-07-28', 'bought www'),
144+
(21, '2023-07-28', 'Buying Leon'),
145+
(22, '2023-07-28', 'ttt bought'),
146+
(23, '2023-07-28', 'then'),
147+
(24, '2023-07-29', 'oky test');
148+
149+
-- --------------------------------------------------------
150+
151+
--
152+
-- Table structure for table `users`
153+
--
154+
155+
CREATE TABLE `users` (
156+
`id` int(11) NOT NULL,
157+
`email` varchar(250) NOT NULL,
158+
`username` varchar(250) NOT NULL,
159+
`password` varchar(250) NOT NULL
160+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
161+
162+
--
163+
-- Dumping data for table `users`
164+
--
165+
166+
INSERT INTO `users` (`id`, `email`, `username`, `password`) VALUES
167+
(1, '[email protected]', 'admin', 'admin123');
168+
169+
--
170+
-- Indexes for dumped tables
171+
--
172+
173+
--
174+
-- Indexes for table `accounts`
175+
--
176+
ALTER TABLE `accounts`
177+
ADD PRIMARY KEY (`account_id`);
178+
179+
--
180+
-- Indexes for table `journalentries`
181+
--
182+
ALTER TABLE `journalentries`
183+
ADD PRIMARY KEY (`entry_id`),
184+
ADD KEY `transaction_id` (`transaction_id`),
185+
ADD KEY `account_id` (`account_id`);
186+
187+
--
188+
-- Indexes for table `transactions`
189+
--
190+
ALTER TABLE `transactions`
191+
ADD PRIMARY KEY (`transaction_id`);
192+
193+
--
194+
-- Indexes for table `users`
195+
--
196+
ALTER TABLE `users`
197+
ADD PRIMARY KEY (`id`);
198+
199+
--
200+
-- AUTO_INCREMENT for dumped tables
201+
--
202+
203+
--
204+
-- AUTO_INCREMENT for table `accounts`
205+
--
206+
ALTER TABLE `accounts`
207+
MODIFY `account_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
208+
209+
--
210+
-- AUTO_INCREMENT for table `journalentries`
211+
--
212+
ALTER TABLE `journalentries`
213+
MODIFY `entry_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
214+
215+
--
216+
-- AUTO_INCREMENT for table `transactions`
217+
--
218+
ALTER TABLE `transactions`
219+
MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
220+
221+
--
222+
-- AUTO_INCREMENT for table `users`
223+
--
224+
ALTER TABLE `users`
225+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
226+
227+
--
228+
-- Constraints for dumped tables
229+
--
230+
231+
--
232+
-- Constraints for table `journalentries`
233+
--
234+
ALTER TABLE `journalentries`
235+
ADD CONSTRAINT `journalentries_ibfk_1` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`transaction_id`),
236+
ADD CONSTRAINT `journalentries_ibfk_2` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`account_id`);
237+
COMMIT;
238+
239+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
240+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
241+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

0 commit comments

Comments
 (0)