Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DATABASE Please answer all the questions given(1,2,3,4) CUSTOMER CUST_NUM CUST_LNAME CUST_FNAME CUST_BALANCE 1000 Billy Jean 1050.11 1001 Amanda John 840.92 INVOICE INV_NUM 8000 CUST_NUM INV_DATE

image text in transcribed

DATABASE

Please answer all the questions given(1,2,3,4)

CUSTOMER CUST_NUM CUST_LNAME CUST_FNAME CUST_BALANCE 1000 Billy Jean 1050.11 1001 Amanda John 840.92 INVOICE INV_NUM 8000 CUST_NUM INV_DATE 23/3/2020 INV_AMOUNT 235.89 1000 8001 1001 23/3/2020 312.82 8002 1002 30/3/2020 528.10 8003 1003 12/4/2020 194.78 8004 1004 23/4/2020 619.44 1. Create both the CUSTOMER and INVOICE tables structure above. Details of both tables are: a) The customer number should store integer values. The name attributes should support variable length character data up to 30 characters each. The customer balance should support up to six digits on the left of the decimal place and two digits to the right of the decimal place. (5 Marks) b) The invoice number should store integer values. The invoice date should store date values. The invoice amount should support up to 8 digits to the left of the decimal place and two digits to the right of the decimal place. (5 Marks) 2. Write the SQL commands necessary to insert the data into the CUSTOMER table and the INVOICE table created in (1). (5 Marks) 3. Modify the CUSTOMER table: a) to include the customer's date of birth (CUST_DOB), which should store date data. (2 Marks) b) to indicate the date of birth on March 15, 1989 for customer 1000. (2 Marks) c) to indicate the date of birth on December 22, 1988 for customer 1001. (2 Marks) 4. Write a query to count the number of invoices. (2 Marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Is advertising a simple or a complex endeavor? Why?

Answered: 1 week ago

Question

What are the advantages of arbitration?

Answered: 1 week ago