Hosting gratis - Introducing MySQL SQL 53 Using the basic command

Introducing MySQL SQL 53 Using the basic command produces the following: mysql> show processlist; +–+—-+———+——–+——-+—-+—–+—————+ |Id|User|Host |db |Command|Time|State|Info | +–+—-+———+——–+——-+—-+—–+—————+ |1 |joeg|localhost|NULL |Sleep |8900| |NULL | |4 |ODBC|localhost|accounts|Query |0 | NULL|showprocesslist| +–+—-+———+——–+——-+—-+—–+—————+ 2 rows in set (0.00 sec) As you can see, the command tells you a user s name, the host the user is connecting from, what database the user is using, and even the command the user is executing. More on Tables Let s examine the natural progression of database creation and manipulation. First, you design the database and tables; next you add them to the server, populate the tables with data, and finally retrieve and manipulate the data. Now, what happens when you have to change a table? In this section, we look at the various commands available in MySQL for changing the definition of a table. Specifically, we consider renaming a table, altering the columns and their definitions, placing tables, and deleting tables. As you ll see, for the first three tasks you use the ALTER TABLE command. Renaming You rename a table by using the ALTER TABLE command. For example: mysql> ALTER TABLE acc RENAME account; Query OK, 0 rows affected (0.03 sec) mysql> show tables; +——————–+ | Tables_in_accounts | +——————–+ | account | +——————–+ 1 row in set (0.00 sec) Here you use the command to rename the acc table to the accounts table. You can use the SHOW TABLES command to verify that the table name was accurately changed. Altering Column Definitions One of the primary uses for the ALTER TABLE command is changing the schema of a table. The change could be adding a new column, changing the

Hint: If you are looking for very good and affordable webspace to host and run your tomcat hosting application check Sandzak.com tomcat web hosting provider

Comments are closed.