Assignment 2
Assignment 2
C:\Users\sonuk>sqlplus
Version 21.3.0.0.0
Enter password:
Connected to:
Version 21.3.0.0.0
3 product_name varchar(20),
4 qty int,
5 price decimal);
Table created.
SQL> insert into product( product_id, product_name, qty, price) values (1001, 'pen red',
5000, 1.23);
1 row created.
SQL> insert into product( product_id, product_name, qty, price) values (1002, 'pen blue',
8000, 1.25);
1 row created.
SQL> insert into product( product_id, product_name, qty, price) values (1003, 'pen black',
2000, 1.25);
1 row created.
SQL> insert into product( product_id, product_name, qty, price) values (1004, 'pencil 2b',
10000, 0.48);
1 row created.
SQL> insert into product( product_id, product_name, qty, price) values (1005, 'pencil 2m',
2000, 0.48);
1 row created.
SQL> insert into product( product_id, product_name, qty, price) values (1006, 'pencil hb'. 0,
0.99);
insert into product( product_id, product_name, qty, price) values (1006, 'pencil hb'. 0, 0.99)
ERROR at line 1:
SQL> insert into product( product_id, product_name, qty, price) values (1006, 'pencil hb', 0,
0.99);
1 row created.
SQL> commit;
Commit complete.
PRODUCT_ID NUMBER(38)
PRODUCT_NAME VARCHAR2(20)
QTY NUMBER(38)
PRICE NUMBER(38)
1006 pencil hb 0 1
6 rows selected.
1006 pencil hb 0 1
6 rows selected.
SQL> select* from product where (qty between 2000 and 8000);
1 row updated.
6 rows updated.
1006 pencil hb 0 11
6 rows selected.
SQL>