Wa0007.
Wa0007.
Wa0007.
EXP 11:
create table cust(accountno number(9),name char(10),balance number(6));
Table created.
1 row created.
SQL> /
Enter value for accountno: 39509443
Enter value for name: sita
Enter value for balance: 5000
old 1: insert into cust values(&acountno,'&name',&balance)
new 1: insert into cust values(39509443,'sita',5000)
1 row created.
SQL> /
Enter value for accountno: 39509556
Enter value for name: sharath
Enter value for balance: 10000
old 1: insert into cust values(&acountno,'&name',&balance)
new 1: insert into cust values(39509556,'sharath',10000)
1 row created.
Table created.
1 row created.
SQL> /
Enter value for sid: 320
Enter value for ename: smith
Enter value for depts: research
Enter value for salary: 20000
old 1: insert into employees values('&sid','&ename','&depts',&salary)
new 1: insert into employees values('320','smith','research',20000)
1 row created.
SQL> /
Enter value for sid: 420
Enter value for ename: james
Enter value for depts: it
Enter value for salary: 30000
old 1: insert into employees values('&sid','&ename','&depts',&salary)
new 1: insert into employees values('420','james','it',30000)
1 row created.
EXP 13:
SQL> create table clg(id number(2),dept char(5),course char(10));
Table created.
1 row created.
SQL> /
Enter value for id: 12
Enter value for dept: cse
Enter value for course: pg
old 1: insert into clg values(&id,'&dept','&course')
new 1: insert into clg values(12,'cse','pg')
1 row created.
SQL> /
Enter value for id: 13
Enter value for dept: mech
Enter value for course: ug
old 1: insert into clg values(&id,'&dept','&course')
new 1: insert into clg values(13,'mech','ug')
1 row created.
ID DEPT COURSE
---------- ----- ----------
11 it btech
12 cse pg
13 mech ug
SQL> create table clg1(id number(2),course char(10));
Table created.
ID COURSE
---------- ----------
11 btech
12 pg
13 ug
13 ug
EXP 14:
SQL> create table account (acct_num number(5), amount number(5));
Table created.
1 row created.
SQL> /
Enter value for acct_num: 2612
Enter value for amount: 5000
old 1: insert into account values(&acct_num,&amount)
new 1: insert into account values(2612,5000)
1 row created.
SQL> /
Enter value for acct_num: 7896
Enter value for amount: 4000
old 1: insert into account values(&acct_num,&amount)
new 1: insert into account values(7896,4000)
1 row created.
ACCT_NUM AMOUNT
---------- ----------
2341 3000
2612 5000
7896 4000
set serveroutput on;
create trigger updcheck1 before update on account
for each row
begin
if new.amount < 0 then
set new.amount = 0;
elseif new.amount > 100 then
set new.amount = 100;
end if;
end;
/