

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
example update modify , drop alter add,.....
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!


1 Create Database To create a new database in MySQL. Create Database DatabaseName ; 2 Show Databases To show all databases that are exist in MySQL. Show Databases; 3 Connect To connect to a database in MySQL. Connect DatabaseName ; 4 Use To use and work on a database in MySQL. Use DatabaseName ; 5 Show Tables To show all tables that are exist in a database. Show Tables; 6 Drop Database To remove an existing database from MySQL. Drop Database DatabaseName ;
1 Create Table To create a new table. Create Table TableName ( Column1 DataType1 [constraint1], Column2 DataType2 [constraint2], …… …… ColumnN DataTypeN [constraintN], Primary key ( ColumnName ), [ foreign key ( ColumnName ) References ParentTable ( ColumnName ) ON Delete Set Null ON Update Cascade ] ); 2 Drop Table To drop (remove) a table from a database. Drop Table TableName ; 3 Alter Table Add To add a new column to a table. Alter Table TableName Add ColumnName DataType ; 4 Alter Table Modify To modify (change) a column (name/type/size/constraint) in a table. Alter Table TableName Modify ColumnName DataType ; 5 Alter Table Drop To drop (remove) a column from a table. Alter Table TableName Drop ColumnName ; 6 Desc To show columns description of a table. Desc TableName ;