Question: create table candidate ( cand_id varchar(12) primary key, -- cand_id name varchar(40) -- cand_nm ); create table contributor ( contbr_id integer primary key, name varchar(40),

create table candidate ( cand_id varchar(12) primary key, -- cand_id name varchar(40) -- cand_nm );

create table contributor ( contbr_id integer primary key, name varchar(40), -- contbr_nm city varchar(40), -- contbr_city state varchar(40), -- contbr_st zip varchar(20), -- contbr_zip employer varchar(60), -- contbr_employer occupation varchar(40) -- contbr_occupation );

create table contribution ( contb_id integer primary key, cand_id varchar(12), -- cand_id contbr_id varchar(12), -- contbr_id amount numeric(6,2), -- contb_receipt_amt date varchar(20), -- contb_receipt_dt election_type varchar(20), -- election_tp tran_id varchar(20), -- tran_id foreign key (cand_id) references candidate, foreign key (contbr_id) references contributor );

-- Extra Credit question! -- Did any contributors contribute to more than one candidate? -- Show the contributor ID, and the number of candidates to which the -- contributor made contributions, for all contributors who -- contributed to multiple candidates. Give output by number of -- candidates contributed to, in decreasing order. Limit your output -- to 20 rows.

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!