### Database Schema:
CREATE TABLE customers (
	CustomerID	INTEGER	NULL	PRIMARY KEY,
	First	TEXT	NULL,
	Last	TEXT	NULL,
	StreetAddress	TEXT	NULL,
	City	TEXT	NULL,
	State	TEXT	NULL,
	ZipCode	INTEGER	NULL,
	Email	TEXT	NULL,
	PhoneNumber	TEXT	NULL,
	FirstPurchaseDate	DATE	NULL,
	SubscribedToEmailList	TEXT	NULL,
	Gender	TEXT	NULL
);

CREATE TABLE location (
	LocationID	INTEGER	NULL	PRIMARY KEY,
	LocationName	TEXT	NULL,
	StreetAddress	TEXT	NULL,
	City	TEXT	NULL,
	State	TEXT	NULL,
	ZipCode	INTEGER	NULL,
	foreign key (LocationID) references geolocation (LocationID)
);

CREATE TABLE geolocation (
	LocationID	INTEGER	NULL	PRIMARY KEY,
	Latitude	REAL	NULL,
	Longitude	REAL	NULL,
	foreign key (LocationID) references location (LocationID)
);

CREATE TABLE rootbeerbrand (
	BrandID	INTEGER	NULL	PRIMARY KEY,
	BrandName	TEXT	NULL,
	FirstBrewedYear	INTEGER	NULL,
	BreweryName	TEXT	NULL,
	City	TEXT	NULL,
	State	TEXT	NULL,
	Country	TEXT	NULL,
	Description	TEXT	NULL,
	CaneSugar	TEXT	NULL,
	CornSyrup	TEXT	NULL,
	Honey	TEXT	NULL,
	ArtificialSweetener	TEXT	NULL,
	Caffeinated	TEXT	NULL,
	Alcoholic	TEXT	NULL,
	AvailableInCans	TEXT	NULL,
	AvailableInBottles	TEXT	NULL,
	AvailableInKegs	TEXT	NULL,
	Website	TEXT	NULL,
	FacebookPage	TEXT	NULL,
	Twitter	TEXT	NULL,
	WholesaleCost	REAL	NULL,
	CurrentRetailPrice	REAL	NULL
);

CREATE TABLE transaction (
	TransactionID	INTEGER	NULL	PRIMARY KEY,
	CreditCardNumber	INTEGER	NULL,
	CustomerID	INTEGER	NULL,
	TransactionDate	DATE	NULL,
	CreditCardType	TEXT	NULL,
	LocationID	INTEGER	NULL,
	RootBeerID	INTEGER	NULL,
	PurchasePrice	REAL	NULL,
	foreign key (LocationID) references location (LocationID),
	foreign key (CustomerID) references customers (CustomerID),
	foreign key (RootBeerID) references rootbeer (RootBeerID)
);

CREATE TABLE rootbeerreview (
	CustomerID	INTEGER	NULL	PRIMARY KEY,
	BrandID	INTEGER	NULL	PRIMARY KEY,
	StarRating	INTEGER	NULL,
	ReviewDate	DATE	NULL,
	Review	TEXT	NULL,
	foreign key (BrandID) references rootbeerbrand (BrandID),
	foreign key (CustomerID) references customers (CustomerID)
);

CREATE TABLE rootbeer (
	RootBeerID	INTEGER	NULL	PRIMARY KEY,
	BrandID	INTEGER	NULL,
	ContainerType	TEXT	NULL,
	LocationID	INTEGER	NULL,
	PurchaseDate	DATE	NULL,
	foreign key (LocationID) references geolocation (LocationID),
	foreign key (BrandID) references rootbeerbrand (BrandID),
	foreign key (LocationID) references location (LocationID)
);

### User's Query:
What is the average unit profit for wholesalers of canned beers?

### Extra Knowledge:
average unit profit = DIVIDE(SUM(SUBTRACT(CurrentRetailPrice, WholesaleCost)), COUNT(ContainerType = 'Can')); canned beers refers to ContainerType = 'Can';
SELECT AVG(T2.CurrentRetailPrice - T2.WholesaleCost) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.ContainerType = 'Can'