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 );
---------------------------------------------------------------------------- -- Part 4 - write the three new tables to a single SQL file. ----------------------------------------------------------------------------
-- 16. set the SQLite output to be a file named 'campaign-normal.sql'
.output 'campaign-normal.sql'
-- 17. output the candidate schema, and then all candidate rows as SQL -- insert statements. -- Hint: the SQLite .mode command allows you to select that you want -- rows of a query to be output as SQL insert statements, and the -- table name to be specified.
-- 18. output the candidate schema, and then all contributor rows as SQL -- insert statements.
-- 19. output the contribution schema, and then all contribution rows as SQL -- insert statements.
-- 20. set the SQL output so that it no longer goes to a file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
