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

These questions go with \"mysql.\" i just need the correct code and statements f

ID: 3878794 • Letter: T

Question

These questions go with "mysql." i just need the correct code and statements for the questions that are listed. i will add them into the database.

8. (1 point) Type in the command to display the connection status 9. (1 point) Type in the command to display a list of available databases. 10. (1 point) Type in the command to use your lab2??? database. 11. (2 points) Using an ALTER statement, add the following 2 fields/columns to the students table Required TableName ColumnName students Students AdmitDate GradDate DatatypeSize DateTime DateTime 12. (1 point) Type in the command to display the structure of the students table in a horizontal format. More on the next page

Explanation / Answer

Ans.)

1. To show the connection status, execute the command below :

mysql > show status like 'Conn%'

This will give the total number of connection made till date in the current mysql server.

To get the current open connections, execute the command as below :

mysql > show processlist

It will list the current open connections with details,


mysql> show processlist;

+----+------+-----------------+--------+---------+------+-------+------------------+

| Id | User | Host | db | Command | Time | State | Info |

+----+------+-----------------+--------+---------+------+-------+------------------+

| 1 | root | localhost | webapp | Query | 0 | NULL | show processlist |

| 5 | root | localhost:66754 | webapp | Sleep | 210 | | NULL |

| 8 | root | localhost:66756 | webapp | Sleep | 210 | | NULL |

| 9 | root | localhost:66757 | webapp | Sleep | 210 | | NULL |

+----+------+-----------------+--------+---------+------+-------+------------------+

4 rows in set (0.00 sec)

2. To show the list of available databases, execute the below command :

mysql > show databases;

3. Command to switch to lab2 database :

mysql > use lab2;

4. To alter table, execute the command as below :


ALTER TABLE Students

ADD COLUMN 'AdmitDate' DATETIME NULL,
ADD COLUMN 'GradDate' DATETIME NULL;

Hope this helps. If you have any queries, drop a comment below.

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