18bce0009 Dbms Da
18bce0009 Dbms Da
CSE-2004
Lab Assignment-2
Reg.no:18BCE0009
Slot: L53+L54
no rows selected
UPPER(NAME)
------------------------------
SATHABDHI EXPRESS
ANDAMAN EXPRESS
MANDOR EXPRESS
G T EXPRESS
TAMIL NADU EXPRESS
LPAD(NAME,20,'@')
--------------------
@@@@@@@MAHENDRA
@@@@@@@@@DHONI
@@@@@@@@@SURESH
@@@@@@@@@VIRAT
@@@@@@@@AKSHAY
REPLACE(STATION_CODE
--------------------
JP
DEC
AGC
GWL
BPL
TRANSLATE(CLASS,'LC','POT')
------------------------------
AO OHAIR OAR
AO OHAIR OAR
sleeper
sleeper
sleeper
6.Display the fare details of all trains, if any value is ZERO, print as NULL value.
SQL> select *from Train_Ticket_fare;
7.Display the pnrno and transaction id, if transaction id is null, print 'not generated'.
PNRNO NVL(TRANSACTIONID,'NOTGENERATE
---------- ------------------------------
2334567890 VADE0B248930
2334567880 VADE0B248920
2334567850 VADE0B248910
2334567892 VADE0B248910
2334567891 VADE0B248931
TO_CHAR(TO_DATE(DAT
-------------------
09th august 2018
10th august 2018
11th august 2018
06th august 2018
06th august 2018
MAX(TOTAL_TICKET_FARE)
----------------------
780
10. Find the average age of passengers in one
ticket. SQL> select avg(age) from Passenger_details;
AVG(AGE)
----------
22
MAX(LENGTH(NAME))
-----------------
11
ROUND(TOTAL_TICKET_FARE)
------------------------
700
665
370
780
780
Table altered.
1 row updated.
1 row updated.
1 row updated.
SQL> update Train_route set Halt_time_min=2 where train_number=12050;
1 row updated.
1 row updated.
High Level:
15. Update values to arrival time and depart time using conversion functions.
16. Display the arrival time, depart time in the format HH:MI (24 hours and minutes).
ARRIVAL_TI DEPART_TIM
---------- ----------
02:35 02:45
06:33 06:35
01:00 01:03
11:16 11:18
05:20 05:25
*THE END*