MySQL command and function to create database :
Create database ..... ( database name ) ;
- msql> Create database mastertest1 ;
MySQL command and function to create table :
Create table ...... (table name) ;
- msql> Create table company1 ( code char(10), name char(35), address (40) );
MySQL command and function to see or show structure or scame of table :
Describe ........(table name) ;
- msql> Describe company2
Command and function to show tables list :
Show tables ;
Command function to copy structure of schame from other table :
Create Table ..... (new table) like ...... (first table)
- msql> Create Table Company2 like company1
Command function to insert data into database :
nsert into ....... (table name) ( ( ....... field name ) ) values ( ( ............value ) ) ;
- msql> Insert into company2 (code, name, address) values ( '245' , 'Big City' , 'Road jkt 54 ' ) ;
Command function to delete table :
Drop table ......... (table name) ;
- msql> Drop table company1 ;
Command function to create index -(or sort) :
Create index .......(index name) on .... (field name) ;
- msql> Create index compidx on address ;
Command function to erase or delete index :
Drop index ...... ( index name) ;
- msql> Drop index compidx;
Command function for string :
SubString :
Select vendorid, substring ( vendorid from 2 for 2 ) from transaction where date > '01/01/2008'
Select vendorid, adress from transaction where vendorid like '%Sony%'
Select vendorid, adress from transaction vendorid in ('one' , 'two', 'five' )
No comments:
Post a Comment