Concept explainers
The following three tables make up a simple reservation system for a small campground. The
Table: Camper
CAMPER_NUMBER |
1000 |
1001 |
1002 |
1003 |
CAMPER_LAST_NAME |
Jones |
Schmidt |
Williams |
Cooper |
CAMPER_FIRST_NAME |
Jamie |
Pat |
Clifford |
Amanda |
CAMPER_ADDRESS |
1278 Essex Pl |
4954 Spangled Way |
956 Segull Lane |
P. O. Box 998877 |
CAMPER_CITY |
Birmingham |
El Paso |
Portland |
Portsmouth |
CAMPER_STATE |
AL |
TX |
ME |
OH |
CAMPER_ZIP_CODE |
45251 |
79919 |
4108 |
45662 |
CAMPER_DRIVERS_LICENSE |
JJ998743-98 |
87632434 |
WIL885123 |
765A876B897 |
CAMPER_EMAIL |
jjones@somewhere.com |
patwonderfu34l@nowhere.net |
williams98342@foomail.com |
coopera@nowhere.net |
Table: Spot
SPOT_NUMBER |
101 |
102 |
103 |
104 |
SPOT_NAME |
The Pines |
The Glade |
Teardrop Spot |
Tent In Trees |
SPOT_LENGTH |
55 |
50 |
20 |
0 |
SPOT_PULLTHRU |
1 |
0 |
0 |
0 |
SPOT_ELECTRIC_AMPS |
50 |
50 |
20 |
0 |
SPOT_WATER |
1 |
1 |
1 |
1 |
SPOT_SEWER |
1 |
1 |
0 |
0 |
SPOT_RATE_WEEKDAY |
35 |
33 |
15 |
12 |
SPOT_RATE_WEEKEND |
42 |
42 |
22 |
15 |
Table: Reservation
RESV_NUMBER |
1 |
2 |
3 |
4 |
5 |
RESV_DATE |
2015-05-15 |
2015-05-14 |
2015-05-14 |
2015-05-20 |
2016-06-01 |
RESV_NIGHTS |
2 |
4 |
4 |
1 |
2 |
SPOT_NUMBER |
101 |
103 |
104 |
101 |
101 |
CAMPER_NUMBER |
1002 |
1000 |
1001 |
1002 |
1002 |
RESV_RATE |
84 |
150 |
24 |
35 |
85 |
RESV_DEPOSIT |
20 |
25 |
24 |
10 |
0 |
Identify the primary keys and foreign keys in the three tables by dropping the correct column name or names into the table. If there is no primary or foreign key then drop none as your answer.
Table |
Primary Key |
Foreign Key(s) |
Camper |
SelectCAMPER_NUMBERCAMPER_LAST_NAMECAMPER_FIRST_NAMECAMPER_ADDRESSCAMPER_CITYCAMPER_STATECAMPER_ZIP_CODECAMPER_DRIVERS_LICENSECAMPER_EMAILNoneItem 1 | SelectCAMPER_NUMBERCAMPER_LAST_NAMECAMPER_FIRST_NAMECAMPER_ADDRESSCAMPER_CITYCAMPER_STATECAMPER_ZIP_CODECAMPER_DRIVERS_LICENSECAMPER_EMAILNoneItem 2 |
Spot |
SelectSPOT_NUMBERSPOT_NAMESPOT_LENGTHSPOT_PULLTHRUSPOT_ELECTRIC_AMPSSPOT_WATERSPOT_SEWERSPOT_RATE_WEEKDAYSPOT_RATE_WEEKENDNoneItem 3 | SelectSPOT_NUMBERSPOT_NAMESPOT_LENGTHSPOT_PULLTHRUSPOT_ELECTRIC_AMPSSPOT_WATERSPOT_SEWERSPOT_RATE_WEEKDAYSPOT_RATE_WEEKENDNoneItem 4 |
Reservation |
SelectRESV_NUMBERRESV_DATERESV_NIGHTSSPOT_NUMBERCAMPER_NUMBERRESV_RATERESV_DEPOSITNoneItem 5 | SelectRESV_NUMBERRESV_DATERESV_NIGHTSSPOT_NUMBERCAMPER_NUMBERRESV_RATERESV_DEPOSITCAMPER_NUMBER and SPOT_NUMBERNone |
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Consider the following table in a relational database.Last Name Rank Room ShiftSmith Manager 234 MorningJones Custodian 33 AfternoonSmith Custodian 33 EveningDoe Clerical 222 MorningAccording to the data shown in the table, which of the following could be candidate keys of the table?a) {Last Name}b) {Room}c) {Shift}d) {Rank, Room}e) {Room, Shift}arrow_forwardQ1:Draw ERD for the following database (Library) Customer Card number Password Name | Address ID Phone Username number Employee ID Phone number Password Username Name Branch number Card Number CW Branch Number Address | Phone number Bill Customer id Employee id Total price Order ID Day Time Book Isbh Name Availability Id Cost Address Cart Order number Book id Customer id Card number Customer Total price namearrow_forwardq5-arrow_forward
- The following database will be used in this question: SALESREP SalesRepNo 654 734 345 434 RepName Jones Smith Chen Johnson HireDate 01/02/2005 02/03/2007 01/25/2004 11/23/2004 CUSTOMER CustNo 9870 8590 7840 4870 CustName Winston Gonzales Harris Miles Balance 500 350 SalesRepNo 345 434 654 345 800 100arrow_forwardq4- Choose all that applyarrow_forwardAccess Assignment Problem: JMS TechWizards is a local company that provides technical services to several small businesses in the area. The company currently keeps its technicians and clients’ records on papers. The manager requests you to create a database to store the technician and clients’ information. The following table contains the clients’ information. Client Number Client Name Street City State Postal Code Telephone Number Billed Paid Technician Number AM53 Ashton-Mills 216 Rivard Anderson TX 78077 512-555-4070 $315.50 $255.00 22 AR76 The Artshop 722 Fisher Liberty Corner TX 78080 254-555-0200 $535.00 $565.00 23 BE29 Bert's Supply 5752 Maumee Liberty Corner TX 78080 254-555-2024 $229.50 $0.00 23 DE76 D & E Grocery 464 Linnell Anderson TX 78077 512-555-6050 $485.70…arrow_forward
- Below is a database with 2 tables - Painter, Painting: Painting table: primary key = Painting Num, foreign key = Painter_Num 11 Painting Num Painting_title Painter_Num 1336 Tired peasants 123 1337 Dawn Thunder 111 1338 Plastic Paradise 111 Hasty Exit Vanilla Chocolate 123 1339 134 1340 1341 X-files 123 Painter table: primary key Painter Num, no foreign key Painter Num Painter_lastname Painter_Firstname Painter_Initial Nationality 111 Ross Smithson P British 123 Angela Itero X Italian The above database contains an error in the data. Identify and describe this error.arrow_forwardTask 3: The Car Maintenance team wants to insert and store the following maintenance types to the MAINTENANCE_TYPES table: ID: 1; Description: Tire Change; Price: 50 ID: 2; Description; Oil Change; Price: 45 ID: 3; Description; Full Cleaning; Price: 100 ID: 4; Description; Gas Pump Change; Price: 145 SQL Database Add the four maintenance types to the MAINTENANCE_TYPES table Test Query SELECT * FROM MAINTENANCE_TYPES Expected Results MAINTENANCE_TYPE_ID MAINTENANCE_TYPE_DESCRIPTION MAINTENANCE_PRICE 1 Tire Change 50 2 Oil Change 45 3 Full Cleaning 100 4 Gas Pump Change 145arrow_forwardInstructions: Write the suitable SQL statement to answer the following questions based on the following tables ( image for better table) Table Name: Employee EMP_ID FNAME LNAME SALARY JOIN_DATE DEP_NO 101 John Abraham 10000 01-JAN-13 11 202 Michael Clarke 80000 01-JAN-13 22 303 Roy Thomas 70000 01-FEB-13 11 404 Tom Jose 60000 01-FEB-13 22 505 Jerry Pinto 65000 01-FEB-13 22 606 Philip Mathew 75000…arrow_forward
- Use your ERD to define the table structures in the database using SQL DDL commands to build your schema.arrow_forwardsql code sql code sql codearrow_forwardWhat is the maximum number of columns you can define as a primary key when using the column-level approach to creating a table? ( refer to the tables in the JustLee Books database). a. 0 b. 1 c. 30 d. 255arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education