Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is assignment in to be finished in mySql, don\'t worry about the output, ju

ID: 3908163 • Letter: T

Question

This is assignment in to be finished in mySql, don't worry about the output, just show me the sql code how to finish the process.

Suppose I have a table named CITY and follow these steps:

1. run command SELECT CONNECTION_ID();

2. Lock the CITY table for READ.

3. Insert new a row with these values into the CITY table

(4080,'Test','Test','Test',111111);

what's the output here?

4. Open a new connection to the DB server by going to the Quey menu and choose New Tab To Current Server.

5. run command SELECT CONNECTION_ID();

6. In the second connection, insert a new a row with these values into the CITY table

(4080,'Test','Test','Test',111111);

what's the output here?

7. Now go back to the first connection tab and issue a command to UNLOCK the table.

8. Now go back to the second connection tab and use SELECT COUNT to see how many rows are in the CITY table.

9. what happened to the row inserted in step 6?

10. Go to the first connection tab, issue a command to LOCK CITY table for WRITE.

Then insert a new a row with these values into the CITY table

(4081,'Test','Test','Test',111111);

Does it work?

11. In the first connection tab, issue command to unlock table.

12. In the second connection tab, use the command SHOW PROCESSLIST to see your processes.

Explanation / Answer

Answer)

1. run command SELECT CONNECTION_ID();

2. LOCK TABLES CITY READ;

3. insert into CITY values(4080,'Test','Test','Test',111111);

4. Open a new connection to the DB server by going to the Query menu and choose New Tab To Current Server.

5. run command SELECT CONNECTION_ID();

6. insert into CITY values(4080,'Test','Test','Test',111111);

7. Now go back to the first connection tab and issue a command to UNLOCK the table. --

UNLOCK TABLES;

8. SELECT COUNT(*) FROM CITY;

10. LOCK TABLES CITY WRITE;

insert into CITY values (4081,'Test','Test','Test',111111);

11. UNLOCK TABLES;

12. In the second connection tab, use the command SHOW PROCESSLIST to see your processes.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote