DECIMAL(n,m);
where n is the total number of digits and
m is the max number of digits you can have
after the decimal point.
Example:
salary decimal(7,2);
Commands:
// Create Database
Create Database LP;
//Select Database
//Select Database
Use LP;
//Create
table DPK
Create table DPK (Employee_ID INT Not NULL,Employee_Name Varchar (20)NOT NULL, Salary decimal(7,2) NOT NULL ,PRIMARY KEY (Employee_ID));
Create table DPK (Employee_ID INT Not NULL,Employee_Name Varchar (20)NOT NULL, Salary decimal(7,2) NOT NULL ,PRIMARY KEY (Employee_ID));
//Retrieve
Data from DPK
Select * from DPK;
Select * from DPK;
//Insert Data
into DPK
INSERT into DPK(Employee_ID, Employee_Name,Salary) values (101,
'Ram Kumar',89555.78 );
INSERT into DPK(Employee_ID,
Employee_Name,Salary) values (102, 'suryosnata',55000.79);
INSERT into DPK(Employee_ID, Employee_Name,Salary)
values (103, 'Dipak',90000.58 );
//Retrieve
Data from DPK
Select
* from DPK;
No comments:
Post a Comment