Create the CUSTOMER table structure illustrated in Figure P8.16. The customer number should store integer values. The CUST_FNAME and CUST_LNAME attributes should support variable length character data up to 30 characters each. CUST_BALANCE should support up to eight digits on the left of the decimal place and two digits to the right of the decimal place. Use CUST_NUM as the primary key. Problem 17 Create the INVOICE table structure illustrated in Figure P8.16. INV_NUM should store integer values. INV_DATE should store date values. INV_AMOUNT should support up to eight digits to the left of the decimal place and two digits to the right of the decimal place. Use INV_NUM as the primary key. Note that the CUST_NUM is the foreign key to CUSTOMER, so be certain to enforce referential integrity.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
roblem 16
Create the CUSTOMER table structure illustrated in Figure P8.16. The customer number should store integer values. The CUST_FNAME and CUST_LNAME attributes should support variable length character data up to 30 characters each. CUST_BALANCE should support up to eight digits on the left of the decimal place and two digits to the right of the decimal place. Use CUST_NUM as the primary key.
Problem 17
Create the INVOICE table structure illustrated in Figure P8.16. INV_NUM should store integer values. INV_DATE should store date values. INV_AMOUNT should support up to eight digits to the left of the decimal place and two digits to the right of the decimal place. Use INV_NUM as the primary key. Note that the CUST_NUM is the foreign key to CUSTOMER, so be certain to enforce referential integrity.
Problem 18
Write the set of SQL commands necessary to insert the data into the CUSTOMER table you created in Problem 16, as illustrated in Figure P8.16.
Problem 19
Write the set of SQL commands necessary to insert the data into the INVOICE table you created in Problem 17, as illustrated in Figure P8.16.
Use YYYY-MM-DD format when inserting dates.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps