Bunich

Lab1 - Basi

Mar 27th, 2018
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*select * from DELIVERERS;*/
  2. /*select distinct companyid from companydel */
  3. /*select delivererid,name from deliverers where name like 'B%'*/
  4. /*select name,sex,DELIVERERID from deliverers where phoneno<>8467 or phoneno is null;*/
  5. /*select distinct name,town from DELIVERERS D, PENALTIES P where P.DELIVERERID=D.DELIVERERID*/
  6. /*select distinct D.name,D.initials from DELIVERERS D,PENALTIES P,COMPANies C where D.DELIVERERID=P.DELIVERERID AND C.DELIVERERID=D.DELIVERERID AND P.DATA>to_date('31/12/1980','DD/MM/YYYY') order by D.NAME;*/
  7. /*select distinct C.COMPANYID,C.DELIVERERID from companydel C,Deliverers D where C.DELIVERERID=D.delivererid and D.town='Stratford' AND C.NUMCOLLECTIONS>=2 AND C.NUMDELIVERIES>=1;*/
  8. /*select D.DELIVERERID from COMPANYDEL CD, COMPANIES C, DELIVERERS D where D.YEAR_OF_BIRTH>1962 AND C.MANDATE='first' AND CD.DELIVERERID=D.DELIVERERID AND c.COMPANYID=CD.COMPANYID;*/
  9. /*select distinct D.name from companydel C1,companydel C2, deliverers D where C1.DELIVERERID=C2.DELIVERERID AND C1.COMPANYID<>C2.COMPANYID AND C1.DELIVERERID=D.DELIVERERID AND (D.town='Inglewood' OR D.town='Stratford');*/
  10. SELECT D.DELIVERERID,SUM(DISTINCT P1.AMOUNT)
  11. FROM PENALTIES P1, PENALTIES P2,DELIVERERS D
  12. WHERE P1.PAYMENTID<>P2.PAYMENTID AND P1.DELIVERERID=P2.DELIVERERID AND P1.DELIVERERID=D.DELIVERERID AND D.town='Inglewood'
  13. GROUP BY D.DELIVERERID;
RAW Paste Data