Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I used this script and I created a table CREATE TABLE `employee` ( `id` int(3) NOT NULL AUTO_INCREMENT, `first_name` varchar(20) DEFAULT NULL, `last_name` varchar(20) DEFAULT
I used this script and I created a table
CREATE TABLE `employee` ( `id` int(3) NOT NULL AUTO_INCREMENT, `first_name` varchar(20) DEFAULT NULL, `last_name` varchar(20) DEFAULT NULL, `username` varchar(250) DEFAULT NULL, `password` varchar(20) DEFAULT NULL, `address` varchar(45) DEFAULT NULL, `contact` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
And It suppose to generate unique Primary key for every row and I can insert (first_name,last_name,username,password,address,contact ) for first row but when i tried second I'm getting Duplicate entry '1' for key 'employee.PRIMARY'. I though AUTO_INCREMENT generate unique PK for every row. I would appreciate for help.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started