-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLQuery1 Project1.sql
57 lines (48 loc) · 1.67 KB
/
SQLQuery1 Project1.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
-- Creating the schema and required tables using MySQLworkbench
-- Create a schema named Travego and create the tables mentioned above with the mentioned column names.
-- Also, declare the relevant datatypes for each feature/column in the dataset
create database Travelgoproject;
use Travelgoproject;
create table passenger(Passenger_id INT,
Passenger_name VARCHAR(20),
Category VARCHAR(20),
Gender VARCHAR(20),
Boarding_City VARCHAR(20),
Destination_City VARCHAR(20),
Distance INT,
Bus_Type VARCHAR(20),
PRIMARY KEY(Passenger_id));
CREATE TABLE Price(
Id INT,
Bus_Type VARCHAR(20),
Distance INT,
Price INT,
PRIMARY KEY(Id)
);
-- b.Insert the data in the newly created tables.
INSERT INTO Passenger VALUES
(1,'Sejal','AC','F','Bengaluru','Chennai',350,'Sleeper'),
(2, 'Anmol','Non-AC','M','Mumbai','Hyderabad ',700,'Sitting'),
(3,'Pallavi','AC','F','Panaji','Bengaluru',600,'Sleeper'),
(4,'Khusboo','AC','F','Chennai','Mumbai',1500,'Sleeper'),
(5,'Udit','Non-AC','M','Trivandrum','Panaji',1000,'Sleeper'),
(6,'Ankur','AC','M','Nagpur','Hyderabad',500,'Sitting'),
(7,'Hemant','Non-AC','M','Panaji','Mumbai',700,'Sleeper'),
(8,'Manish','Non-AC','M','Hyderabad','Bengaluru',500,'Sitting'),
(9,'Piyush','AC','M','Pune','Nagpur',700,'Sitting');
INSERT INTO Price VALUES
(1,'Sleeper',350,770),
(2,'Sleeper',500,1100),
(3,'Sleeper',600,1320),
(4,'Sleeper',700,1540),
(5,'Sleeper',1000,2200),
(6,'Sleeper',1200,2640),
(7,'Sleeper',1500,2700),
(8,'Sitting',500,620),
(9,'Sitting',600,744),
(10,'Sitting',700,868),
(11,'Sitting',1000,1240),
(12,'Sitting',1200,1488),
(13,'Sitting',1500,1860);
Select * From dbo.passenger
Select * From dbo.Price