Create Data base tables based on the following data and defi
Create Data base tables based on the following data, and define the relationships.
Customer (CID, FIRSTNAME, LASTNAME) Product (PID, UPC, NAME, PRICE) Transaction (CID, TID, TTYPE, TINFO) Invoice (TID, PID, UPC)Solution
create table customer
 (
 cid number(10),
 firstname varchar2(15),
 lastname varchar2(10)
 );
create table product
 (
 pid number(10),
 upc varchar2(10),
 name varchar2(10),
 price number(10)
 );
create table transaction
 (
 cid number(10),
 tid number(10),
 ttype varchar2(10),
 tinfo varchar2(10)
 );
create table invoice
 (
 tid number(10),
 pid number(10),
 upc varchar2(10)
 );
explaning the relationships between the tables:
relationship 1:
=>there is a relation between customer and Transaction by using the coloumn CID
 so here user can get data from transaction table or the specified customer using customer.CID =transaction.CID
relationship2:
=>there is a relation ship between product table and invoice table using coloumn PID
 =>so here the product table contains alll product data but if you want in voice of the product table then
 you can get in from invoice table using product.pid=invoice.pid
relationship 3:
 =>transaction table has relation ship with two tables customer,invoice table
 =>if transaction is done it is noted in transaction table if a user want invoice for these specific transaction
 then he will use trsaction.TID =invoice.tid
 =>if user want customer data for specific transaction then he can use the relation transaction.tid = customer.cid
relation ship 4:
 =>invoice table has both relationship with transaction table and products table using columns tid,pid and upc also

