Posts

mysql

Image
CREATE   DATABASE  database_name;  //CREATE DB SHOW DATABASES;   // SHOWS ALL DB'S USE database_name;  //FIND DB AND SHOWS TABLES OF THAT  DATABASE  DROP   DATABASE  database_name;  //DELETES DB CREATE   TABLE  table_name (column_name column_type...);   Example: Here, we will create a table named "cus_tbl" in the database "customers". CREATE   TABLE  cus_tbl(      cus_id  INT   NOT   NULL  AUTO_INCREMENT,      cus_firstname  VARCHAR (100)  NOT   NULL ,      cus_surname  VARCHAR (100)  NOT   NULL ,       PRIMARY   KEY  ( cus_id )   );   Note: Here, NOT NULL is a field attribute and it is used because we don't want this field to be NULL. If you will try to create a record with NULL value, then MySQL wil...