Skip to content

Commit f18983e

Browse files
committed
Ajout export db
1 parent 0106117 commit f18983e

File tree

1 file changed

+257
-0
lines changed

1 file changed

+257
-0
lines changed

db.sql

+257
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 5.2.1
3+
-- https://www.phpmyadmin.net/
4+
--
5+
-- Host: 127.0.0.1
6+
-- Generation Time: Jan 18, 2025 at 06:45 PM
7+
-- Server version: 10.4.32-MariaDB
8+
-- PHP Version: 8.2.12
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
START TRANSACTION;
12+
SET time_zone = "+00:00";
13+
14+
15+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
16+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
17+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
18+
/*!40101 SET NAMES utf8mb4 */;
19+
20+
--
21+
-- Database: `bankapp`
22+
--
23+
24+
-- --------------------------------------------------------
25+
26+
--
27+
-- Table structure for table `clients`
28+
--
29+
30+
CREATE TABLE `clients` (
31+
`id_client` int(11) NOT NULL,
32+
`nom` varchar(20) NOT NULL,
33+
`prenom` varchar(20) NOT NULL,
34+
`mot_de_passe` varchar(255) NOT NULL,
35+
`adresse` varchar(255) DEFAULT NULL,
36+
`telephone` varchar(15) DEFAULT NULL
37+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
38+
39+
--
40+
-- Dumping data for table `clients`
41+
--
42+
43+
INSERT INTO `clients` (`id_client`, `nom`, `prenom`, `mot_de_passe`, `adresse`, `telephone`) VALUES
44+
(1, 'Martin', 'Jacques', 'Citrouille2000', '12 avenue Albert Thomas, 87000 Limoges', '06-12-12-12-12'),
45+
(2, 'Dubois', 'Jacqueline', 'XT1234xt', '3 avenue de Landouge, 87100 Limoges', '05-24-13-14-15'),
46+
(3, 'Canteloup', 'Grégoire', 'Bidulle84!', '47 avenue du Limousin, 87220 Feytiat', '07-29-30-31-78'),
47+
(4, 'Carrère', 'Stéphane', 'Gpasdidé', '8, rue de la Garenne, 87430 Verneuil-sur-Vienne', '06-25-95-94-09'),
48+
(5, 'Vincent', 'Cécile', 'Moinonplus!', '75 rue du Général du Cray, 87000 Limoges', '06-84-65-12-00');
49+
50+
-- --------------------------------------------------------
51+
52+
--
53+
-- Table structure for table `comptes`
54+
--
55+
56+
CREATE TABLE `comptes` (
57+
`id_compte` int(11) NOT NULL,
58+
`id_client` int(11) DEFAULT NULL,
59+
`id_conseiller` int(11) NOT NULL,
60+
`type_compte` varchar(20) DEFAULT NULL,
61+
`solde` decimal(15,2) DEFAULT NULL,
62+
`date_ouverture` date DEFAULT NULL,
63+
`decouvert_autorise` decimal(15,2) DEFAULT NULL
64+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
65+
66+
--
67+
-- Dumping data for table `comptes`
68+
--
69+
70+
INSERT INTO `comptes` (`id_compte`, `id_client`, `id_conseiller`, `type_compte`, `solde`, `date_ouverture`, `decouvert_autorise`) VALUES
71+
(1, 1, 1, 'courant individuel', 1000.00, '2025-01-01', 100.00),
72+
(2, 1, 1, 'courant commun', 1500.00, '2025-01-01', 100.00),
73+
(3, 1, 1, 'epargne', 10500.00, '2025-01-01', 0.00),
74+
(4, 2, 2, 'courant individuel', 1200.00, '2025-01-01', 500.00),
75+
(5, 2, 2, 'courant commun', 1600.00, '2025-01-01', 200.00),
76+
(6, 2, 2, 'epargne', 2200.00, '2025-01-01', 100.00),
77+
(7, 3, 2, 'courant individuel', 1300.00, '2025-01-01', 0.00),
78+
(8, 3, 2, 'courant commun', 1700.00, '2025-01-01', 0.00),
79+
(9, 3, 2, 'epargne', 8550.00, '2025-01-01', 0.00),
80+
(10, 4, 1, 'courant individuel', 1400.00, '2025-01-01', 0.00),
81+
(11, 4, 1, 'courant commun', 1800.00, '2025-01-01', 1000.00),
82+
(12, 4, 1, 'epargne', 2400.00, '2025-01-01', 2000.00),
83+
(13, 5, 3, 'courant individuel', 1500.00, '2025-01-01', 1.00),
84+
(14, 5, 3, 'courant commun', 1900.00, '2025-01-01', 1.00),
85+
(15, 5, 3, 'epargne', 2500.00, '2025-01-01', 0.00);
86+
87+
-- --------------------------------------------------------
88+
89+
--
90+
-- Table structure for table `conseillers`
91+
--
92+
93+
CREATE TABLE `conseillers` (
94+
`id_conseiller` int(11) NOT NULL,
95+
`nom` varchar(20) NOT NULL,
96+
`prenom` varchar(20) NOT NULL,
97+
`specialisation` varchar(30) DEFAULT NULL
98+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
99+
100+
--
101+
-- Dumping data for table `conseillers`
102+
--
103+
104+
INSERT INTO `conseillers` (`id_conseiller`, `nom`, `prenom`, `specialisation`) VALUES
105+
(1, 'Lemoine', 'Sophie', 'Crédit immobilier'),
106+
(2, 'Petitjean', 'Pierre', 'Crédit immobilier'),
107+
(3, 'Durand', 'Corinne', 'Investissements financiers');
108+
109+
-- --------------------------------------------------------
110+
111+
--
112+
-- Table structure for table `prets`
113+
--
114+
115+
CREATE TABLE `prets` (
116+
`id_pret` int(11) NOT NULL,
117+
`id_client` int(11) DEFAULT NULL,
118+
`montant` decimal(15,2) DEFAULT NULL,
119+
`taux_interet` decimal(5,4) DEFAULT NULL,
120+
`date_debut` date DEFAULT NULL,
121+
`duree` int(11) DEFAULT NULL
122+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
123+
124+
--
125+
-- Dumping data for table `prets`
126+
--
127+
128+
INSERT INTO `prets` (`id_pret`, `id_client`, `montant`, `taux_interet`, `date_debut`, `duree`) VALUES
129+
(1, 1, 12000.00, 3.5600, '2025-01-02', 24),
130+
(2, 2, 1000000.00, 2.4700, '2025-01-13', 120),
131+
(3, 3, 1200.00, 3.6200, '2025-01-08', 7);
132+
133+
-- --------------------------------------------------------
134+
135+
--
136+
-- Table structure for table `transactions`
137+
--
138+
139+
CREATE TABLE `transactions` (
140+
`id_transaction` int(11) NOT NULL,
141+
`id_compte` int(11) DEFAULT NULL,
142+
`type` varchar(20) DEFAULT NULL,
143+
`montant` decimal(15,2) DEFAULT NULL,
144+
`date_transaction` date DEFAULT NULL,
145+
`statut` varchar(20) DEFAULT NULL
146+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
147+
148+
--
149+
-- Dumping data for table `transactions`
150+
--
151+
152+
INSERT INTO `transactions` (`id_transaction`, `id_compte`, `type`, `montant`, `date_transaction`, `statut`) VALUES
153+
(1, 1, 'debit', 200.00, '2025-01-01', 'validé'),
154+
(2, 1, 'virement', 300.00, '2025-01-05', 'en attente'),
155+
(3, 1, 'virement', 500.00, '2025-01-15', 'enregistré'),
156+
(4, 2, 'debit', 150.00, '2025-01-10', 'annulé'),
157+
(5, 2, 'virement', 300.00, '2025-02-20', 'refusé'),
158+
(6, 3, 'virement', 100.00, '2025-02-05', 'en attente'),
159+
(7, 3, 'virement', 700.00, '2025-02-25', 'en attente'),
160+
(8, 4, 'virement', 250.00, '2025-02-14', 'en attente'),
161+
(9, 4, 'virement', 400.00, '2025-02-28', 'en attente'),
162+
(10, 5, 'debit', 300.00, '2025-02-12', 'en attente'),
163+
(11, 5, 'virement', 350.00, '2025-02-22', 'en attente');
164+
165+
--
166+
-- Indexes for dumped tables
167+
--
168+
169+
--
170+
-- Indexes for table `clients`
171+
--
172+
ALTER TABLE `clients`
173+
ADD PRIMARY KEY (`id_client`);
174+
175+
--
176+
-- Indexes for table `comptes`
177+
--
178+
ALTER TABLE `comptes`
179+
ADD PRIMARY KEY (`id_compte`),
180+
ADD KEY `id_client` (`id_client`),
181+
ADD KEY `id_conseiller` (`id_conseiller`);
182+
183+
--
184+
-- Indexes for table `conseillers`
185+
--
186+
ALTER TABLE `conseillers`
187+
ADD PRIMARY KEY (`id_conseiller`);
188+
189+
--
190+
-- Indexes for table `prets`
191+
--
192+
ALTER TABLE `prets`
193+
ADD PRIMARY KEY (`id_pret`),
194+
ADD KEY `id_client` (`id_client`);
195+
196+
--
197+
-- Indexes for table `transactions`
198+
--
199+
ALTER TABLE `transactions`
200+
ADD PRIMARY KEY (`id_transaction`),
201+
ADD KEY `id_compte` (`id_compte`);
202+
203+
--
204+
-- AUTO_INCREMENT for dumped tables
205+
--
206+
207+
--
208+
-- AUTO_INCREMENT for table `clients`
209+
--
210+
ALTER TABLE `clients`
211+
MODIFY `id_client` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
212+
213+
--
214+
-- AUTO_INCREMENT for table `comptes`
215+
--
216+
ALTER TABLE `comptes`
217+
MODIFY `id_compte` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
218+
219+
--
220+
-- AUTO_INCREMENT for table `prets`
221+
--
222+
ALTER TABLE `prets`
223+
MODIFY `id_pret` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
224+
225+
--
226+
-- AUTO_INCREMENT for table `transactions`
227+
--
228+
ALTER TABLE `transactions`
229+
MODIFY `id_transaction` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
230+
231+
--
232+
-- Constraints for dumped tables
233+
--
234+
235+
--
236+
-- Constraints for table `comptes`
237+
--
238+
ALTER TABLE `comptes`
239+
ADD CONSTRAINT `comptes_ibfk_1` FOREIGN KEY (`id_client`) REFERENCES `clients` (`id_client`) ON DELETE SET NULL,
240+
ADD CONSTRAINT `comptes_ibfk_2` FOREIGN KEY (`id_conseiller`) REFERENCES `conseillers` (`id_conseiller`);
241+
242+
--
243+
-- Constraints for table `prets`
244+
--
245+
ALTER TABLE `prets`
246+
ADD CONSTRAINT `prets_ibfk_1` FOREIGN KEY (`id_client`) REFERENCES `clients` (`id_client`) ON DELETE SET NULL;
247+
248+
--
249+
-- Constraints for table `transactions`
250+
--
251+
ALTER TABLE `transactions`
252+
ADD CONSTRAINT `transactions_ibfk_1` FOREIGN KEY (`id_compte`) REFERENCES `comptes` (`id_compte`);
253+
COMMIT;
254+
255+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
256+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
257+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

0 commit comments

Comments
 (0)