-
Notifications
You must be signed in to change notification settings - Fork 36
/
railway.sql
145 lines (117 loc) · 4.45 KB
/
railway.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 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 13, 2016 at 03:20 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `railway`
--
-- --------------------------------------------------------
--
-- Table structure for table `passengers`
--
CREATE TABLE IF NOT EXISTS `passengers` (
`p_id` int(30) NOT NULL AUTO_INCREMENT,
`p_fname` varchar(30) DEFAULT NULL,
`p_lname` varchar(30) DEFAULT NULL,
`p_age` varchar(30) DEFAULT NULL,
`p_contact` varchar(20) DEFAULT NULL,
`p_gender` varchar(30) DEFAULT NULL,
`email` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`t_no` int(11) DEFAULT NULL,
PRIMARY KEY (`p_id`),
UNIQUE KEY `p_id` (`p_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `passengers`
--
INSERT INTO `passengers` (`p_id`, `p_fname`, `p_lname`, `p_age`, `p_contact`, `p_gender`, `email`, `password`, `t_no`) VALUES
(1, 'Rahul', 'Dravid', '42', '9090909090', 'Male', 'rahul@dravid.com', '123123123', 16205),
(2, 'Rahul', 'Dravid', '29', '1010101010', 'Male', 'qwe@w.cc', '123123123', NULL),
(4, 'qwe', 'qwe', '19', '1010101010', 'Male', '123@123.cc', '123123123', NULL),
(5, 'abc', 'sbc', '19', '9090909090', 'Male', 'abc@g.cc', '123123123', 12951),
(6, 'sumit', 'sharma', '20', '9999999999', 'Male', 'sharma@gmail.com', '123123123', 12951),
(7, 'dhruv', 'mehta', '20', '9191919191', 'Male', 'dhruv@gmail.com', '123123123', 16205);
-- --------------------------------------------------------
--
-- Table structure for table `staff`
--
CREATE TABLE IF NOT EXISTS `staff` (
`s_id` int(11) NOT NULL AUTO_INCREMENT,
`s_fname` varchar(10) DEFAULT NULL,
`s_lname` varchar(10) DEFAULT NULL,
`s_department` varchar(20) NOT NULL,
`s_salary` int(11) DEFAULT NULL,
PRIMARY KEY (`s_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `station`
--
CREATE TABLE IF NOT EXISTS `station` (
`s_no` int(11) NOT NULL AUTO_INCREMENT,
`s_name` varchar(20) DEFAULT NULL,
`s_no_of_platforms` varchar(20) DEFAULT NULL,
PRIMARY KEY (`s_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `station`
--
INSERT INTO `station` (`s_no`, `s_name`, `s_no_of_platforms`) VALUES
(1, 'borivali', '8'),
(2, 'Baroda', '6'),
(3, 'Surat', '4');
-- --------------------------------------------------------
--
-- Table structure for table `tickets`
--
CREATE TABLE IF NOT EXISTS `tickets` (
`PNR` decimal(10,0) NOT NULL,
`t_status` varchar(20) NOT NULL DEFAULT 'Waiting',
`t_fare` int(11) DEFAULT NULL,
`p_id` int(20) NOT NULL,
UNIQUE KEY `PNR` (`PNR`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tickets`
--
INSERT INTO `tickets` (`PNR`, `t_status`, `t_fare`, `p_id`) VALUES
(8056124359, 'Confirmed', 650, 5),
(8851599875, 'Waiting', 540, 1);
-- --------------------------------------------------------
--
-- Table structure for table `trains`
--
CREATE TABLE IF NOT EXISTS `trains` (
`t_no` decimal(5,0) NOT NULL,
`t_name` varchar(30) DEFAULT NULL,
`t_source` varchar(30) DEFAULT NULL,
`t_destination` varchar(30) DEFAULT NULL,
`t_type` varchar(30) DEFAULT NULL,
`t_status` varchar(20) DEFAULT 'On time',
`no_of_seats` int(11) DEFAULT NULL,
`t_duration` int(11) DEFAULT NULL,
PRIMARY KEY (`t_no`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `trains`
--
INSERT INTO `trains` (`t_no`, `t_name`, `t_source`, `t_destination`, `t_type`, `t_status`, `no_of_seats`, `t_duration`) VALUES
(4971, 'garibrath', 'Udaipurr', 'Jammu Tawi', 'Express', 'On time', 550, 20),
(12284, 'duronto', 'Mumbai central', 'Ernakulum', 'AC superfast', 'On time', 800, 24),
(12859, 'geetanjali', 'CST', 'Kolkata', 'express', 'On time', 500, 25),
(12951, 'rajdhani', 'Mumbai Central', 'Delhi', 'Superfast', 'On time', 700, 15),
(16205, 'mysoreexp', 'Talguppa', 'Mysore JN', 'Express', 'On time', 475, 21);
/*!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 */;