pada postingan kali ini saya hanya mencotohkan beberapa fungsi string di mySQL , ,
berikut listingnya . .
sekian dulu yachh , , semoga bermanfaat . .
berikut listingnya . .
create database infoprib;
use infoprib;
create table pegawai(nip varchar(15) primary key,nama varchar (30),gaji int);
insert into pegawai values('12345','Dian Permana',1200000),
('12346','Tamara Febrianti',1000000),
('12347','Dara Permatasari',1200000),
('12348','Dita Nurafni',1200000),
('12349','Dhani Akbar',1000000),
('12350','Aan Setiawan',1000000);
select*from pegawai;
select nama from pegawai
where char_length(nama) <15;
select pegawai.nama, format(pegawai.gaji,0)
from pegawai;
select ucase(nama)
from pegawai;
select nama from pegawai
where mid(nama,2,1) = 'i';
select left(nama,4)
from pegawai;
select right(nama,4)
from pegawai;
select lcase(nama)
from pegawai;
select ltrim(nama)
from pegawai;
use infoprib;
create table pegawai(nip varchar(15) primary key,nama varchar (30),gaji int);
insert into pegawai values('12345','Dian Permana',1200000),
('12346','Tamara Febrianti',1000000),
('12347','Dara Permatasari',1200000),
('12348','Dita Nurafni',1200000),
('12349','Dhani Akbar',1000000),
('12350','Aan Setiawan',1000000);
select*from pegawai;
select nama from pegawai
where char_length(nama) <15;
select pegawai.nama, format(pegawai.gaji,0)
from pegawai;
select ucase(nama)
from pegawai;
select nama from pegawai
where mid(nama,2,1) = 'i';
select left(nama,4)
from pegawai;
select right(nama,4)
from pegawai;
select lcase(nama)
from pegawai;
select ltrim(nama)
from pegawai;
select upper(nama)
from pegawai;
from pegawai;
sekian dulu yachh , , semoga bermanfaat . .
No comments:
Post a Comment
Your comments are very valuable