You are on page 1of 1

Training Project Descriptions

1) a) Create table CONTRACT which has 4 columns : CO_ID(number), CO_CODE(string32), CRDATE(date), CRUSER(string32) . CO_ID is primary key. b) Create table SERVICE which has 2 columns : SRV_CODE(int), SRV_NAME(string64) SRV_CODE S primary key. c) Create table CONTRACT_SERVCE which has 2 columns: CO_ID(number) SRV_CODE(int) CO_ID and SRV_CODE are primary key.

1) Write the create table script. 2) Write the comment script. 3) Write the field comment script. 4) CO_ID is foreign key on CONTRACT table, and SRV_CODE is foreign key on SERVICE table. Write foreign key script. 5) Create an unique index on CONTRACT.CO_CODE. 6) Create an index on SERVICE.SRV_NAME. 7) Add constraint to table SERVICE that provides the SRV_NAME is not null. 8) Add sequence for CO_ID and SRV_CODE attribute. 9) Create the public synonym for all table , sequence for CO_ID and sequence for SRV_CODE. 10) Give the INSERT, DELETE and UPDATE authority to the modify role. 11) Give the SELECT authority to the read role

Notes: 1) All primary/foreign keys shall be created explicitly. (not in CREATE TABLE statement.) 2) Unique index shall have UI_<table_name>__<column_name>. 3) Normal index shall have I_<table_name>__<column_name>. 4) Primary key shall have pk_<table_name>. 5) Foreign key shall have fk_<table_name>. 6) Check constraint shall have ck_<table_name>_<field_name>.

You might also like