Create Tables
create table three as
(
char1 char(3),
date1 date10.,
num1 num
);
Insert rows
Insert into three
values('1', '01mar90'd, .33);
Insert into three
select * from one, two where one.key=two.key;
Create views: read-only
create view as
select * from one, two where one.key=two.key;
Create index
simple: based on one column.
create index idnum on three(key);
composite: based on more than one column
create index idnum on three(key1, key2);
Update Data Values
update three
set salary=salary*
case when substr(jobcode,3,1)='1' then 1.05
case when substr(jobcode,3,1)='2' then 1.08
case when substr(jobcode,3,1)='3' then 1.10
else 1.08
end;
(
char1 char(3),
date1 date10.,
num1 num
);
Insert rows
Insert into three
values('1', '01mar90'd, .33);
Insert into three
select * from one, two where one.key=two.key;
Create views: read-only
create view as
select * from one, two where one.key=two.key;
Create index
simple: based on one column.
create index idnum on three(key);
composite: based on more than one column
create index idnum on three(key1, key2);
Update Data Values
update three
set salary=salary*
case when substr(jobcode,3,1)='1' then 1.05
case when substr(jobcode,3,1)='2' then 1.08
case when substr(jobcode,3,1)='3' then 1.10
else 1.08
end;
No comments:
Post a Comment