Before getting to know more about DDL (Data Definition Language) and DML (Data Manipulation Language), it is necessary to know beforehand, that this discussion is included in database technology, which includes data management methods or techniques, both image text data and other data. Database management is done by writing command codes in the form of SQL Queries that you must enter according to your needs. The following below is the complete understanding of DDL and DML.
For the understanding of DDL and DML itself, that is if DDL (Data Definition Language) is a collection of SQL commands that you can use to manage, change the structure of datatype objects in databases such as indexes, tables, triggers, views and so on.
While DML (Data Manipulation Language) itself is a collection of commands that function for database management such as creating tables, creating new databases.
Examples of DDL and DML Commands
As mentioned earlier, DDL (Data Definition Language) and DML (Data Manipulation Language) are sets of commands that are used to perform functions to create, modify, or delete existing database entities. Therefore, below is a set of commands you can try to manage the database:
Relasi Basis Data
1. DDL (Bahasa Definisi Data)
DDL can be used to operate the structural schema on the database, the main commands that can be used in DDL (Data Definition Language) are CREATE, RENAME, ALTER, DROP. Create is the command used to create new databases and tables. While Rename is a command used to change names such as table names, and DROP is a command used to delete an object.
Contoh 1:
CREATE
TABLE Buku_Perpus( id INTEGER PRIMARY KEY, kode_buku VARCHAR(20) NULL,
judul_buku VARCHAR(225) NOT NULL, tanggal_terbit DATE NULL );
In the command example above, it means that a new table named Buku_Library will be created which has an entity column such as id which is given a primary key or cannot be the same as other data, there will also be a Kode_Book column with the data type varchar which has a capacity of holding up to 20 characters and can be left blank by entering a NULL code. Apart from that, there is also a book_title with data type Varchar with a capacity of 225 characters and cannot be empty with NOT NULL code. Lastly, there is a publish_date with data type DATE and can be left blank with a NULL code.
Contoh 2:
Alter TABLE Buku ADD Penulis Varchar(100);
Alter TABLE Buku Drop Column Judul_buku;
In the example above there are two command lines, each of which has a different function, in the first line there is the ALTER command which functions to change, in the first line it functions to change the table structure, where a new column will be created later. added with the name Author with data type VARCHAR with a capacity of 100 characters and will be added to the Books table.
Meanwhile, the second line is a command that is also used to change the table structure, but it is different from the first line which adds a column, the second line actually parses the column, which will be removed is the Book-Title column contained in a table called the Book table, the Hal command The main command used is the ALTER command, but the only difference is the use of ADD and DROP.
Contoh 3:
DROP TABLE Buku;
In the one-line SQL command example above, there is a command that functions to delete, where the main DROP command is used, which means delete, after the DROP command, it is followed by the TABLE command, which means that the object to be deleted is TABLE , followed by the name of the object clearly, namely books, so that the command reads Delete the Book Table.
2. DML (Bahasa Manipulasi Data)
DML is a set of commands used to manage databases such as creating new, adding, deleting and displaying, the main commands are UPDATE, DELETE, INSERT, SELECT. The UPDATE command is used when you want to update data, and the delete command is used when you want to delete data. Apart from that there is also the INSERT command which you can use to enter data into the database, and finally there is the SELECT command which is used to display data. that you have entered.
Contoh :
SELECT * FROM Buku;
UPDATE Buku SET Judul_buku = “Programmer” WHERE id = 1123;
INSERT INTO Buku (id,kode_buku,judul_buku,tanggal_terbit) values(1124, “KoD2?, “Desainer”, “2013-01-11?);
Then in the second line there is a command that uses the main code UPDATE Book which means it will change existing data in the book table, followed by SET Book_title = 'Programmer' which means existing data will be changed with the word 'Programmer'. then what to change? contained in the last code WHERE id='123?, the book title that will be changed to 'programmer' is the book title that has id 123.
Finally, there is a line of code that functions to add data, there is the INSERT INOT Buku function, which means that data will be inserted into the Book table followed by column names sequentially. Then followed by Values with the contents of the data in the order of the column names, finally closed with double quotes in each SQL command.
640
Tag:
Teknik Rahasia Cara Hacker Bekerja
Memahami Hacking & TujuannyaSebelum membahas teknik dan metode hacking, ada baiknya jika Anda mengetahui apa itu hacking.Hacking bukan soal cara menggunakan tools, tapi hacking lebih ke teknik menggunakan skill agar bisa menguasai/mengambil alih sebuah komputer/sistem. Disini saya akan meluruskan pengertian "HACKING" yang ada di benak dan pemikiran anda selama ini yang cenderung "kurang tepat". mencoba menjelaskan pengertian “hacking” yang sebenarnya dan memberikan cara memulai belajar h…
THR Apakah Wajib? Simak Penjelasanya
Aku sangat menantikannya, rasanya waktu menunggu THR selalu terasa lama dan membuatku deg-degan. Apalagi jika sudah memasuki bulan puasa menjelang lebaran, pasti sudah tidak sabar. Terkadang, seseorang sudah membuat rencana belanja dan liburan, namun THR belum juga dicairkan. Tak jarang juga, kita harus berpikir ulang untuk mengatur keuangan sambil menunggu THR. Tapi okelah, semua itu pasti terbayar ketika THR masuk ke rekening.Pengertian THRTunjangan Hari Raya atau yang biasa disebut THR merupa…
Prinsip Etika Dalam Berbisnis
Etika bisnis adalah cara menjalankan aktivitas bisnis, yang mencakup semua aspek yang berkaitan dengan individu, perusahaan, dan masyarakat. Etika bisnis dalam suatu perusahaan dapat membentuk nilai, norma dan perilaku karyawan dan pimpinan dalam membangun hubungan yang adil dan sehat dengan pelanggan/mitra kerja, pemegang saham, masyarakat. Perusahaan percaya bahwa prinsip bisnis yang baik adalah bisnis yang beretika. Yakni bisnis dengan kinerja unggul dan berkelanjutan yang dijalankan dengan b…
Inilah 10 Jenis Font Yang Paling Sering Digunakan Dalam Desain Grafis
Dalam dunia desain grafis, jenis font yang digunakan dapat secara langsung memengaruhi cara seseorang mempersepsikan apa yang ingin Anda sampaikan, baik itu pesan atau apa yang ingin Anda jual, seperti sebuah produk.Itulah mengapa sangat penting untuk memilih dengan hati-hati, tidak hanya jenis font, tetapi juga kombinasi dengan grafik dan gambar, serta warna, terutama jika akan digunakan untuk mempromosikan suatu merek. Memilih tipografi yang tepat sesuai dengan produk atau kampanye yang menjad…
Jenis-Jenis Jaringan Komputer
Komputer saat ini menjadi salah satu piranti elektronik yang tidak bisa dipisahkan dalam kehidupan sehari-hari kita, terutama dalam lingkungan pekerjaan, Hampir sebagian besar pekerjaan kantor pasti membutuhkan perangkat komputer untuk memudahkan pekerjaan yang tidak bisa dilakukan oleh manusia. Bagi kamu yang sudah terbiasa dengan bidang tersebut ataupun bekerja di lingkungan komputer jaringan pasti sudah tidak asing dengan jenis-jenis tersebut.1. LAN (Local Area Network)Jaringan LAN berfungsi …
3 Komponen Sistem Komputer: Hardware, Software, Dan Brainware
Komputer adalah perangkat elektronik yang biasa digunakan untuk mendukung berbagai aktivitas penggunanya, mulai dari mengerjakan pekerjaan kantor, tugas sekolah, hiburan, permainan, dan lain sebagainya.Kehadiran komputer di era modern saat ini mungkin sudah menjadi hal yang biasa. Namun, tahukah Anda bahwa sebenarnya ada tiga komponen utama sistem komputer, yaitu hardware, software, dan brainware. Masing-masing dari ketiga komponen sistem komputer tersebut memiliki peran yang berbeda, namun mamp…