-
Notifications
You must be signed in to change notification settings - Fork 0
/
autodealer.sql
156 lines (127 loc) · 4.56 KB
/
autodealer.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
146
147
148
149
150
151
152
153
154
155
156
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 12, 2023 at 06:58 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28
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: `autodealer`
--
-- --------------------------------------------------------
--
-- Table structure for table `customertbl`
--
CREATE TABLE `customertbl` (
`CustId` int(11) NOT NULL,
`CustName` varchar(50) NOT NULL,
`CustAd` varchar(100) NOT NULL,
`CustPhone` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `customertbl`
--
INSERT INTO `customertbl` (`CustId`, `CustName`, `CustAd`, `CustPhone`) VALUES
(1, 'Kavindu', 'Galle', '12345'),
(2, 'Wick', 'Colombo07', '123456'),
(3, 'Kavindu Wick', 'Colombo05', '123456');
-- --------------------------------------------------------
--
-- Table structure for table `ordertbl`
--
CREATE TABLE `ordertbl` (
`OrderId` int(11) NOT NULL,
`OrderDate` varchar(100) DEFAULT current_timestamp(),
`CustId` int(11) NOT NULL,
`CustName` varchar(30) NOT NULL,
`PayMethod` varchar(30) NOT NULL,
`Price` varchar(11) NOT NULL,
`CarId` int(4) NOT NULL,
`carYear` int(4) NOT NULL,
`CarName` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `ordertbl`
--
INSERT INTO `ordertbl` (`OrderId`, `OrderDate`, `CustId`, `CustName`, `PayMethod`, `Price`, `CarId`, `carYear`, `CarName`) VALUES
(1, '2023-11-12 15:18:46', 2, 'Kamal', 'card', '300', 999, 2023, 'lambo'),
(10, '2023-11-12 17:16:14', 3, 'Kavindu Wick', 'Credit Card', '1234', 2, 1234, 'subra'),
(10, '2023-11-12 17:31:27', 1, 'Kavindu', 'Credit Card', '123', 1, 12, 'dsaf'),
(10, '2023-11-12 17:38:28', 1, 'Kavindu', 'Credit Card', '123', 1, 12, 'dsaf'),
(10, '2023-11-12 17:38:53', 2, 'Wick', 'Credit Card', '1230', 1, 12, 'dsaf'),
(10, '2023-11-12 17:41:54', 1, 'Kavindu', 'Credit Card', '246', 1, 12, 'dsaf'),
(10, '2023-11-12 17:42:51', 1, 'Kavindu', 'Credit Card', '246', 1, 12, 'dsaf'),
(10, '2023-11-12 18:01:13', 2, 'Wick', 'Credit Card', '615', 1, 12, 'dsaf'),
(10, '2023-11-12 18:02:21', 1, 'Kavindu', 'Credit Card', '246', 1, 12, 'dsaf'),
(10, '2023-11-12 18:10:26', 1, 'Kavindu', 'Credit Card', '246', 1, 12, 'dsaf');
-- --------------------------------------------------------
--
-- Table structure for table `producttbl`
--
CREATE TABLE `producttbl` (
`CarId` int(11) NOT NULL,
`CarName` varchar(50) NOT NULL,
`carYear` int(4) DEFAULT 9999,
`CarCategory` varchar(10) NOT NULL,
`Price` int(11) NOT NULL,
`Quantity` int(11) NOT NULL,
`SuplierId` int(11) NOT NULL,
`SuplierName` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `producttbl`
--
INSERT INTO `producttbl` (`CarId`, `CarName`, `carYear`, `CarCategory`, `Price`, `Quantity`, `SuplierId`, `SuplierName`) VALUES
(1, 'dsaf', 12, 'Toyota', 123, 1, 1, 'kavindu'),
(2, 'subra', 1234, 'Toyota', 1234, 2, 1, 'kavindu'),
(9, 'subru', 1998, 'Toyota', 21, 1, 4, 'kaviWIck');
-- --------------------------------------------------------
--
-- Table structure for table `suppliertb`
--
CREATE TABLE `suppliertb` (
`SupId` int(11) NOT NULL,
`SupName` varchar(50) NOT NULL,
`SupAddress` varchar(100) NOT NULL,
`SupPhone` varchar(15) NOT NULL,
`SupRemarks` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `suppliertb`
--
INSERT INTO `suppliertb` (`SupId`, `SupName`, `SupAddress`, `SupPhone`, `SupRemarks`) VALUES
(1, 'kavindu', 'asfdsaf', 'adfs', 'aswf'),
(2, 'Wick', 'Colombo05', '123456', 'Nice '),
(4, 'kaviWIck', 'col', '123456', 'aswf'),
(6, 'kavin', 'col5', '123456', 'aswf'),
(7, 'kavin', 'col5', '123456', 'aswf');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customertbl`
--
ALTER TABLE `customertbl`
ADD PRIMARY KEY (`CustId`);
--
-- Indexes for table `producttbl`
--
ALTER TABLE `producttbl`
ADD PRIMARY KEY (`CarId`);
--
-- Indexes for table `suppliertb`
--
ALTER TABLE `suppliertb`
ADD PRIMARY KEY (`SupId`);
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 */;