Question: CREATE TABLE prodhierarchy ( level1 varchar(80), level2 varchar(80), level3 varchar(80) not null primary key); CREATE TABLE pceprod ( prod varchar(80) not null, year int not

CREATE TABLE prodhierarchy ( level1 varchar(80), level2 varchar(80), level3 varchar(80) not null primary key); CREATE TABLE pceprod ( prod varchar(80) not null, year int not null, quarter int not null, pce int, primary key(prod,year,quarter), foreign key(prod) references prodhierarchy ); CREATE TABLE pcefunc ( func varchar(80) not null, year int not null, quarter int not null, pce int, primary key(func,year,quarter) ); 

write exactly one SQL query to answer

What is the function, year, and PCE with the most annual PCE ? The result should have the columns: func, year, annualpce.

CREATE TABLE prodhierarchy ( level1 varchar(80), level2 varchar(80), level3 varchar(80) not null

sample data

20! 2010 3394 350619 Clothing footw Clothing footwear Clothing footwear Clothing footwear Clothing footwear Clothing footwear Communication Communication Communication Communication Communication Communication Education Education Education Education Education Education Financial services a Financial services a Financial services Financial services a Financial services a Financial services a Food and beverage Food and beverage Food and beverage Food and beverage Food and beverage 2010 352367 339544 4342627 236389 234415 235756 233741 233755 4 232854 228588 240759 231422 244559 234792 236732 816479 824943 813314 829936 809265 4 816332 773838 797365 2010 2010 2010 2010 2010 2010 2010 2774152 794638 2010 3777001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!