Sensor |
||
Model |
Price |
Safety |
XBR20 |
85,624.21 |
High |
GTX50 |
64,262.05 |
Low |
BUS100 |
79,522.00 |
High |
BUS200 |
32,572.60 |
Medium |
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?
VALUES ('T004', 'BUS100', 'Jane', 'Unacceptable');
VALUES ('T005', 'HUD999', 'Mike', 'Unacceptable');
VALUES ('T006', 'BUS100', 'Jane');
VALUES ('T007', 'BUS200', 'Jane', 'Unknown');
The SQL queries that sucessfully executes are as follows:
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
Get Answers For Free
Most questions answered within 1 hours.