-
Notifications
You must be signed in to change notification settings - Fork 0
/
CS31A_Phase5_JDBC.txt
751 lines (683 loc) · 28.1 KB
/
CS31A_Phase5_JDBC.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
/* name: Brian Fiala
* date: 6/20/14
* Professor Mounjed Moussalem, CS31A, Foothill Community College
* Term Project, Phase 5
*
* Class Foothill: instantiates an object of class ConnInterface, and uses it to
* establish a connection with an Oracle db that stores information about Napa
* Valley wines. Offers the user 8 options for viewing databse information and
* for adding new information to the database.
*/
import java.sql.*;
import java.util.Scanner;
public class Foothill
{
public static void main (String args [])
{
Scanner input = new Scanner(System.in);
String user = "hr";
String pass = "oracle";
boolean connOpen = false;
// create database interface object
ConnInterface dbConn = new ConnInterface(user, pass);
connOpen = dbConn.openConn();
if (connOpen)
{
System.out.println("Welcome to the Napa Valley wines database!");
int selection; // option selected by user below
while(true)
{
System.out.println("\n\nPlease enter the integer corresponding to"
+ " your selection:");
System.out.println("\t0. Quit");
System.out.println("\t1. Print all wines");
System.out.println("\t2. Lookup the appellation, county, climate "
+ "for a wine");
System.out.println("\t3. Find restaurants that serve a wine");
System.out.println("\t4. Find clients that frequent the same "
+ "restaurants as a given client");
System.out.println("\t5. Add a wine to the database");
System.out.println("\t6. Add a maker to a restaurant's menu");
System.out.println("\t7. Add a new location for a restaurant");
selection = input.nextInt();
if (selection == 0)
{
System.out.println("Thank you for using the Team Awesome Napa "
+ "Valley wines database.\nClosing the database connection"
+ " and quitting.");
break;
}
switch (selection)
{
case 1:
if (!dbConn.printWines())
System.out.println("Error getting wines.");
break;
case 2:
if (!dbConn.lookupAppellation())
System.out.println("Error getting appellations.");
break;
case 3:
if (!dbConn.findRestaurants())
System.out.println("Error finding restaurants.");
break;
case 4:
if (!dbConn.findPotBuddies())
System.out.println("Error finding other clients.");
break;
case 5:
if (!dbConn.addWine())
System.out.println("Error adding wine to database.");
break;
case 6:
if (!dbConn.addMakerToMenu())
System.out.println("Error adding maker to menu.");
break;
case 7:
if (!dbConn.addLocation())
System.out.println("Error adding location to database.");
break;
default: break;
} // end switch
} // end while
dbConn.closeScanner();
dbConn.closeConn(); // close db connection
} // end if (connOpen)
input.close(); // close Scanner object
} // end main
} // end class Foothill --------------------------------------------------------
/* ----------------------------------------------------------------------------
* Class ConnInterface: provides methods for establishing a database connection,
* querying and updating the database, and closing the connection.
*/
class ConnInterface
{
private Connection conn = null;
private String user, pass;
private Scanner userInput = new Scanner(System.in);
// constructor
public ConnInterface(String user, String pass)
{
setUser(user);
setPass(pass);
} // end constructor
public boolean openConn()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:" + user + "/"
+ pass + "@//127.0.01:1521/PDB1");
}
catch (ClassNotFoundException e)
{
System.out.println("Could not load the driver");
return false;
}
catch (SQLException e)
{
System.out.println("Error establishing connection");
return false;
}
return true;
} // end openConn
public void closeConn()
{
try
{
conn.close();
}
catch (Exception e)
{
System.out.println("Error closing connection");
e.printStackTrace();
}
} // end closeConn
public void closeScanner()
{
userInput.close();
}
public String getUser()
{
return user;
} // end getUser
public void setUser(String user)
{
this.user = user;
} // end setUser
public String getPass()
{
return pass;
} // end getPass
public void setPass(String pass)
{
this.pass = pass;
} // end setPass
public boolean printWines()
{
try
{
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("SELECT * FROM Wines");
System.out.println("\nWine Name Vintage Maker Name"
+ " Color\n");
String winePad, vintagePad, makerPad;
String padBuffer = " ";
while (rset.next())
{
winePad = padBuffer.substring(0, 21 - rset.getString(1).length());
vintagePad = " ";
makerPad = padBuffer.substring(0, 31 - rset.getString(3).length());
System.out.println(rset.getString(1) + winePad
+ rset.getString(2) + vintagePad
+ rset.getString(3) + makerPad
+ rset.getString(4));
}
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or result set");
e.printStackTrace();
return false;
}
return true;
} // end printWines
public boolean lookupAppellation()
{
try
{
// create prepared statement
PreparedStatement stmt = conn.prepareStatement(
"SELECT Appellations.appellationName, county, climate "
+ "FROM Appellations, Origin "
+ "WHERE Appellations.appellationName = Origin.appellationName "
+ "AND Origin.wineName LIKE ? "
+ "AND Origin.vintage LIKE ? "
+ "AND Origin.makerName LIKE ? ");
// Query user for wine and set statement parameters
System.out.println("Enter the wine name, exactly: ");
stmt.setString(1, userInput.nextLine());
System.out.println("Enter the vintage: ");
stmt.setString(2, userInput.nextLine());
System.out.println("Enter the maker name, exactly: ");
stmt.setString(3, userInput.nextLine());
// execute the query and display the results
ResultSet rset = stmt.executeQuery();
System.out.println("\nAppellation Name County Climate\n");
String appellationPad, countyPad;
String padBuffer = " ";
while (rset.next())
{
appellationPad = padBuffer.substring(0,
21 - rset.getString(1).length());
countyPad = padBuffer.substring(0, 11 - rset.getString(2).length());
System.out.println(rset.getString(1) + appellationPad
+ rset.getString(2) + countyPad
+ rset.getString(3));
}
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or result set");
e.printStackTrace();
return false;
}
return true;
} // end lookupAppellation
public boolean findRestaurants()
{
try
{
// create prepared statement
PreparedStatement stmt = conn.prepareStatement(
"SELECT DISTINCT Restaurants.restaurantName, "
+ "Restaurants.restaurantAddress "
+ "FROM Restaurants, Serves "
+ "WHERE Restaurants.restaurantAddress = "
+ "Serves.restaurantAddress "
+ "AND Serves.wineName LIKE ? "
+ "AND Serves.vintage LIKE ? "
+ "AND Serves.makerName LIKE ? ");
// Query user for wine and set statement parameters
System.out.println("Enter the wine name, exactly: ");
stmt.setString(1, userInput.nextLine());
System.out.println("Enter the vintage: ");
stmt.setString(2, userInput.nextLine());
System.out.println("Enter the maker name, exactly: ");
stmt.setString(3, userInput.nextLine());
// execute the query and display the results
ResultSet rset = stmt.executeQuery();
System.out.println("\nRestaurant Name "
+ "Restaurant Address\n");
String namePad;
String padBuffer = " ";
while (rset.next())
{
namePad = padBuffer.substring(0, 31 - rset.getString(1).length());
System.out.println(rset.getString(1) + namePad
+ rset.getString(2));
}
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or result set");
e.printStackTrace();
return false;
}
return true;
} // end findRestaurants
public boolean findPotBuddies()
{
try
{
// create prepared statement
PreparedStatement stmt = conn.prepareStatement(
"SELECT DISTINCT F2.clientName, F2.clientAddress "
+ "FROM Frequents F1, Frequents F2 "
+ "WHERE F1.restaurantName = F2.restaurantName "
+ "AND F1.restaurantAddress = F2.restaurantAddress "
+ "AND F1.clientName LIKE ? "
+ "AND F1.clientAddress LIKE ? "
+ "AND F2.clientName NOT LIKE ? "
+ "AND F2.clientAddress NOT LIKE ? ");
// Query user for client info and set statement parameters
String name, address;
System.out.println("Enter the client's name, exactly: ");
name = userInput.nextLine();
stmt.setString(1, name);
stmt.setString(3, name);
System.out.println("Enter the client's address, exactly: ");
address = userInput.nextLine();
stmt.setString(2, address);
stmt.setString(4, address);
// execute the query and display the results
ResultSet rset = stmt.executeQuery();
System.out.println("\nClient Names Client Addresses\n");
String namePad;
String padBuffer = " ";
while (rset.next())
{
namePad = padBuffer.substring(0, 21 - rset.getString(1).length());
System.out.println(rset.getString(1) + namePad
+ rset.getString(2));
}
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or result set");
e.printStackTrace();
return false;
}
return true;
} // end findPotBuddies
public boolean addWine()
{
try
{
// create prepared statement
PreparedStatement stmt = conn.prepareStatement(
"INSERT INTO Wine_Info VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
// Query user for wine info and set statement parameters
System.out.println("Enter the wine name: ");
stmt.setString(1, userInput.nextLine());
System.out.println("Enter the vintage (later than 1850): ");
stmt.setString(2, userInput.nextLine());
System.out.println("Enter the maker's name, exactly "
+ "(must be an existing maker): ");
stmt.setString(3, userInput.nextLine());
System.out.println("Enter the color (Red, White, or Rose): ");
stmt.setString(4, userInput.nextLine());
System.out.println("Enter the varietal: ");
stmt.setString(5, userInput.nextLine());
System.out.println("Enter the appellation: ");
stmt.setString(6, userInput.nextLine());
System.out.println("Enter the county (must be Sonoma or Napa: ");
stmt.setString(7, userInput.nextLine());
System.out.println("Enter the climate (less than 5 characters): ");
stmt.setString(8, userInput.nextLine());
// execute the query and display the results
int rows = stmt.executeUpdate();
System.out.println("Inserted " + rows + " wine into database.");
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or update");
e.printStackTrace();
return false;
}
return true;
} // end addWine
public boolean addMakerToMenu()
{
try
{
// create prepared statement
CallableStatement stmt = conn.prepareCall(
"{CALL AddMakerToMenu(?, ?)}");
// Query user for wine info and set statement parameters
System.out.println("Enter the maker's name, exactly "
+ "(must be an existing maker): ");
String maker = userInput.nextLine();
stmt.setString(1, maker);
System.out.println("Enter the restaurant's address, exactly "
+ "(must be an existing location): ");
stmt.setString(2, userInput.nextLine());
// execute the query and display the results
stmt.execute();
System.out.println("Inserted " + maker + " into Serves table.");
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or update");
e.printStackTrace();
return false;
}
return true;
} // end addMakerToMenu
public boolean addLocation()
{
try
{
// create prepared statement
CallableStatement stmt = conn.prepareCall(
"{CALL NewLocationSameMenu(?, ?)}");
// Query user for wine info and set statement parameters
System.out.println("Enter the restaurant's name, exactly "
+ "(must be an existing restaurant): ");
String name = userInput.nextLine();
stmt.setString(1, name);
System.out.println("Enter the new location's address: ");
stmt.setString(2, userInput.nextLine());
// execute the query and display the results
stmt.execute();
System.out.println("Inserted the new location for " + name);
stmt.close();
}
catch (SQLException e)
{
System.out.println("SQL error: bad connection, statement,"
+ " or update");
e.printStackTrace();
return false;
}
return true;
} // end addLocation
} // end class ConnInterface ---------------------------------------------------
/*-----------------------------Paste From Console-------------------------------
Welcome to the Napa Valley wines database!
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
1
Wine Name Vintage Maker Name Color
Cabernet Sauvignon 2012 Alpha Omega Red
Cabernet Sauvignon 2011 Alpha Omega Red
Cabernet Sauvignon 2010 Alpha Omega Red
Cabernet Sauvignon 2009 Alpha Omega Red
Cabernet Sauvignon 2008 Alpha Omega Red
Chardonnay 2012 Alpha Omega White
Chardonnay 2011 Alpha Omega White
Chardonnay 2010 Alpha Omega White
Chardonnay 2009 Alpha Omega White
Chardonnay 2008 Alpha Omega White
Sauvignon Blanc 2012 Alpha Omega White
Sauvignon Blanc 2011 Alpha Omega White
Sauvignon Blanc 2010 Alpha Omega White
Sauvignon Blanc 2009 Alpha Omega White
Sauvignon Blanc 2008 Alpha Omega White
Grenache 2012 Domaine Chandon Winery White
Grenache 2011 Domaine Chandon Winery White
Chenin Blanc 2012 Domaine Chandon Winery White
Chenin Blanc 2011 Domaine Chandon Winery White
Menage a Trois 2012 Domaine Chandon Winery Red
Menage a Trois 2011 Domaine Chandon Winery Red
Reserve Pinot Noir 2011 Domaine Chandon Winery Red
Merlot 2012 Black Stallion Red
Cabernet Sauvignon 2012 Black Stallion Red
Sauvignon Blanc 2012 Black Stallion White
Syrah 2012 Black Stallion Red
Zinfandel 2012 Black Stallion Red
Muscat 2012 Black Stallion Red
Zinfandel 2012 Chateau Montelena Red
Chardonnay 2012 Chateau Montelena White
Riesling 2012 Chateau Montelena White
Petit Sirah 2012 Chateau Montelena Red
Cabernet Sauvignon 2012 Chateau Montelena Red
Syrah 2012 Cornerstone Cellars Red
Cabernet Franc 2012 Cornerstone Cellars Red
Pinot Gris 2012 Cornerstone Cellars White
Cabernet Sauvignon 2012 Cornerstone Cellars Red
Riesling 2012 Cornerstone Cellars White
Pinot Noir 2012 Etude Red
Chardonnay 2012 Etude White
Pinot Blanc 2012 Etude White
Malbec 2012 Etude Red
Chardonnay 2012 Far Niente White
Chardonnay 2011 Far Niente White
Cabernet Sauvignon 2012 Far Niente Red
Cabernet Sauvignon 2011 Far Niente Red
Malbec 2012 Arrowood Winery Red
Merlot 2012 Arrowood Winery Red
Syrah 2012 Arrowood Winery Red
Cabernet Sauvignon 2012 Arrowood Winery Red
Syrah 2012 Balletto Winery Red
Pinot Noir 2012 Balletto Winery Red
Chardonnay 2012 Balletto Winery White
Zinfandel 2012 Balletto Winery Red
Gerwurztraminer 2012 Balletto Winery White
Best Evil Wine Ever 1850 Domaine Chandon Winery Rose
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
2
Enter the wine name, exactly:
Chardonnay
Enter the vintage:
2012
Enter the maker name, exactly:
Far Niente
Appellation Name County Climate
Rutherford Napa Warm
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
3
Enter the wine name, exactly:
Chardonnay
Enter the vintage:
2012
Enter the maker name, exactly:
Far Niente
Restaurant Name Restaurant Address
French Laundry 1003 2nd St., Napa, CA 94599
French Laundry 6640 Washington St., Yountville, CA 94599
Mustards Grill 7399 Saint Helena Hwy., Napa, CA 94588
LaSalette 452 1st St. E, Sonoma, CA 95476
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
4
Enter the client's name, exactly:
Brian Fiala
Enter the client's address, exactly:
1018 Robin Way, Sunnyvale, CA 94087
Client Names Client Addresses
Marco Garcia 123 Main St., Soledad, CA 93960
John Peterson 1911 Grand Ave., Oakland, CA 94653
Chynna Rowe 1248 Burnett St., Berkeley, CA 94710
Cyrus Goh 508 California St., Mountain View, CA 94041
Alex Brandmeyer 1627 59th St., Oakland, CA 94657
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
5
Enter the wine name:
Best Evil Wine Ever
Enter the vintage (later than 1850):
2050
Enter the maker's name, exactly (must be an existing maker):
Domaine Chandon Winery
Enter the color (Red, White, or Rose):
Rose
Enter the varietal:
Super GMO Grape
Enter the appellation:
Monsanto Napa
Enter the county (must be Sonoma or Napa:
Napa
Enter the climate (less than 5 characters):
Hot
Inserted 1 wine into database.
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
1
Wine Name Vintage Maker Name Color
Best Evil Wine Ever 2050 Domaine Chandon Winery Rose
Cabernet Sauvignon 2012 Alpha Omega Red
Cabernet Sauvignon 2011 Alpha Omega Red
Cabernet Sauvignon 2010 Alpha Omega Red
Cabernet Sauvignon 2009 Alpha Omega Red
Cabernet Sauvignon 2008 Alpha Omega Red
Chardonnay 2012 Alpha Omega White
Chardonnay 2011 Alpha Omega White
Chardonnay 2010 Alpha Omega White
Chardonnay 2009 Alpha Omega White
Chardonnay 2008 Alpha Omega White
Sauvignon Blanc 2012 Alpha Omega White
Sauvignon Blanc 2011 Alpha Omega White
Sauvignon Blanc 2010 Alpha Omega White
Sauvignon Blanc 2009 Alpha Omega White
Sauvignon Blanc 2008 Alpha Omega White
Grenache 2012 Domaine Chandon Winery White
Grenache 2011 Domaine Chandon Winery White
Chenin Blanc 2012 Domaine Chandon Winery White
Chenin Blanc 2011 Domaine Chandon Winery White
Menage a Trois 2012 Domaine Chandon Winery Red
Menage a Trois 2011 Domaine Chandon Winery Red
Reserve Pinot Noir 2011 Domaine Chandon Winery Red
Merlot 2012 Black Stallion Red
Cabernet Sauvignon 2012 Black Stallion Red
Sauvignon Blanc 2012 Black Stallion White
Syrah 2012 Black Stallion Red
Zinfandel 2012 Black Stallion Red
Muscat 2012 Black Stallion Red
Zinfandel 2012 Chateau Montelena Red
Chardonnay 2012 Chateau Montelena White
Riesling 2012 Chateau Montelena White
Petit Sirah 2012 Chateau Montelena Red
Cabernet Sauvignon 2012 Chateau Montelena Red
Syrah 2012 Cornerstone Cellars Red
Cabernet Franc 2012 Cornerstone Cellars Red
Pinot Gris 2012 Cornerstone Cellars White
Cabernet Sauvignon 2012 Cornerstone Cellars Red
Riesling 2012 Cornerstone Cellars White
Pinot Noir 2012 Etude Red
Chardonnay 2012 Etude White
Pinot Blanc 2012 Etude White
Malbec 2012 Etude Red
Chardonnay 2012 Far Niente White
Chardonnay 2011 Far Niente White
Cabernet Sauvignon 2012 Far Niente Red
Cabernet Sauvignon 2011 Far Niente Red
Malbec 2012 Arrowood Winery Red
Merlot 2012 Arrowood Winery Red
Syrah 2012 Arrowood Winery Red
Cabernet Sauvignon 2012 Arrowood Winery Red
Syrah 2012 Balletto Winery Red
Pinot Noir 2012 Balletto Winery Red
Chardonnay 2012 Balletto Winery White
Zinfandel 2012 Balletto Winery Red
Gerwurztraminer 2012 Balletto Winery White
Best Evil Wine Ever 1850 Domaine Chandon Winery Rose
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
6
Enter the maker's name, exactly (must be an existing maker):
Domaine Chandon Winery
Enter the restaurant's address, exactly (must be an existing location):
400 1st St. E, Sonoma, CA 95476
Inserted Domaine Chandon Winery into Serves table.
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
7
Enter the restaurant's name, exactly (must be an existing restaurant):
Burgers and Vine
Enter the new location's address:
1 Landfill Ave., Richmond, CA 92345
Inserted the new location for Burgers and Vine
Please enter the integer corresponding to your selection:
0. Quit
1. Print all wines
2. Lookup the appellation, county, climate for a wine
3. Find restaurants that serve a wine
4. Find clients that frequent the same restaurants as a given client
5. Add a wine to the database
6. Add a maker to a restaurant's menu
7. Add a new location for a restaurant
0
Thank you for using the Team Awesome Napa Valley wines database.
Closing the database connection and quitting.
----------------------------End Paste From Console----------------------------*/