from command prompt:
- Goto Start->All Programs->MySql->MySql server 5.1->MySql Command Line Client.
- It will open MySql prompt(mysql> ).
- Enter password and proceed.
- To list databases:
- To select database:
Ex: use test;
- To list tables in database:
- To see table schema:
Ex: describe emptable;
- To create table:
create table if not exists `EMP_MASTER`
(
`EMP_ID` varchar(10) NOT NULL, `NAME` varchar(20), `ADDRESS` varchar(50), `SALARY` NUMERIC(10,2),
constraint SYS_C2516 unique (EMP_ID),
primary key (EMP_ID)
);
- To insert records in table:
insert into `EMP_MASTER` (`EMP_ID`, `NAME`, `SALARY`) values ('1000053003',`JOHN CENA`, 35000.00);
- To delete all records from table:
Ex: truncate table `EMP_MASTER`;
- To delete table:
Ex: drop table `EMP_MASTER`;
No comments:
Post a Comment