Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rlwrap with sqlplus in linux
- -> select count(*) from math_sample; // for count including null value too
- -> idata=null N.P , Use idata is null // use is keyword for comparing null
- -> select max(colname) from table // max value in col , same for min,avg
- -> select avg(all colname) from table // includees duplicates
- -> select avg(distinct colname ) from table // dublicates are not counted
- -> create table math_sample2 as( select rownum as srno , idata from math_sample m1);
- rename math_sample2 to math_sample ;
- -> select dbms_random.Value(1,1000) from dual; // generate random no
- -> alter table table_name add (colname number(5));
- -> update table_name set colname=value,col2=value2 where condition // to update the value
- -> for loop and pl/sql // reffer moodle doc
- -> printf=> dbms_output.put_line('String' || d)// '||' for concatination
- -> Question 1.
- 1. update product_master set sell_price=1150 where description like '1.44floppies';
- 2. delete from client_master where client_no=0001;
- 3. update client_master set city='Bombay' where client_no=0005;
- 4. update client_master set bal_due=1000 where client_no=0002;
- 5. update product_master set sell_price=1.5*sell_price where sell_price>1500;
- 6. select name from client_master where name like'_a*';
- 7.
- 8. select * from product_master order by sell_price asc , qty_on_hand asc;
- 9. select count(*) from client_master;
- 10. select avg(all sell_price) from product_master;
- 11. select min(sell_price) from product_master;
- 12. select min(sell_price) min_price , max(sell_price) max_price from product_master;
- 13. select count(*) from product_master where sell_price>=1500 ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement