Change the setting of MYFIRSTSEQ so that the minimum value t

Change the setting of MY_FIRST_SEQ so that the minimum value that can be generated is -1000. A new table has been requested to support tracking automated emails sent to customers. Create the table and add data as described below. Tablename: email_log Columns.\" emailid (numeric), emaildate (datetime), customer# (numeric) Primary key: emailid column, define as an Identity Column Add the following data rows and display resulting rows (if any errors occur, explain why the error is expected) Emaildate = current date, customer# = 1007 Emailid = specify to use the column default value, emaildate = current date, customer# = 1008 Emailid = 25, emaildate = current date, customer# = 1009 Create a private synonym that enables you to reference the MY_FIRST_SEQ object as NUMGEN. Use a SELECT statement to view the CURRVAL of NUMGEN. Delete the NUMGEN synonym and MY_FIRST_SEEQ. Create a bitmap index on the CUSTOMERS table to speed up queries customers based on their state of residence. Verify that the index exist the index.

Solution

5.Alter sequence MY_FIRST_SEQ minvalue -1000;

6.

TABLE CREATION:

create table email_log ( emailid numeric(10), emaildate date, customer# numeric(10), constraint emailog_pk primary key (emailid) )

1.emaildate = current date and customer# = 1007

This will fail as there is no value for emailid column and being the primary key you must assign a value for the field.

Below is the error that will pop up:

ORA-00947: not enough values

2. This one will also fail as we have not specified any default value to emailid column. If you want to use a default value for any column you must declare it at the time of table creation. According to the question we have created the table and there is no mention of creating default values for emailid column.

3. This one will work fine. Below is the insert SQL.

insert into email_log (emailid,emaildate,customer#) values (25,current_date,1009);

7.CREATE SYNONYM NUMGEN FOR MY_FIRST_SEQ;

8. View the synonym:

select numgen.currval from dual; (Please note you have to call nextval at least once before you call currval.)

Delete NUMGEN:

Drop synonym numgen;

Delete MY_FIRST_SEQ:

Drop sequence MY_FIRST_SEQ;

9.Create index:

CREATE BITMAP INDEX
cust_bitmap_idx
ON customer (state);

View index:

select * from all_indexes where table_name = \'CUSTOMER\';

Delete Index:

drop index cust_bitmap_idx;

 Change the setting of MY_FIRST_SEQ so that the minimum value that can be generated is -1000. A new table has been requested to support tracking automated email
 Change the setting of MY_FIRST_SEQ so that the minimum value that can be generated is -1000. A new table has been requested to support tracking automated email

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site