Question

Sensor Model Price Safety XBR20 85,624.21 High GTX50 64,262.05 Low BUS100 79,522.00 High BUS200 32,572.60 Medium...

Sensor

Model

Price

Safety

XBR20

85,624.21

High

GTX50

64,262.05

Low

BUS100

79,522.00

High

BUS200

32,572.60

Medium

  1. Another table SensorTest uses TestCase column as Primary Key, and its SensorModel column is a Foreign Key that refers to Model column of Car Table. Four data entities already exist in the table as shown below.

SensorTest

TestCase (PK)

SensorModel (FK)

Tester

Result

T001

XBR20

Mike

Acceptable

T002

GTX50

Jane

Unacceptable

T003

GRX50

Mike

Acceptable

T004

BUS100

Mike

Acceptable

Which of the following SQL queries will successfully execute?

  1. INSERT INTO SensorTest (TestCase, SensorModel, Tester, Result)

VALUES ('T004', 'BUS100', 'Jane', 'Unacceptable');

  1. INSERT INTO SensorTest (TestCase, SensorModel, Tester, Result)

VALUES ('T005', 'HUD999', 'Mike', 'Unacceptable');

  1. INSERT INTO SensorTest

VALUES ('T006', 'BUS100', 'Jane');

  1. INSERT INTO SensorTest

VALUES ('T007', 'BUS200', 'Jane', 'Unknown');

Homework Answers

Answer #1

The SQL queries that sucessfully executes are as follows:

  • INSERT INTO SensorTest VALUES ('T007', 'BUS200', 'Jane', 'Unknown');

Explanation:

(1):

INSERT INTO SensorTest (TestCase, SensorModel, Tester, Result) VALUES ('T004', 'BUS100', 'Jane', 'Unacceptable');

This query wont works because the table already has a primary key "T004"

(2):

INSERT INTO SensorTest (TestCase, SensorModel, Tester, Result) VALUES ('T005', 'HUD999', 'Mike', 'Unacceptable');

This query wont works because the parent table has no entry with value "HUD999"

(3):

INSERT INTO SensorTest VALUES ('T006', 'BUS100', 'Jane');

This query wont works because all the attribute values are not spcified here.

(4):

INSERT INTO SensorTest VALUES ('T007', 'BUS200', 'Jane', 'Unknown');

This one works fine.

Mention in comments if any mistakes or errors are found. Thank you

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT