This document serves as a guideline for Assignment Two (Database Practice (ICT3722)) and provides
detailed explanations.
Please note that by providing this disclosure, I, acknowledge that I am not liable for any marks
awarded to you or any copyright claims resulting from the use of this guideline.
Disclaimer:
While every effort has been made to ensure the accuracy and reliability of the information provided
in this guideline. It is your responsibility to critically evaluate and adapt the information to meet the
specific requirements of your assignment
1.1 Write a statement that creates the table above. Add invoice_due_date and payment_date
columns
(19.5 marks)
CREATE TABLE invoices (
invoice_id NUMBER PRIMARY KEY,
vendor_id NUMBER,
invoice_number VARCHAR2(50),
invoice_date DATE,
invoice_total NUMBER,
payment_total NUMBER,
credit_total NUMBER,
terms_id NUMBER,
invoice_due_date DATE,
payment_date DATE
);
1.2 Write a statement that creates the vendors table. Add 4 more rows to this table in addition
to the primary key. (6marks)
CREATE TABLE vendors (
vendor_id NUMBER PRIMARY KEY,
vendor_name VARCHAR2(50),
vendor_address VARCHAR2(100),
vendor_city VARCHAR2(50),
vendor_state VARCHAR2(50)
);
1.3 Insert the 15 rows as indicated on the invoices table. (15 marks)
INSERT INTO invoices (invoice_id, vendor_id, invoice_number, invoice_date, invoice_total,
payment_total, credit_total, terms_id, invoice_due_date, payment_date)
VALUES
(1, 34, 'OP58872', TO_DATE('25-FEB-14', 'DD-MON-YY'), 116.54, 116.54, 0, 4,
TO_DATE('2022-02-01',
'YYYY-MM-DD'), NULL),
(2, 34, '0545443', TO_DATE('14-MAR-14', 'DD-MON-YY'), 1083.58, 1083.58, 0, 4,
TO_DATE('2022-03-
detailed explanations.
Please note that by providing this disclosure, I, acknowledge that I am not liable for any marks
awarded to you or any copyright claims resulting from the use of this guideline.
Disclaimer:
While every effort has been made to ensure the accuracy and reliability of the information provided
in this guideline. It is your responsibility to critically evaluate and adapt the information to meet the
specific requirements of your assignment
1.1 Write a statement that creates the table above. Add invoice_due_date and payment_date
columns
(19.5 marks)
CREATE TABLE invoices (
invoice_id NUMBER PRIMARY KEY,
vendor_id NUMBER,
invoice_number VARCHAR2(50),
invoice_date DATE,
invoice_total NUMBER,
payment_total NUMBER,
credit_total NUMBER,
terms_id NUMBER,
invoice_due_date DATE,
payment_date DATE
);
1.2 Write a statement that creates the vendors table. Add 4 more rows to this table in addition
to the primary key. (6marks)
CREATE TABLE vendors (
vendor_id NUMBER PRIMARY KEY,
vendor_name VARCHAR2(50),
vendor_address VARCHAR2(100),
vendor_city VARCHAR2(50),
vendor_state VARCHAR2(50)
);
1.3 Insert the 15 rows as indicated on the invoices table. (15 marks)
INSERT INTO invoices (invoice_id, vendor_id, invoice_number, invoice_date, invoice_total,
payment_total, credit_total, terms_id, invoice_due_date, payment_date)
VALUES
(1, 34, 'OP58872', TO_DATE('25-FEB-14', 'DD-MON-YY'), 116.54, 116.54, 0, 4,
TO_DATE('2022-02-01',
'YYYY-MM-DD'), NULL),
(2, 34, '0545443', TO_DATE('14-MAR-14', 'DD-MON-YY'), 1083.58, 1083.58, 0, 4,
TO_DATE('2022-03-