Skip to main content

DDL dalam database

Data Definition Language(DDL)
DDL digunakan untuk membangun struktur.
Adapun hal-hal yang dikerjakan dalam DDL :
* Membuat Database
* Memilih/Menggunakan Database
* Membuat Table
* Melihat Struktur Table
* Menambah Field Table
* Memperbaiki Field Table
* Menghapus Field Table
* Mengganti Nama Table
* Menghapus Table
NB: Sebelum
membuka mysql terlebih dahulu    aktifkan server
c:\>Document and setting\satelite>
c:\>cd apache
c:\>apache>cd mysql
c:\>apache\mysql>cd bin
c:\>apache\mysql\bin>mysql

* Melihat database yang ada pada mysql
  mysql>show databases;

* Membuat Database
  sintax : create database Nama Database;
  mysql>create database DBMIP1301;

* Memilih/Menggunakan Database
  sintax : use Nama Database;
  mysql>use DBMIP1301;

* Membuat Table
  sintax : create table Nama Table
          (Field1 Tipe Data(Length),
       Field2 Tipe Data(Length),
       FieldN Tipe Data(Length));
  mysql>create table Barang
    (KodeBrg varchar(10),TL/001001-M/
    NamaBrg char(20));

* Melihat Struktur Table
  sintax : describe nama Table;
  mysql>describe Barang;

* Menambah Field Table
  sintax : alter table nama table
           add Field Tipe Data(Length);
  Dalam menambah field ada ketentuan :
  1. After
  2. First
  mysql>alter table barang add
    HargaBrg int(8);
  No
  KodeBrg
  NamaBrg
  Tipe
  HargaBrg
  Stok
  mysql>alter table barang add
    Tipe char(20) after NamaBrg;

  mysql>alter table barang add
      No int(8) first,
    add Stok int(8);
       
* Memperbaiki Field Table
  sintax : alter table Nama Table
           change Field Awal Field Baru
        Tipe Data(Length);
  mysql>alter table barang change
    KodeBrg KdBarang varchar(20);

* Menghapus Field Table
  sintax : alter table Nama table
       drop field yang akan dihapus;
  mysql>alter table barang drop No,
    drop Tipe;



* Mengganti Nama Table
  sintax : alter table Nama table awal
       rename Nama table Baru;
  mysql>alter table barang rename Barangku;
  mysql>show tables;

* Menghapus Table
  sintax : drop table Nama Table;
  mysql>drop table barangku;





Comments

Popular posts from this blog

Disclaimer

Disclaimer for Daniel Fernando If you require any more information or have any questions about our site's disclaimer, please feel free to contact us by email at Danielbadung73@gmail.com Disclaimers for Daniel Fernando All the information on this website - www.nandoe73.blogspot.com - is published in good faith and for general information purpose only. Daniel Fernando does not make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this website (Daniel Fernando), is strictly at your own risk. Daniel Fernando will not be liable for any losses and/or damages in connection with the use of our website. Our Disclaimer was generated with the help of the Disclaimer Generator and the Privacy Policy Generator . From our website, you can visit other websites by following hyperlinks to such external sites. While we strive to provide only quality links to useful and ethical websites, we have no contro...

Privacy Policy

Privacy Policy for Daniel Fernando At Daniel Fernando, accessible from http://nandoe73.blogspot.com, one of our main priorities is the privacy of our visitors. This Privacy Policy document contains types of information that is collected and recorded by Daniel Fernando and how we use it. If you have additional questions or require more information about our Privacy Policy, do not hesitate to contact us. Log Files Daniel Fernando follows a standard procedure of using log files. These files log visitors when they visit websites. All hosting companies do this and a part of hosting services' analytics. The information collected by log files include internet protocol (IP) addresses, browser type, Internet Service Provider (ISP), date and time stamp, referring/exit pages, and possibly the number of clicks. These are not linked to any information that is personally identifiable. The purpose of the information is for analyzing trends, administering the site, tracking users' move...

Sistem Informasi Pengiriman Kayu Menggunakan VB Net

Malam agan - agan semua.... sudah lama admin tidak posting, maklum lah lagi sibuk nyusun tugas akhir :D hari ini admin mau share gimana caraya membuat Sistem Informasi pengiriman Barang menggunakan VB Net, sebekumnya admin sudah posting membuat module koneksi di vb net 2008,  ini adalah lanjutan dari module sebelumnya, oh ia admin disini menggunakan database mysql. ok saat nya dimulai pertama rancang sebuah form seperti gambar dibawah ini : form diiatas terdiri dari : lima buah button tujuh buah textbox   satu buah listview  nama dari masing - masing komponen tersebut bisa anda sesuaikan dari koding dibawah ini : Imports MySql.Data.MySqlClient Public Class DataKayu     Sub Bersih()         BersihForm(Me)         Kunci(Me)         Simpan.ImageKey = "Simpan.Ico"         RubahTombol(0...