Can you write SQL code to create this table? Customer CustNo (pk) FirstName Last
ID: 3907411 • Letter: C
Question
Can you write SQL code to create this table?
Customer
CustNo (pk)
FirstName
LastName
Address
City
State
Zip
Phone
1
Beth
Taylor
2396 Rafter Rd
Seattle
WA
98103
(206) 221-9021
2
Betty
Wise
4334 153rd NW
Seattle
WA
98178
(206) 445-6982
3
Bob
Mann
1190 Lorraine Cir.
Monroe
WA
98013
(206) 326-1234
4
Candy
Kendall
456 Pine St.
Seattle
WA
98105
(206) 523-1112
5
Harry
Sanders
1280 S. Hill Rd.
Fife
WA
98523
(360) 444-0092
6
Helen
Sibley
206 McCaffrey
Renton
WA
98006
(206) 624-0362
7
Homer
Wells
123 Main St.
Seattle
WA
98105
(206) 524-1461
8
Jerry
Wyatt
16212 123rd Ct.
Seattle
WA
98266
(206) 524-8145
9
Jim
Glussman
1432 E. Revenna
Seattle
WA
98266
(206) 445-2139
10
Larry
Styles
9825 S. Crest Lane
Bellevue
WA
98104
(425) 745-9980
11
Mike
Boren
642 Crest Ave.
Fife
WA
98523
(360) 444-5678
12
Ron
Thompson
789 122nd St.
Renton
WA
98666
(360) 747-2222
13
Sharon
Johnson
1223 Meyer Way
Fife
WA
98222
(360) 333-6666
14
Sheri
Gordon
336 Hill St.
Seattle
WA
98103
(206) 525-3344
15
Todd
Hayes
1400 NW 88th
Lynnwood
WA
98036
(206) 775-7689
16
Wally
Jones
411 Webber Ave.
Seattle
WA
98105
(206) 523-9957
Customer
CustNo (pk)
FirstName
LastName
Address
City
State
Zip
Phone
1
Beth
Taylor
2396 Rafter Rd
Seattle
WA
98103
(206) 221-9021
2
Betty
Wise
4334 153rd NW
Seattle
WA
98178
(206) 445-6982
3
Bob
Mann
1190 Lorraine Cir.
Monroe
WA
98013
(206) 326-1234
4
Candy
Kendall
456 Pine St.
Seattle
WA
98105
(206) 523-1112
5
Harry
Sanders
1280 S. Hill Rd.
Fife
WA
98523
(360) 444-0092
6
Helen
Sibley
206 McCaffrey
Renton
WA
98006
(206) 624-0362
7
Homer
Wells
123 Main St.
Seattle
WA
98105
(206) 524-1461
8
Jerry
Wyatt
16212 123rd Ct.
Seattle
WA
98266
(206) 524-8145
9
Jim
Glussman
1432 E. Revenna
Seattle
WA
98266
(206) 445-2139
10
Larry
Styles
9825 S. Crest Lane
Bellevue
WA
98104
(425) 745-9980
11
Mike
Boren
642 Crest Ave.
Fife
WA
98523
(360) 444-5678
12
Ron
Thompson
789 122nd St.
Renton
WA
98666
(360) 747-2222
13
Sharon
Johnson
1223 Meyer Way
Fife
WA
98222
(360) 333-6666
14
Sheri
Gordon
336 Hill St.
Seattle
WA
98103
(206) 525-3344
15
Todd
Hayes
1400 NW 88th
Lynnwood
WA
98036
(206) 775-7689
16
Wally
Jones
411 Webber Ave.
Seattle
WA
98105
(206) 523-9957
Explanation / Answer
Answer is as follows :
/* Create a table called Customer */
CREATE TABLE Customer(CustNo integer PRIMARY KEY, FirstName text, LastName text, Address text, City text, State text, Zip integer, Phone varchar(15));
/* Create few records in this table */
INSERT INTO Customer VALUES(1 , 'Beth ' , 'Taylor', '2396 Rafter Rd','Seattle','WA',98103,'(206) 221-9021');
INSERT INTO Customer VALUES(2 , 'Betty' , 'Wise ', '4334 153rd NW ','Seattle','WA',98178,'(206) 445-6982');
INSERT INTO Customer VALUES(3 ,'Bob ', 'Mann' , '1190 Lorraine Cir.','Monroe', 'WA' , '98013', '(206) 326-1234');
INSERT INTO Customer VALUES(4 ,'Candy', 'Kendall','456 Pine St.',' Seattle','WA', 98105 ,'(206) 523-1112');
INSERT INTO Customer VALUES(5 ,'Harry', 'Sanders', '1280 S. Hill Rd.',' Fife','WA', 98523, '(360) 444-0092');
INSERT INTO Customer VALUES(6 ,'Helen','Sibley','206 McCaffrey','Renton','WA',98006,'(206) 624-0362');
INSERT INTO Customer VALUES(7 ,'Homer','Wells','123 Main St.','Seattle','WA',98105,'(206) 524-1461');
INSERT INTO Customer VALUES(8 ,'Jerry','Wyatt','16212 123rd Ct.','Seattle','WA',98266,'(206) 524-8145');
INSERT INTO Customer VALUES(9 ,'Jim','Glussman','1432 E. Revenna','Seattle','WA',98266,'(206) 445-2139');
INSERT INTO Customer VALUES(10,'Larry','Styles','9825 S. Crest Lane','Bellevue','WA',98104,'(425) 745-9980');
INSERT INTO Customer VALUES(11,'Mike','Boren','642 Crest Ave.','Fife','WA',98523,'(360) 444-5678');
INSERT INTO Customer VALUES(12,'Ron','Thompson','789 122nd St.','Renton','WA',98666,'(360) 747-2222');
INSERT INTO Customer VALUES(13,'Sharon','Johnson','1223 Meyer Way','Fife','WA',98222,'(360) 333-666');
INSERT INTO Customer VALUES(14,'Sheri','Gordon','336 Hill St.','Seattle','WA',98103,'(206) 525-3344');
INSERT INTO Customer VALUES(15,'Todd','Hayes','1400 NW 88th','Lynnwood','WA',98036,'(206) 775-7689');
INSERT INTO Customer VALUES(16,'Wally','Jones','411 Webber Ave.','Seattle','WA',98105,'(206) 523-9957');
/* Display all the records from the table */
SELECT * FROM Customer;
if there is any query please ask in comments..
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.