Problem: Having created the table structure in Problem 1, write the SQL code to enter the first two rows for the table shown in Figure P8.2. Each row should be inserted individually, without using a subquery. Insert the rows in the order that they are listed in the figure.I gor an error: RROR 1062 (23000) at line 1: Duplicate entry '101' for key 'PRIMARY'

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem:

Having created the table structure in Problem 1, write the SQL code to enter the first two rows for the table shown in Figure P8.2. Each row should be inserted individually, without using a subquery. Insert the rows in the order that they are listed in the figure.I gor an error: RROR 1062 (23000) at line 1: Duplicate entry '101' for key 'PRIMARY'

when I used this script below, I got an error. see image.
ERROR 1062 (23000) at line 1: Duplicate entry '101' for key 'PRIMARY'

INSERT INTO EMP_1 VALUES ('101','News','John','G','2000-11-08','502');
INSERT INTO EMP_1 VALUES ('102','Senior','David','H','1989-07-12','501');

Correct
Expected Results
EMP_NUM
EMP LNAME
EMP FNAME
EMP_INITIAL
EMP_HIREDATE
JOв CODE
101
News
John
2000-11-08
502
102
Senior
David
H
1989-07-12
501
Actual Results
Incorrect ERROR 1062 (23000) at line 1: Duplicate entry '101' for key 'PRIMARY
EMP_NUM
EMP LNAME
EMP FNAME
EMP_INITIAL
EMP_HIREDATE
JOB_CODE
100
News
John
G
2000-11-08
502
101
NEWS
JOHN
2000-11-08
502
102
SENIOR
DAVID
H.
1989-07-12
501
Should be lower case
Transcribed Image Text:Correct Expected Results EMP_NUM EMP LNAME EMP FNAME EMP_INITIAL EMP_HIREDATE JOв CODE 101 News John 2000-11-08 502 102 Senior David H 1989-07-12 501 Actual Results Incorrect ERROR 1062 (23000) at line 1: Duplicate entry '101' for key 'PRIMARY EMP_NUM EMP LNAME EMP FNAME EMP_INITIAL EMP_HIREDATE JOB_CODE 100 News John G 2000-11-08 502 101 NEWS JOHN 2000-11-08 502 102 SENIOR DAVID H. 1989-07-12 501 Should be lower case
Expert Solution
Introduction

The given problem deals with inserting the data in the database table using SQL INSERT query.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY