You are not logged in Log in Join
You are here: Home » Members » MJ's corner on Zope » QuantumPythons » Question10 » wikipage_view

Log in
Name

Password

 
 
FrontPage »

Question10

Question 10

Delete the order with an ordno of 1024. Show the ORDER table to verify that ordno 1024 was deleted. Verify that the delete cascaded.

SQL:

    delete from order
      where ordno='1024';

    DB20000I  The SQL command completed successfully.

Output:

    select * from order ;

    ORDNO MONTH CID  AID
    1011  jan   c001 a01
    1012  jan   c001 a01
    1013  jan   c002 a03
    1014  jan   c003 a03
    1015  jan   c003 a03
    1016  jan   c006 a01
    1017  feb   c001 a06
    1018  feb   c001 a03
    1019  feb   c001 a02
    1020  feb   c006 a03
    1021  feb   c004 a06
    1022  mar   c001 a05
    1023  mar   c001 a04
    1025  apr   c001 a05
    1026  may   c002 a05
    1035  may   c006 a06
    1036  may   c006 a06
    1050  may   c006 a01

    18 record(s) selected.

    Notice that all references to 1024 do not now appear below:

    select * from ord_order_line ;

    ORDNO MONTH CID  AID LINENO PID QTY         DOLLARS  
    1011  jan   c001 a01      1 p01        1000    450.00
    1011  jan   c001 a01      2 p05        1200   1100.00
    1011  jan   c001 a01      3 p07         600    600.00
    1011  jan   c001 a01      4 p03         800    700.00
    1012  jan   c001 a01      1 p01        1000    450.00
    1013  jan   c002 a03      1 p03        1000    880.00
    1014  jan   c003 a03      1 p05        1200   1104.00
    1015  jan   c003 a03      1 p05        1200   1104.00
    1016  jan   c006 a01      1 p01        1000    500.00
    1017  feb   c001 a06      1 p03         600    540.00
    1017  feb   c001 a06      2 p01         101      0.50
    1018  feb   c001 a03      1 p04         600    540.00
    1018  feb   c001 a03      2 p06         400    720.00
    1018  feb   c001 a03      3 p07         600    600.00
    1019  feb   c001 a02      1 p02         400    180.00
    1019  feb   c001 a02      2 p06         400    720.00
    1020  feb   c006 a03      1 p07         600    600.00
    1021  feb   c004 a06      1 p01        1000    460.00
    1021  feb   c004 a06      2 p06         400    700.00
    1022  mar   c001 a05      1 p06         400    720.00
    1022  mar   c001 a05      2 p05        1200   1200.00
    1023  mar   c001 a04      1 p05         500    450.00
    1025  apr   c001 a05      1 p07         800    720.00
    1026  may   c002 a05      1 p03         800    704.00
    1035  may   c006 a06      1 p01         101      0.55
    1035  may   c006 a06      2 p06         400    725.00
    1036  may   c006 a06      1 p01         101      0.55
    1036  may   c006 a06      2 p05         400    400.00
    1050  may   c006 a01      1 p01         101      0.50

    29 record(s) selected.

    select * from order_cost ;

    ORDNO CID  AID MONTH TOTAL_COST                       
    1011  c001 a01 jan                             2850.00
    1012  c001 a01 jan                              450.00
    1013  c002 a03 jan                              880.00
    1014  c003 a03 jan                             1104.00
    1015  c003 a03 jan                             1104.00
    1016  c006 a01 jan                              500.00
    1017  c001 a06 feb                              540.50
    1018  c001 a03 feb                             1860.00
    1019  c001 a02 feb                              900.00
    1020  c006 a03 feb                              600.00
    1021  c004 a06 feb                             1160.00
    1022  c001 a05 mar                             1920.00
    1023  c001 a04 mar                              450.00
    1025  c001 a05 apr                              720.00
    1026  c002 a05 may                              704.00
    1035  c006 a06 may                              725.55
    1036  c006 a06 may                              400.55
    1050  c006 a01 may                                0.50

    18 record(s) selected.


mj (Sep 17, 2001 7:29 pm; Comment #1)
Q said he'd do this one.