Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insert account details only
- INSERT INTO account_tbl(passengerTitle_ID, account_Forename, account_Surname, account_Email, account_AddressLine1, account_AddressLine2, account_Mobile, easyjetPlus_Number, preferredDepart_1, preferredDepart_2, preferredDepart_3, contact_Opt)
- VALUES ('1', 'Erin', 'Reid', 'erinr123@gmail.com', '1 Main Street', '', '2826', '125548', '1', '6', '3', '1');
- ----------------------------------------------
- insert account id details and then account security
- INSERT INTO account_tbl(passengerTitle_ID, account_Forename, account_Surname, account_Email, account_AddressLine1, account_AddressLine2, account_Mobile, easyjetPlus_Number, preferredDepart_1, preferredDepart_2, preferredDepart_3, contact_Opt)
- VALUES ('4', 'Steven', 'McBride', 'steven@gmail.com', '964 John Street', '', '159632', '12748', '1', '6', '3', '1');
- INSERT INTO accountSecurity_ID (account_Password, account_Answer, account_Question, account_ID)
- VALUES ('password', 'dog', 'what is your favourite animal', '7');
- ------------------------------------------------
- 1. insert account and then insert security for that new account
- INSERT INTO account_tbl(passengerTitle_ID, account_Forename, account_Surname, account_Email, account_AddressLine1, account_AddressLine2, account_Mobile, easyjetPlus_Number, preferredDepart_1, preferredDepart_2, preferredDepart_3, contact_Opt)
- VALUES ('4', 'Charlie', 'McBride', 'steven@gmail.com', '964 John Street', '', '159632', '12748', '1', '6', '3', '1');
- INSERT INTO accountSecurity_ID (account_ID, account_Password, account_Answer, account_Question)
- SELECT account_ID, 'password', 'dog', 'what is your favourite animal'
- FROM account_tbl WHERE account_Forename = 'Charlie';
- -----------------------------------------------
- 2. insert account and then insert security for that new account and then insert a booking for that account
- INSERT INTO account_tbl(passengerTitle_ID, account_Forename, account_Surname, account_Email, account_AddressLine1, account_AddressLine2, account_Mobile, easyjetPlus_Number, preferredDepart_1, preferredDepart_2, preferredDepart_3, contact_Opt)
- VALUES ('1', 'Sarah', 'Sholdis', 'sarah@hotmail.com', '1 Seahill Road', '', '7887456985', '55555', '1', '6', '3', '1');
- INSERT INTO accountSecurity_ID(account_ID, account_Password, account_Answer, account_Question)
- SELECT account_ID, 'password', 'lennon', 'what is your mothers maiden name'
- FROM account_tbl WHERE account_Forename = 'Sarah';
- INSERT INTO booking_tbl(account_ID, booking_date, all_CheckedIn, flight_ID_DEPART, flight_ID_RETURN, total_Bill)
- SELECT account_ID, '05/12/2017', '0', '2', '1', ''
- FROM account_tbl WHERE account_Forename = 'Sarah';
- -------------------------------------------------
- 3. booking passengers onto a flight
- INSERT INTO booking_tbl(account_ID, booking_date, all_CheckedIn, flight_ID_DEPART, flight_ID_RETURN, total_Bill)
- SELECT account_ID, '05/12/2017', '1', '1', '2', '0'
- FROM account_tbl WHERE account_Forename = 'Louise';
- INSERT INTO passenger_tbl(passengerAge_ID, booking_ID, passengerType_ID, passengerTitle_ID, passenger_Forename, passenger_Surname, checked_In)
- SELECT passengerAge_ID, booking_ID, passengerType_ID, passengerTitle_ID, 'Anthony', 'Flynn', '0'
- FROM passengerAge_tbl, booking_tbl, passengerType_tbl, passengerTitle_tbl WHERE passenger_Age = '15' AND booking_ID = 6 AND passengerType_ID = 2 AND passengerTitle_ID = 4;
- ------------------------------------------------
- 4. add two bags for an existing passenger and then add the values of them together to get the cost
- INSERT INTO bags_tbl(passenger_ID, holdBag_ID, otherBag_ID)
- SELECT passenger_ID, '3', '4'
- FROM passenger_tbl WHERE passenger_Forename = 'Anthony';
- SELECT holdBag_tbl.holdBag_Price, otherBag_tbl.otherBag_Price, (holdBag_Price + otherBag_Price) AS TotalBagPrice
- FROM bags_tbl INNER JOIN
- holdBag_tbl ON bags_tbl.holdBag_ID = holdBag_tbl.holdBag_ID INNER JOIN
- otherBag_tbl ON bags_tbl.otherBag_ID = otherBag_tbl.otherBag_ID
- WHERE passenger_ID = 14
- ------------------------------------------------
- SELECT route_tbl.route_Price, booking_tbl.booking_ID
- FROM booking_tbl INNER JOIN
- flight_tbl ON booking_tbl.flight_ID_RETURN = flight_tbl.flight_ID INNER JOIN
- flightRoute_ID ON flight_tbl.flight_ID = flightRoute_ID.route_ID INNER JOIN
- route_tbl ON flightRoute_ID.route_ID = route_tbl.route_ID
- WHERE booking_ID = 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement