1 / 10

Data Manipulation Language

Data Manipulation Language. Data Manipulation Language (DML) merupakan bahasa SQL yang digunakan untuk memanipulasi data dalam basis data (Database). Merupakan perintah Universal yang dapat digunakan dalam banyak bahasa pemrograman .

kira
Download Presentation

Data Manipulation Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Data Manipulation Language • Data Manipulation Language (DML) merupakanbahasa SQL yang digunakanuntukmemanipulasi data dalam basis data (Database). • Merupakanperintah Universal yang dapatdigunakandalambanyakbahasapemrograman. • Terdiridariperintah Select, Insert, Update dan Delete.

  2. BentukUmum Insert • Insert Into TableName [(Field,[Field]…)] Values (Value [Value]…) Contoh : Insert Into Mhs (NPM,Nama,Alamat) Values (‘2008240001’,’Chyntia’, ’JlnBasukiRahmat’)

  3. BentukUmum Update • Update TableName Set Field = Value, [Field = Value]….[Where Condition] Contoh : Update Mhs Set Nama = ‘Pratami’ Where Npm = ‘2008240001’ BentukUmum Delete • Delete From TableName [Where Condition] Contoh : Delete From MhsWhereNpm = 2008240001’

  4. BentukUmum Select Select [All | Distinct] Field(s) From Table(s) [Where Condition] [Group By Field(s)] [Order By Field(s) [Asc | Desc]] Contoh: • Select * From Mhs Where Npm = ‘2008240001’ • Select Npm,Nama From Mhs Where • Npm = ‘2008240001’

  5. Operator PadaKlausa Where • AND Operator dimanakeduakondisi yang dinyatakanpadaklausa where bernilai True. Contoh : Select Npm,Nama,Umur From MhsWhere Umur > 17 and Umur < 20 • Catatan : Jikatipe data umurmerupakanangka, makatidakperluditambahkantandapetik (‘)

  6. OR Operator dimanasalahsatukondisi yang dinyatakanpadaklausa where bernilai True. Contoh : Select Npm,Nama,Umur From Mhs Where Nama = ‘Chyntia’ or Nama = ‘Pratami’ • NOT Operator yang digunakanuntukmenyatakankebalikandarikondisi yang dinyatakandalamklausa where. Contoh : Select Npm,Nama,Umur From Mhs Where Not Nama = ‘Pratami’

  7. BETWEEN – AND Operator yang digunakanuntukmenyatakan suatukondisidalambatasan (range) yang ditentukandalamsuatuklausa where. Contoh : Select Npm,Nama,TglLahir From Mhs Where TglLahir between #1985-05-05# and #1987-05-05# • IN Operator dimanasalahsatukondisi yangdinyatakanpadaklausa where bernilai True. (Identikdengan operator Or) Contoh: Select Npm,Nama,Umur From Mhs Where Nama In (‘Chyntia’,’Pratami’)

  8. LIKE Operator yang digunakanuntukmelakukanpencarian data, dimana data yang akandicarimendekatikondisi yang dideklarasikandidalamklausa where. Contoh : Select Npm,Nama,TglLahir From Mhs Where Nama Like ‘%Chyntia%’

  9. FungsiPada DML • AVG Digunakanuntukmerata-ratakan field tertentu yang dideklarasikanpadasebuahperintah Select. Contoh : Select Avg(Harga) From Tjual Where Nota = ‘011’ • MAX Digunakanuntukmendapatkannilaiterbesar (maksimal) dari field yang dideklarasikanpada sebuahperintah Select. Contoh : Select Max(Harga) FromTjual Where Kode = ‘TV’

  10. MIN Digunakanuntukmendapatkannilaiterkecil (minimal) dari field yang dideklarasikanpadasebuahperintah Select. Contoh : • Select Min(Harga) From Tjual Where Kode= ‘TV’

More Related