100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
INF assignment 3 solutions $4.98   Add to cart

Other

INF assignment 3 solutions

 165 views  6 purchases
  • Course
  • Institution
  • Book

Contains precise solutions for the 3rd assignment

Preview 2 out of 8  pages

  • July 4, 2023
  • 8
  • 2022/2023
  • Other
  • Unknown
avatar-seller
INF3707 2023 ASSIGNMENT 3
SOLUTIONS

Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187

, Question 1 Chapter 6
1.1 Create a sequence that generates integers starting with the value
5. Each value should be three less than the previous value generated.
The lowest value should be 0, and the sequence should not be allowed
to cycle. Name the sequence MY_FIRST_SEQ.
CREATE SEQUENCE MY_FIRST_SEQ
INCREMENT BY -3
START WITH 5
MAXVALUE 5
MINVALUE 0
NOCYCLE;

1.2 Issue a SELECT statement that displays NEXTVAL for
MY_FIRST_SEQ three times. Since the value is not being stored in the
table, use dual table in the FROM clause of the SELECT statement. What
caused the error on the third SELECT?
SELECT MY_FIRST_SEQ.NEXTVAL
FROM DUAL;
you would encounter an error similar to "ORA-08002: sequence MY_FIRST_SEQ.NEXTVAL
exceeds MAXVALUE and cannot be instantiated." This error occurs because the sequence has
reached its maximum value and cannot generate a new value.

1.3 Evaluate the SQL commands


Generally the error is being caused when working with SYSDATE, the table is checking the
expiry_date with SYSDATE. So each time when the system date change it will not be validated.
create table ord_items
(ord_no NUMBER(4) DEFAULT ord_seq.ord_seq.NEXTVAL NOT NULL,
Item_no NUMBER(3),
qty NUMBER(3) CHECK (qty BETWEEN 100 AND 200),
todays_date date DEFAULT SYSDATE,
expiry_date date ,
CONSTRAINT its_pky PRIMARY KEY (ord_no,Item_no),
CONSTRAINT ord_fky FOREIGN KEY (ord_no) references orders(order#),
CONSTRAINT check_expiry CHECK(expiry_date> todays_date));

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller CrystalIndigo. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.98. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72349 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$4.98  6x  sold
  • (0)
  Add to cart