Report Database Ci6114
Report Database Ci6114
(Stock Exchange)
SESSION 2007/2008
SEMESTER 1
Thwe Mi Mi Ko [G0701735C]
D a te
" s e m in a r " " p r o m o t io n "
P a id Venue
d
Typ e
T yp e
p a r tic ip a te M A C T IV IT Y
P a ssw o rd N IC A d d re s s
D e s c r ip tio n
Name N
P hone N
B ir th d a y o r g a n iz e Name
USER 1
U s e r ID A d d re s s
Type CORPORA
C o rp R e g N o
T IO N
T yp e d C u s tN o P o r tfo lio ID C ash A m ou n t P hone
1
" a d m in " "b ro ke r" " c u s to m e r "
S ym b o l
is s u e
A D M IN BROKER 1 e m p lo y N C U S TO M E R 1 has 1 P O R T F O L IO N own
In d e x N o
N
1 M
r e fe r r e r r e fe r e e
S ta ffN o L ic e n s e N o 1 N V a lu e
Q u a n tity
L im ite d S TO CK
r e fe r own
O r d e r ID
U p d a te T im e
N 1
T yp e
S ym b o l V a lu e L IM IT E D _ N c o n ta in s P r ic e
ORDER
BACKUP_ P r ic e
U p d a te T im e Lot
S TO C K Lot
2007-10-19 1
entity. Since the payment of a registration fee depends on a particular user and a particular activity, so
we add attribute Paid at the PARTICIPATE relation. There are two types of activity: SEMINAR and
PROMOTION for ACTIVITY entity and differences between these two are seminar needs payment for
registration and promotion is free to attend (assumption). So, we put Fee attribute in SEMINAR entity.
A corporate may organize none to more than one activity while an activity must be held by one
company only at a time therefore we choose total participation for ACTIVITY entity and the degree of
relationship is one to many. A corporation can issue more than one stock, at the same time a stock has
to be issued by a corporation so total participation is for STOCK entity and one-to-many relationship is
applied.
USER
Attribute Data type
PK UserID int
Name varchar(40)
Password varchar(20)
Birthday datetime
NIC varchar(16)
Type varchar(8)
USERADDRESS
Attribute Data type
PK/FK UserID references USER.UserID int
Address varchar(200)
USERPHONE
Attribute Data type
PK/FK UserID references USER.UserID int
Phone varchar(40)
ADMIN
Attribute Data type
PK/FK UserID references USER.UserID int
StaffNo int
BROKER
Attribute Data type
PK/FK UserID references USER.UserID int
LicenseNo int
CUSTOMER
Attribute Data type
PK/FK UserID references USER.UserID int
CustNo int
FK ReferrerID references CUSTOMER.UserID int
FK BrokerID references BROKER.UserID int
2007-10-19 2
CORPORATION
Attribute Data type
PK CorpRegNo varchar(20)
Name varchar(40)
Address varchar(255)
Phone varchar(20)
ACTIVITY
Attribute Data type
PK ActivityId int
Description varchar(255)
Date datetime
Venue varchar(255)
Fee decimal(10,2)
FK CorpRegNo references CORPORATION.CorpRegNo varchar(20)
Type varchar(9)
STOCK
Attribute Data type
PK Symbol varchar(10)
IndexNo int
Value decimal(10,2)
UpdateTime datetime
Lot int
Price decimal(10,2)
FK CorpRegNo references CORPORATION.CorpRegNo varchar(20)
Blocked bit
BACKUP_STOCK
Attribute Data type
PK Symbol varchar(10)
PK UpdateTime datetime
IndexNo int
Value decimal(10,2)
Lot int
Price decimal(10,2)
PORTFOLIO
Attribute Data type
PK PortfolioID int
CashAmount decimal(10,2)
FK UserId references CUSTOMER.UserID int
2007-10-19 3
LIMITEDORDER
Attribute Data type
PK LimitedOrderID int
Price decimal(10,2)
Type varchar(4)
Quantity int
TransactionTime datetime
TransactionPrice decimal(10,2)
TransactionQuantity int
FK PortfolioID references PORTFOLIO.PortfolioID int
FK Symbol references STOCK.Symbol varchar(10)
OWN
Attribute Data type
PK/FK PortfolioID references PORTFOLIO.PortfolioID int
PK/FK Symbol references STOCK.Symbol varchar(10)
Quantity int
PARTICIPATE
Attribute Data type
PK/FK UserID references USER.UserID int
PK/FK ActivityID references ACTIVITY.ActivityID int
Paid bit
2 Normalization
1NF
USERADDRESS
UserID, Address
USERPHONE
UserID, Phone
Address and Phone are multi-valued attributes (a user may have more than one address and
phone).According to remove the repeating group of data in USER table, these attributes is stored in two
separate tables: USERADDRESS and USERPHONE together with the primary key UserID for link to
USER table.
For USERADDRESS, UserID and Address becomes a compound key and UserID and Phone is for
USERPHONE to uniquely identify the records.
2007-10-19 4
2NF
All relations have single-attribute primary key except from BACKUP_STOCK relation whose data
depends on UpdateTime and Symbol and no partial key dependency is found.
All non-key attributes is fully dependent on primary key in all relations so all are already in 2NF.
3NF
Although non-key dependency is found in STOCK relation i.e. every attributes value can retrieve
using IndexNo which is not a primary key but unique key for that relation, there is no duplicate value
for indexno and symbol together in every record.
As there is no dependency between non-key items in the rest of the relations so 3NF is already
satisfied.
-- ----------------------------
);
-- ----------------------------
-- ----------------------------
UserID int not null primary key foreign key references [USER] (UserID),
);
-- ----------------------------
2007-10-19 5
-- ----------------------------
UserID int not null primary key foreign key references [USER] (UserID),
);
-- ----------------------------
-- ----------------------------
UserID int not null primary key foreign key references [USER] (UserID),
);
-- ----------------------------
-- ----------------------------
);
-- ----------------------------
-- ----------------------------
);
2007-10-19 6
-- ----------------------------
-- ----------------------------
);
-- ----------------------------
-- ----------------------------
check ((Type = 'seminar' and Fee is not null) or (Type = 'promotion' and Fee is null))
);
-- ----------------------------
-- ----------------------------
2007-10-19 7
UpdateTime datetime not null,
);
-- ----------------------------
-- ----------------------------
);
-- ----------------------------
-- ----------------------------
UserID int not null unique foreign key references CUSTOMER (UserID),
);
-- ----------------------------
-- ----------------------------
2007-10-19 8
LimitedOrderID int not null primary key,
);
-- ----------------------------
-- ----------------------------
);
-- ----------------------------
-- ----------------------------
);
4 Triggers
create trigger noChangeSymbol on STOCK for update as
2007-10-19 9
go
go
go
UpdateTime',16,1);
go
update(TransactionPrice))
filled',16,1);
go
2007-10-19 10
declare @maxDiff decimal(10,2);
update STOCK set Blocked = 1 where Symbol = (select Symbol from INSERTED);
go
5 Queries
create procedure query1_others as
go
BACKUP_STOCK as B2 where UpdateTime < dateadd(hh, -1, getdate()) and B1.Symbol = B2.Symbol)
go
go
go
from BACKUP_STOCK
group by Symbol
) as T1, (
from BACKUP_STOCK as B1
select UpdateTime
from BACKUP_STOCK as B2
2007-10-19 11
where datediff(day, UpdateTime, @date) = 0 and B1.Symbol = B2.Symbol
) as T2, (
from BACKUP_STOCK as B1
select UpdateTime
from BACKUP_STOCK as B2
) as T3
go
from LIMITEDORDER
group by Symbol
go
) as T1
go
from CUSTOMER
union all
2007-10-19 12
) select top 1 Root, count(*) as C from PARENT group by Root order by C desc;
go
group by C.UserID
) as T1, (
) as T2
go
6 Sample Data
-- data for USER values ('11', 'Ogre-customer', '567', '7/7/1922 12:00:00 AM',
'11111111', 'customer');
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('1', 'Admin1', '123', '1/1/1985 12:00:00 AM', '111', values ('12', 'Fake-Customer', '567', '8/8/1933 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('2', 'Yuku', '123', '1/1/1983 12:00:00 AM', '222', values ('13', 'BigBossCustomer', '567', '9/9/1944 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('3', 'MiMiKo Brokerwoman', '123', '12/12/1987 12:00:00 AM', values ('14', 'Tooth-paste-man', '567', '10/10/1955 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('4', 'tmmk', '123', '1/1/1986 12:00:00 AM', '444', values ('15', 'Morning Comer', '567', '11/11/1966 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('5', 'Admin2', '123', '1/1/1986 12:00:00 AM', '555', values ('16', 'Late Comer', '789', '12/12/1988 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('6', 'Hardi Brokerman', '123', '2/2/1987 12:00:00 AM', values ('17', 'Mr bean', '789', '1/1/1911 12:00:00 AM', '17171717',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('7', 'goodcustomer', '345', '3/3/1988 12:00:00 AM', '777', values ('18', 'Byron', '789', '2/2/1922 12:00:00 AM', '18181818',
'customer'); 'customer');
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('8', 'badcustomer', '345', '4/4/1990 12:00:00 AM', '888', values ('19', 'Choi', '789', '3/3/1933 12:00:00 AM', '19191919',
'customer'); 'broker');
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('9', 'middlecustomer', '345', '5/5/1991 12:00:00 AM', '999', values ('20', 'Wangjin', '789', '4/4/1944 12:00:00 AM', '20202020',
'customer'); 'admin');
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
values ('10', 'uglecustomer', '345', '6/6/1999 12:00:00 AM', '1010', values ('21', 'Angry Customer', '349', '5/5/1955 12:00:00 AM',
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into [USER] (UserID, Name, Password, Birthday, NIC, Type)
2007-10-19 13
values ('22', 'Happy Customer', '971', '5/5/1955 12:00:00 AM', ('10', '6', 9, 6);
'22222222', 'customer'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) ('11', '7', 9, NULL);
values ('23', 'Dented Customer', '531', '5/5/1955 12:00:00 AM', insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
values ('24', 'Metadata Customer', '346', '5/5/1955 12:00:00 AM', ('13', '9', 9, 3);
'24242424', 'customer'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) ('14', '10', 13, 19);
values ('25', 'Boring Customer', '266', '5/5/1955 12:00:00 AM', insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
values ('26', 'Smart Customer', '220', '5/5/1955 12:00:00 AM', ('16', '12', 7, 19);
'26262626', 'customer'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) ('17', '13', NULL, NULL);
values ('27', 'Bad Customer', '614', '5/5/1955 12:00:00 AM', insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
values ('28', 'Funny Customer', '516', '5/5/1955 12:00:00 AM', ('21', '15', NULL, 3);
'28282828', 'customer'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) ('22', '16', 16, 19);
values ('29', 'Partying Customer', '281', '5/5/1955 12:00:00 AM', insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
values ('30', 'Old Customer', '849', '5/5/1955 12:00:00 AM', ('24', '18', NULL, 3);
'30303030', 'customer'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into [USER] (UserID, Name, Password, Birthday, NIC, Type) ('25', '19', NULL, 6);
values ('31', 'Leftover Broker', '580', '1/1/1955 12:00:00 AM', insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into ADMIN (UserID, StaffNo) values ('1', '1'); ('28', '22', 27, 19);
insert into ADMIN (UserID, StaffNo) values ('5', '2'); insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values
insert into ADMIN (UserID, StaffNo) values ('20', '3'); ('29', '23', 27, 19);
insert into BROKER (UserID, LicenseNo) values ('3', '1'); -- data for USERADDRESS
insert into BROKER (UserID, LicenseNo) values ('19', '3'); insert into USERADDRESS (UserID, Address) values ('1', '9 Dover
insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values Pagar Rd');
('2', '1', NULL, 6); insert into USERADDRESS (UserID, Address) values ('1', '60 Simei
('4', '2', 2, 3); insert into USERADDRESS (UserID, Address) values ('2', '31 Aljunied
('7', '3', 4, 3); insert into USERADDRESS (UserID, Address) values ('3', '40 Kembangan
('8', '4', 7, 3); insert into USERADDRESS (UserID, Address) values ('3', '2 Outram
insert into CUSTOMER (UserID, CustNo, ReferrerID, BrokerID) values Park Dr');
('9', '5', NULL, NULL); insert into USERADDRESS (UserID, Address) values ('3', '45 Clementi
2007-10-19 14
insert into USERADDRESS (UserID, Address) values ('3', '62 Tanah insert into USERPHONE (UserID, Phone) values ('5', '82481826');
Merah Rd'); insert into USERPHONE (UserID, Phone) values ('5', '95415264');
insert into USERADDRESS (UserID, Address) values ('4', '75 Redhill insert into USERPHONE (UserID, Phone) values ('5', '94840387');
insert into USERADDRESS (UserID, Address) values ('4', '32 Tiong insert into USERPHONE (UserID, Phone) values ('6', '61905850');
Bahru St'); insert into USERPHONE (UserID, Phone) values ('7', '85866267');
insert into USERADDRESS (UserID, Address) values ('5', '92 Tiong insert into USERPHONE (UserID, Phone) values ('10', '85133456');
Bahru Dr'); insert into USERPHONE (UserID, Phone) values ('10', '95129611');
insert into USERADDRESS (UserID, Address) values ('5', '16 insert into USERPHONE (UserID, Phone) values ('11', '86988280');
Commonwealth Rd'); insert into USERPHONE (UserID, Phone) values ('16', '85532822');
insert into USERADDRESS (UserID, Address) values ('6', '35 Tanah insert into USERPHONE (UserID, Phone) values ('16', '98904903');
Merah St'); insert into USERPHONE (UserID, Phone) values ('18', '93282479');
insert into USERADDRESS (UserID, Address) values ('8', '67 Outram insert into USERPHONE (UserID, Phone) values ('18', '84689046');
Park Dr'); insert into USERPHONE (UserID, Phone) values ('21', '68161106');
insert into USERADDRESS (UserID, Address) values ('9', '83 Raffles insert into USERPHONE (UserID, Phone) values ('29', '95702840');
Place Dr'); insert into USERPHONE (UserID, Phone) values ('30', '83571702');
insert into USERADDRESS (UserID, Address) values ('10', '7 insert into USERPHONE (UserID, Phone) values ('30', '89673145');
Queenstown Rd'); insert into USERPHONE (UserID, Phone) values ('30', '65325723');
Queenstown Rd'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('13', '6 Paya ('1', 'Singapore, Pte. Ltd.', 'Singapore', '65-11111111');
Lebar St'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('16', '24 Eunos ('2', 'PT. Indonesia', 'Indonesia', '62-22222222');
insert into USERADDRESS (UserID, Address) values ('16', '28 Dover ('3', 'Myanmar Incorporated', 'Myanmar', '99-33333333');
insert into USERADDRESS (UserID, Address) values ('16', '41 Raffles ('4', 'Telkom', 'Jakarta', '62-44444444');
Place Rd'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('16', '96 Dover ('5', 'Indosat', 'Bandung', '62-55555555');
insert into USERADDRESS (UserID, Address) values ('20', '77 Tiong ('6', 'Unilever', 'Surabaya', '62-66666666');
Bahru Dr'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('20', '96 ('7', 'NTU', 'Singapore', '65-12345678');
Queenstown St'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('21', '68 Eunos ('8', 'NUS', 'Singapore', '65-09999009');
insert into USERADDRESS (UserID, Address) values ('22', '52 Simei ('9', 'Indofood', 'Indonesia', '62-99889988');
insert into USERADDRESS (UserID, Address) values ('23', '14 ('10', 'Grape City', 'Myanmar', '99-99999999');
Commonwealth St'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('28', '9 Dover ('11', 'MIT', 'USA', '1-234567890');
insert into USERADDRESS (UserID, Address) values ('29', '69 Jurong ('12', 'Singtel', 'Singapore', '65-65656565');
East St'); insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERADDRESS (UserID, Address) values ('29', '73 Kallang ('13', 'Starhub', 'Singapore', '65-12367877');
-- data for USERPHONE insert into CORPORATION (CorpRegNo, Name, Address, Phone) values
insert into USERPHONE (UserID, Phone) values ('3', '97167637'); -- data for ACTIVITY
insert into USERPHONE (UserID, Phone) values ('4', '68018554'); insert into ACTIVITY (ActivityID, Type, Description, Date, Venue,
insert into USERPHONE (UserID, Phone) values ('4', '89183964'); Fee, CorpRegNo) values ('1', 'promotion', 'Promotion', '11/10/2007
2007-10-19 15
12:00:00 AM', 'NTU', NULL, '1'); Price) values ('S102', '2', '547.52', '2007/10/29 12:52', '50',
Fee, CorpRegNo) values ('2', 'seminar', 'Seminar', '12/12/2006 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
12:00:00 AM', 'NTU', 200, '2'); Price) values ('S102', '2', '521.05', '2007/10/29 16:00', '50',
Fee, CorpRegNo) values ('3', 'promotion', 'Press Show', '10/9/2007 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
12:00:00 AM', 'NTU', NULL, '3'); Price) values ('S103', '3', '573.23', '2007/10/30 13:55', '25',
Fee, CorpRegNo) values ('4', 'promotion', 'Superstar Press Release', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
'12/3/2007 11:00:00 AM', 'SMU', NULL, '1'); Price) values ('S103', '3', '541.69', '2007/10/30 13:09', '25',
Fee, CorpRegNo) values ('5', 'seminar', 'Intermediate Lesson', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
'2/3/2007 1:00:00 PM', 'NUS', 55, '14'); Price) values ('S103', '3', '571.26', '2007/10/29 13:55', '25',
Fee, CorpRegNo) values ('6', 'promotion', 'Gamble Night', '3/4/2005 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
11:00:00 PM', 'SMU', NULL, '13'); Price) values ('S103', '3', '547.76', '2007/10/29 17:03', '25',
Fee, CorpRegNo) values ('7', 'promotion', 'Party', '5/6/2007 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
11:22:00 AM', 'NUS', NULL, '13'); Price) values ('S104', '4', '572.49', '2007/10/30 15:23', '500',
Fee, CorpRegNo) values ('8', 'seminar', 'Java Tutorial', '3/3/2007 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
1:00:00 PM', 'Suntec', 99, '10'); Price) values ('S104', '4', '586.11', '2007/10/30 14:37', '500',
Fee, CorpRegNo) values ('9', 'promotion', 'Big News', '4/4/2005 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
11:00:00 PM', 'Marinabay', NULL, '7'); Price) values ('S104', '4', '590.19', '2007/10/29 15:23', '500',
Fee, CorpRegNo) values ('10', 'promotion', 'Party', '6/6/2007 insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
11:22:00 AM', 'East Coast', NULL, '4'); Price) values ('S104', '4', '597.87', '2007/10/29 18:31', '500',
Fee, CorpRegNo) values ('11', 'seminar', 'Using Solaris 10', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
'4/3/2007 1:00:00 PM', 'Sentosa', 198, '3'); Price) values ('S105', '5', '610.86', '2007/10/30 11:23', '100',
Fee, CorpRegNo) values ('12', 'promotion', 'Dinner for Free', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
'5/4/2005 11:00:00 PM', 'Changi', NULL, '1'); Price) values ('S105', '5', '616.56', '2007/10/30 10:37', '100',
'2.59');
-- data for BACKUP_STOCK insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S101', '1', '521.55', '2007/10/30 10:07', '100', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S101', '1', '533.14', '2007/10/30 9:21', '100', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S101', '1', '528.75', '2007/10/29 10:07', '100', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S101', '1', '516.5', '2007/10/29 13:15', '100', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S102', '2', '552.48', '2007/10/30 12:52', '50', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
Price) values ('S102', '2', '558.02', '2007/10/30 12:06', '50', insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot,
2007-10-19 16
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '25', '2.3');
Price) values ('S107', '7', '634.22', '2007/10/30 14:05', '25', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.62'); Lot, Price) values ('S104', '3', '4', '2.4', '2007/10/30 16:07',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '500', '2.4');
Price) values ('S107', '7', '639.54', '2007/10/29 14:51', '25', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.65'); Lot, Price) values ('S105', '5', '5', '2.5', '2007/10/30 12:07',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '100', '2.5');
Price) values ('S107', '7', '646.85', '2007/10/29 17:59', '25', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.63'); Lot, Price) values ('S106', '9', '6', '2.6', '2007/10/30 12:35',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '50', '2.6');
Price) values ('S108', '8', '658.72', '2007/10/30 14:54', '500', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.79'); Lot, Price) values ('S107', '13', '7', '2.7', '2007/10/30 15:35',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '25', '2.7');
Price) values ('S108', '8', '650.98', '2007/10/30 14:08', '500', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.89'); Lot, Price) values ('S108', '9', '8', '2.8', '2007/10/30 15:38',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '500', '2.8');
Price) values ('S108', '8', '642.76', '2007/10/29 14:54', '500', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.86'); Lot, Price) values ('S109', '3', '9', '2.9', '2007/10/30 11:28',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '100', '2.9');
Price) values ('S108', '8', '645.24', '2007/10/29 18:02', '500', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.76'); Lot, Price) values ('S110', '11', '10', '3', '2007/10/30 13:09',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '50', '3');
Price) values ('S109', '9', '693.91', '2007/10/30 10:44', '100', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.86'); Lot, Price) values ('S111', '11', '11', '3.1', '2007/10/30 11:38',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '25', '3.1');
Price) values ('S109', '9', '691', '2007/10/30 9:58', '100', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.85'); Lot, Price) values ('S112', '11', '12', '3.2', '2007/10/30 9:36',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '500', '3.2');
Price) values ('S109', '9', '695.98', '2007/10/29 10:44', '100', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.97'); Lot, Price) values ('S113', '1', '13', '3.3', '2007/10/30 12:43',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '100', '3.3');
Price) values ('S109', '9', '695.48', '2007/10/29 13:52', '100', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.84'); Lot, Price) values ('S114', '13', '14', '3.4', '2007/10/30 12:11',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '50', '3.4');
Price) values ('S110', '10', '684.1', '2007/10/30 12:25', '50', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.95'); Lot, Price) values ('S115', '5', '15', '3.5', '2007/10/30 12:50',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '25', '3.5');
Price) values ('S110', '10', '705.55', '2007/10/30 11:39', '50', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'2.93'); Lot, Price) values ('S116', '9', '16', '3.6', '2007/10/30 12:58',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '500', '3.6');
Price) values ('S110', '10', '713.3', '2007/10/29 12:25', '50', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'3'); Lot, Price) values ('S117', '7', '17', '3.7', '2007/10/30 12:21',
insert into BACKUP_STOCK (Symbol, IndexNo, Value, UpdateTime, Lot, '100', '3.7');
Price) values ('S110', '10', '691.62', '2007/10/29 15:33', '50', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'3'); Lot, Price) values ('S118', '5', '18', '3.8', '2007/10/30 14:57',
'50', '3.8');
-- data for STOCK insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '25', '3.9');
Lot, Price) values ('S101', '1', '1', '2.1', '2007/10/30 10:51', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'100', '2.1'); Lot, Price) values ('S120', '1', '20', '4', '2007/10/30 11:15',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '500', '4');
Lot, Price) values ('S102', '1', '2', '2.2', '2007/10/30 13:36', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'50', '2.2'); Lot, Price) values ('S121', '11', '21', '4.1', '2007/10/30 11:39',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '100', '4.1');
Lot, Price) values ('S103', '1', '3', '2.3', '2007/10/30 14:39', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
2007-10-19 17
Lot, Price) values ('S122', '9', '22', '4.2', '2007/10/30 10:32', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'50', '4.2'); Lot, Price) values ('S141', '5', '41', '6.1', '2007/10/30 11:12',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '100', '6.1');
Lot, Price) values ('S123', '1', '23', '4.3', '2007/10/30 12:00', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'25', '4.3'); Lot, Price) values ('S142', '13', '42', '6.2', '2007/10/30 14:56',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '50', '6.2');
Lot, Price) values ('S124', '5', '24', '4.4', '2007/10/30 14:39', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'500', '4.4'); Lot, Price) values ('S143', '11', '43', '6.3', '2007/10/30 12:05',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '25', '6.3');
Lot, Price) values ('S125', '3', '25', '4.5', '2007/10/30 13:55', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'100', '4.5'); Lot, Price) values ('S144', '13', '44', '6.4', '2007/10/30 15:21',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '500', '6.4');
Lot, Price) values ('S126', '3', '26', '4.6', '2007/10/30 13:44', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'50', '4.6'); Lot, Price) values ('S145', '13', '45', '6.5', '2007/10/30 16:11',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '100', '6.5');
Lot, Price) values ('S127', '13', '27', '4.7', '2007/10/30 10:21', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'25', '4.7'); Lot, Price) values ('S146', '1', '46', '6.6', '2007/10/30 15:27',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '50', '6.6');
Lot, Price) values ('S128', '11', '28', '4.8', '2007/10/30 11:39', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'500', '4.8'); Lot, Price) values ('S147', '3', '47', '6.7', '2007/10/30 15:45',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '25', '6.7');
Lot, Price) values ('S129', '3', '29', '4.9', '2007/10/30 13:04', insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime,
'100', '4.9'); Lot, Price) values ('S148', '11', '48', '6.8', '2007/10/30 13:51',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '500', '6.8');
Lot, Price) values ('S130', '7', '30', '5', '2007/10/30 9:43', '50',
Lot, Price) values ('S131', '13', '31', '5.1', '2007/10/30 13:33', insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('1',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('2',
Lot, Price) values ('S132', '5', '32', '5.2', '2007/10/30 13:19', '4', '300');
'500', '5.2'); insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('3',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '7', '30010');
Lot, Price) values ('S133', '11', '33', '5.3', '2007/10/30 12:59', insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('4',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('5',
Lot, Price) values ('S134', '9', '34', '5.4', '2007/10/30 16:05', '9', '40000');
'50', '5.4'); insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('6',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '10', '500000');
Lot, Price) values ('S135', '11', '35', '5.5', '2007/10/30 14:28', insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('7',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('8',
Lot, Price) values ('S136', '7', '36', '5.6', '2007/10/30 15:39', '15', '30004');
'500', '5.6'); insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values ('9',
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, '16', '4919');
Lot, Price) values ('S137', '3', '37', '5.7', '2007/10/30 11:41', insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values
Lot, Price) values ('S138', '7', '38', '5.8', '2007/10/30 12:10', ('11', '26', '919');
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, ('12', '27', '100');
Lot, Price) values ('S139', '11', '39', '5.9', '2007/10/30 14:20', insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values
insert into STOCK (Symbol, CorpRegNo, IndexNo, Value, UpdateTime, insert into PORTFOLIO (PortfolioID, UserID, CashAmount) values
Lot, Price) values ('S140', '7', '40', '6', '2007/10/30 13:26', ('14', '29', '300');
2007-10-19 18
('15', '30', '10000'); insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
-- data for LIMITEDORDER TransactionQuantity) values ('14', '3', 'S103', '6', 'buy', '8',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('1', '1', 'S101', '7', 'buy', '10', TransactionQuantity) values ('15', '3', 'S104', '5', 'buy', '10',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('2', '1', 'S102', '6', 'buy', '200', TransactionQuantity) values ('16', '4', 'S105', '4', 'buy', '200',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('3', '1', 'S103', '5', 'buy', '30', TransactionQuantity) values ('17', '4', 'S106', '3', 'buy', '30',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('4', '2', 'S104', '4', 'buy', '1000', TransactionQuantity) values ('18', '4', 'S107', '2', 'buy', '1000',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('5', '2', 'S105', '3', 'buy', '40', TransactionQuantity) values ('19', '4', 'S108', '7', 'sell', '40',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('6', '2', 'S106', '2', 'buy', '500', TransactionQuantity) values ('20', '4', 'S109', '6', 'sell', '500',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('7', '2', 'S107', '7', 'buy', '8', TransactionQuantity) values ('21', '4', 'S110', '5', 'sell', '8',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('8', '2', 'S108', '6', 'buy', '10', TransactionQuantity) values ('22', '4', 'S111', '4', 'sell', '10',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('9', '3', 'S109', '5', 'buy', '200', TransactionQuantity) values ('23', '4', 'S101', '3', 'sell', '200',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('10', '3', 'S110', '4', 'buy', '30', TransactionQuantity) values ('24', '4', 'S102', '2', 'sell', '30',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('11', '3', 'S111', '3', 'buy', '1000', TransactionQuantity) values ('25', '5', 'S103', '7', 'sell', '1000',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('12', '3', 'S101', '2', 'buy', '40', TransactionQuantity) values ('26', '5', 'S104', '6', 'sell', '40',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol,
Price, Type, Quantity, TransactionTime, TransactionPrice, Price, Type, Quantity, TransactionTime, TransactionPrice,
TransactionQuantity) values ('13', '3', 'S102', '7', 'buy', '500', TransactionQuantity) values ('27', '5', 'S105', '5', 'sell', '500',
2007-10-19 19
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S135',
TransactionQuantity) values ('28', '5', 'S106', '4', 'sell', '8', insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S136',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S137',
TransactionQuantity) values ('29', '5', 'S107', '3', 'sell', '10', insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S143',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('3', 'S124',
TransactionQuantity) values ('30', '5', 'S108', '2', 'sell', '200', insert into OWN (PortfolioID, Symbol, Quantity) values ('3', 'S125',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('3', 'S126',
TransactionQuantity) values ('31', '5', 'S109', '7', 'sell', '30', insert into OWN (PortfolioID, Symbol, Quantity) values ('3', 'S127',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('4', 'S122',
TransactionQuantity) values ('32', '5', 'S110', '6', 'sell', '1000', insert into OWN (PortfolioID, Symbol, Quantity) values ('4', 'S123',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('4', 'S126',
TransactionQuantity) values ('33', '5', 'S111', '5', 'sell', '40', insert into OWN (PortfolioID, Symbol, Quantity) values ('4', 'S136',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('4', 'S143',
TransactionQuantity) values ('34', '5', 'S101', '4', 'sell', '500', insert into OWN (PortfolioID, Symbol, Quantity) values ('5', 'S123',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('5', 'S124',
TransactionQuantity) values ('35', '5', 'S102', '3', 'sell', '8', insert into OWN (PortfolioID, Symbol, Quantity) values ('5', 'S125',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('5', 'S126',
TransactionQuantity) values ('36', '6', 'S103', '2', 'sell', '10', insert into OWN (PortfolioID, Symbol, Quantity) values ('5', 'S127',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('6', 'S124',
TransactionQuantity) values ('37', '6', 'S104', '7', 'sell', '200', insert into OWN (PortfolioID, Symbol, Quantity) values ('6', 'S125',
insert into LIMITEDORDER (LimitedOrderID, PortfolioID, Symbol, insert into OWN (PortfolioID, Symbol, Quantity) values ('6', 'S126',
TransactionQuantity) values ('38', '6', 'S105', '6', 'sell', '30', insert into OWN (PortfolioID, Symbol, Quantity) values ('6', 'S127',
insert into OWN (PortfolioID, Symbol, Quantity) values ('1', 'S138', insert into OWN (PortfolioID, Symbol, Quantity) values ('7', 'S122',
'3212'); '300');
insert into OWN (PortfolioID, Symbol, Quantity) values ('1', 'S139', insert into OWN (PortfolioID, Symbol, Quantity) values ('7', 'S123',
'140'); '2604');
insert into OWN (PortfolioID, Symbol, Quantity) values ('1', 'S140', insert into OWN (PortfolioID, Symbol, Quantity) values ('7', 'S129',
'44'); '1164');
insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S133', insert into OWN (PortfolioID, Symbol, Quantity) values ('7', 'S136',
'524'); '3540');
insert into OWN (PortfolioID, Symbol, Quantity) values ('2', 'S134', insert into OWN (PortfolioID, Symbol, Quantity) values ('8', 'S114',
'3540'); '1812');
2007-10-19 20
insert into OWN (PortfolioID, Symbol, Quantity) values ('8', 'S115', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('8', 'S116', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('8', 'S128', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('9', 'S112', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('9', 'S113', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('9', 'S121', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('9', 'S132', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('10', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('10', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('10', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('10', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('10', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('11', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('11', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('11', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('12', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('12', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('12', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('12', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('13', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('13', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('13', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('13', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('14', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('14', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('14', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('14', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', insert into OWN (PortfolioID, Symbol, Quantity) values ('15',
2007-10-19 21
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', -- data for PARTICIPATE
'S130', '980'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('1', '2',
'S131', '140'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('1', '4',
'S132', '980'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('2', '4',
'S133', '404'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('2', '6',
'S134', '4620'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('2',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '20', '0');
'S135', '1812'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('3',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '30', '1');
'S136', '660'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('3',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '10', '1');
'S137', '660'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('3',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '22', '0');
'S138', '2900'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('4',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '22', '1');
'S139', '140'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('4', '2',
'S140', '3540'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('4', '1',
'S141', '2604'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('5', '6',
'S142', '44'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('6', '7',
'S143', '3884'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('6', '8',
'S144', '812'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('7', '9',
'S145', '3212'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('7',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '10', '0');
'S146', '524'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('7',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '11', '1');
'S147', '3540'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('7',
insert into OWN (PortfolioID, Symbol, Quantity) values ('15', '17', '1');
'S148', '812'); insert into PARTICIPATE (ActivityID, UserID, Paid) values ('7',
'18', '1');
2007-10-19 22