Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Simple online shopping Database application Requirements 1. Create the appropria

ID: 3572282 • Letter: S

Question

Simple online shopping Database application

Requirements

1. Create the appropriate tables in your database for the following

i.Products

ii.Buyer payment methods (buyers may have more than one payment methods, e.g. two credit cards).

iii.Buyer Purchase products.

2. Add 50 buyers to your database

i.Add at least 1 credit card for each buyer.

ii. At least 10 buyers should have at least 2 payment methods.

3. Add data to your database to include information on purchases.

i.You must keep track of EVERY product from every store.

ii.You must keep track of when a purchase was made.

iii.You must keep track of who bought which product and how many

iv.Remember since product can be sold by multiple stores (e.g. ipad can be sold by store1or store2 etc.), there may be multiple users that buy these products

v. Add at least 200 entries into your table for tracking purchases.

vi.There should be at least one entry for every buyer (likely more than one entry per buyer)

Here is the tables for the database. Are these correct before I insert the information into the tables.

create table Buyers (bID integer, First Name varchar(20), Last Name varchar(20), address varchar(20), email varchar(20), credit card varchar(20));


create table Productlistings ( pID integer, products varchar(20), price integer);


create table Products(pID integer, quantity integer, vendor varchar(20));


create table Payment_Method(pay_id integer, bID integer, credit card varchar(20));


create table Purchase (pur_id integer, bID integer, pID integer, quantity integer, purchase_date date, total integer));

Also I am not understanding the payment method when it says add at least 1 credit card for one buyer, and at least 10 buyers should have atleast 2 payment methods.

Explanation / Answer

Buyer's table will not have payment method details as a buyer can have multiple payment methods.

create table Buyers (bID integer, First Name varchar(20), Last Name varchar(20), address varchar(20), email varchar(20));

To get payment methods of a buyer, we need to fetch records from payment_method entity.

SELECT * FROM Payment_Method WHERE bID = ?

1. Add at least 1 credit card for one buyer

This means for each buyer we need to create a record in Payment_Method table

2. At least 10 buyers should have atleast 2 payment methods

This means for a single buyer add 2(or more) records in Payment_Method.(Do this for 10 buyers)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote