Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

13. Identify the refusal of the return in Dances with Wolves.

Answered: 1 week ago