Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO DEPT(DEPTID, DEPTNAME) VALUES
- ( 1, 'DEPT1'),
- (2, 'DEPT2'),
- (3,'DEPT2'),
- (4,'DEPT4'),
- (5,'DEPT4'),
- (6,'DEPT6');
- INSERT INTO WORK (WORKID, DEPTID, SAL,CITYID) VALUES
- ( 100,1,1000,10),
- ( 100,2,2000,10),
- ( 200,1,2500,20),
- ( 300,3,1000,10),
- ( 300,6,3000,10),
- ( 300,6,1000,30)
- ;
- Cityid deptname count avg-sal
- 10 dept1 1 1000
- 10 dept2 2 1500
- 10 dept4 0 0
- 10 dept6 1 3000
- Grandtotal 3 2333.33
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement