Category: Table & Views
-
MySQL DESCRIBE TABLE
DESCRIBE means to show the information in detail. Since we have tables in MySQL, so we will use the DESCRIBE command to show the structure of our table, such as column names, constraints on column names, etc. The DESC command is a short form of the DESCRIBE command. Both DESCRIBE and DESC command are equivalent and case sensitive.…
-
My SQL TRUNCATE Table
The TRUNCATE statement in MySQL removes the complete data without removing its structure. It is a part of DDL or data definition language command. Generally, we use this command when we want to delete an entire data from a table without removing the table structure. The TRUNCATE command works the same as a DELETE command without using…
-
MySQL Rename Table
Sometimes our table name is non-meaningful, so it is required to rename or change the name of the table. MySQL provides a useful syntax that can rename one or more tables in the current database. Syntax The following are the syntax used to change the name of the table: Here, we have to make sure…
-
MySQL Show/List Tables
The show or list table is very important when we have many databases that contain various tables. Sometimes the table names are the same in many databases; in that case, this query is very useful. We can get the number of table information of a database using the following statement: The following steps are necessary…
-
MySQL ALTER Table
MySQL ALTER statement is used when you want to change the name of your table or any table field. It is also used to add or delete an existing column in a table. The ALTER statement is always used with “ADD”, “DROP” and “MODIFY” commands according to the situation. 1) ADD a column in the…
-
MySQL CREATE TABLE
A table is used to organize data in the form of rows and columns and used for both storing and displaying records in the structure format. It is similar to worksheets in the spreadsheet application. A table creation command requires three things: MySQL allows us to create a table into the database mainly in two ways: MySQL…