You are on page 1of 17

A.

PENDAHULUAN Pada praktikum ini akan membahas tentang membuat database,

membuat,tabel, membuat isi tabel, dengan menggunaka software MySQL. MySQL merupakan MySQL adalah sebuah perangkat lunak sistem manajemen basis data SQL (bahasa Inggris: database management system) atau DBMS yang multithread, multi-user, dengan sekitar 6 juta instalasi di seluruh dunia. MySQL AB membuat MySQL tersedia sebagai perangkat lunak gratis dibawah lisensi GNU General Public License (GPL), tetapi mereka juga menjual dibawah lisensi komersial untuk kasus-kasus dimana penggunaannya tidak cocok dengan penggunaan GPL.

B. MAKSUD DAN TUJUAN Adapun maksud dan tujuan dari praktikum ini adalah : 1. Mahasiswa dapat membuat database dengan menggunakan MySQL 2. Mahasiswa dapat membuat table dalam MySQL 3. Mahasiswa dapat mengisi data table yang telah di buat

C. ALAT DAN BAHAN Adapun alat dan bahan yang digunakan pada praktikum ini adalah : 1. PC (Personal Computer)/Laptop 2. Software MySQL

D. DASAR TEORI Menurut Sidik , (MySQL dikembangkan oleh sebuah perusahaan Swedia bernama MySQL AB, yang pada saat itu bernama TcX Data Konsult AB sekitar tahun 1994-1995. MYSQL sudah ada sejak 1979. MySQL termasuk jenis RDBMS (Relational Database Management System). MYSQL digunakan oleh banyak portal-portal internet sebagai basis data dari informasi yang ditampilkan pada situs web. Kepopuleran MYSQL dimungkinkan karena kemudahannya untuk digunakan, cepat secara kinerja query, dan mencukupi untuk kebutuhan basis data perusahaan-perusahaan skala menengah dan kecil. Istilah seperti tabel, baris, dan kolom tetap digunakan dalam MySQL. Sebuah basis data yang terdapat pada MYSQL mengandung satu atau beberapa tabel yang terdiri dari sejumlah baris dan kolom.

MySQL adalah suatu perangkat lunak database relasi (Relational Database Management System atau RDBMS), seperti halnya ORACLE, Postgresql, MS SQL, dan sebagainya. MySQL AB menyebut produknya sebagai database open source terpopuler di dunia. Berdasarkan riset dinyatakan bahwa bahwa di platform Web, dan baik untuk kategori open source maupun umum, MySQL adalah database yang paling banyak dipakai. Menurut perusahaan pengembangnya, MySQL telah terpasang di sekitar 3 juta komputer. Puluhan hingga ratusan ribu situs mengandalkan MySQL bekerja siang malam memompa data bagi para pengunjungnya. Tidak sama dengan proyek-proyek seperti Apache, dimana perangkat lunak dikembangkan oleh komunitas umum, dan hak cipta untuk kode sumber dimiliki oleh penulisnya masing-masing, MySQL dimiliki dan disponsori oleh sebuah perusahaan komersial Swedia MySQL AB, dimana memegang hak cipta hampir atas semua kode sumbernya. Kedua orang Swedia dan satu orang Finlandia yang mendirikan MySQL AB adalah: David Axmark, Allan Larsson, dan Michael "Monty" Widenius. MySQL tersedia untuk beberapa platform, di antara nya adalah untuk versi windows dan versi linux. Untuk melakukan administrasi secara lebih mudah terhadap Mysql,anda dapat menggunakan software tertentu, di antara nya adalah phpmyadmin dan mysql yog. Pada kesempatan kali ini, kita akan menggunakan phpmyadmin, yang terdapat dalam bundle xampp, beberapa keunggulan Mysql : Free (bebas di download) Stabil dan tangguh Fleksibel dengan berbagai pemrograman Security yang baik Dukungan dari banyak komunitas Kemudahan management database Kemudahan transaksi Perkembangan software yang cukup cepat

Tipe data yang didukung dalam MySQL adalah : 1. Tipe data untuk bilangan No Tipe Data 1. TINYINT Keterangan Ukuran 1 byte. Bilangan bulat terkecil, dengan jangkauan untuk bilangan bertanda -128 sampai dengan 127 dan untuk yang tidak bertanda 0 sampai dengan 255. Bilangan tak bertanda ditandai dengan kata UNSIGNED SMALLINT Ukuran 2 byte. Bilangan bulat dengan jangkauan untuk bilangan bertanda -32768 sampai dengan 32767 dan untuk yang tidak bertanda 0 sampai dengan 65535 MEDIUMINT Ukuran 3 byte. Bilangan bulat dengan jangkauan untuk bilangan bertanda -8388608 sampai dengan 8388607 dan untuk yang tidak bertanda 0 sampai dengan 16777215 INT Ukuran 4 byte. Bilangan bulat dengan jangkauan untuk bilangan bertanda -2147483648 sampai dengan 2147483647 dan untuk yang tidak bertanda 0 sampai dengan 4294967295 INTEGER Sama dengan INT. BIGINT Ukuran 8 byte. Bilangan bulat dengan jangkauan untuk bilangan bertanda -9223372036854775808 sampai dengan 9223372036854775807 dan untuk yang tidak bertanda 0 sampai dengan 184467440737079551615 FLOAT Ukuran 4 byte. Biilangan pecahan. DOUBLE Ukuran 8 byte. Bilangan pecahan. DOUBLE Ukuran 8 byte. Bilangan pecahan berpresisi PRECISION ganda. REAL Ukuran 8 byte. Sinonim dari DOUBLE. DECIMAL(M,D) Ukuran M byte. Bilangan pecahan. Misalnya DECIMAL(5,2) dapat digunakan untuk menyimpan bilangan 99,99 sampai dengan 99,99 NUMERIC(M,D) Ukuran M byte. Sama dengan Decimal.

2.

3.

4.

5. 6.

7. 8. 9. 10. 11.

12.

2. Tipe data untuk tanggal dan jam No Tipe Data 1. DATETIME Keterangan Ukuran 8 byte. Kombinasi tanggal dan jam dengan jangkauan dari 1000-01-01 00:00:00 sampai dengan 9999-12-31 23:59:59 Ukuran 8 byte. Kombinasi tanggal dan jam dengan jangkauan dari 1000-01-01 sampai dengan 9999-12-31 Ukuran 4 byte. Kombinasi tanggal dan jam dengan jangkauan dari 1970-01-01 sampai dengan 2037 Ukuran 3 byte.waktu dengan jangkauan dari -838:59:59 sampai dengan 838:59:59 Ukuran 1 byte. Data tahun antara 1901 sampai dengan 2155

2. DATE

3. TIMESTAMP 4. TIME 5. YEAR

3. Tipe data untuk karakter dan lain-lain No Tipe Data 1. CHAR(M) Keterangan

2.

3.

4.

5.

6.

7. 8.

Ukuran M byte, 1<=M<=255. Data string dengan panjang yang tetap. CHAR(1) cukup ditulis dengan CHAR. VARCHAR(M) Ukuran L+1 byte dengan L<=M dan 1<=M<=255. Data string dengan panjang bervariasi tergantung datanya. TINYBLOB, L+1 byte, dengan L<28 . Tipe TEXT atau BLOB dengan panjang maksimum 255 karakter. TINYTEXT BLOB, TEXT L+2 byte, dengan L<216 . Tipe TEXT atau BLOB dengan panjang maksimum 65535 karakter. MEDIUMBLOB, L+3 byte, dengan L<224. Tipe MEDIUMTEXT TEXT atau BLOB dengan panjang maksimum 1677215 karakter. LONGBLOB, L+4 byte, dengan L<232. Tipe LONGTEXT TEXT atau BLOB dengan panjang maksimum 4294967295 karakter. ENUM(nilai1,nilai2,..) Ukuran 1 atau 2 byte tergantungnilai enumerasinya maks 65535 nilai SET(nilai1,nilai2,..) Ukuran 1,2,3,4 atau 8 byte tergantung jumlah anggota himpunan maks 64 anggota.

E. LANGKAH KERJA 1. Pastikan Program MySQL sudah terinstall pada Komputer atau laptop anda 2. Buka Program MySQL tersebut dengan cara Klik Start All Program MySQL MySQL Server MySQL Command Line Chart seperti yang diperlihatkan pada gambar berikut :

3. Maka akan muncul tampilan seperti berikut :

4. Ketikkan password yang anda masukkan pada saat anda menginstall Program MySQL di PC atau lapto anda kemudian tekan enter , adapun password yang saya masukkan yaitu root sehingga akan muncul tampilan seperti berikut :

5. Selanjutnya membuat database dengan nama mahasiswa, sebelum membuat table dan berbagai operasiyang terkait dengan table, terlebih dahulu kita harus membuat database. Adapun perintah yang digunakan untuk membuat database dengan nama databasenya adalah mahasiswa yaitu : kode Perintah : Create database [Nama Database]; adalah perintah yang digunakan untuk membuat database. jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah Maka : Create database mahasiswa; Output :

Apabila ada informasi seperti berikut : Query OK,1 row affected(0.08 sec) maka hal itu berarti database telah sukses tercipta. 6. Menampilkan database yang telah di buat. Kode perintah : Show database; database. jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah

Output:

7. Selanjutnya adalah membuat table mahasiswa ke dalam database mahasiswa yang telah dibuat tadi. Caranya adalah kita harus memilih database yang telah kita buat terlebih dahulu dengan perintah Use_nama database; database. jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah Output :

8. Selanjutnya adalah membuat tabel, kita akan membuat tabel dengan nama : tabel_mahasiswa. Perintahnya adalah : Create table_nama_tabel (nama_tipe_data (panjang_karakter),.); database. jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah

Output :

9. Selanjutnya melihat Struktur tabel mahasiswa Perintahnya adalah : Desc_nama_tabel; database. jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah

Output :

10. Selanjutnya adalah memasukkan data ke dalam tabel yang telah kita buat. Untuk memasukkan data ke dalam tabel yang telah kita buat tersebut, perintahnya adalah : insert into nama_table (field_1,field_2,) values ('data_field_1','data_field_2',...); jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah Output :

Jika muncul informasi berupa : Query Ok, 1 row affected(0.05 sec) maka hal tersebut berarti bahwa data yang kita input telah sukses terinput di dalam tabel

11. Selanjutnya untuk melihat isi tabel, perintahny adalah : Select * from nama_tabel jangan lupa untuk memberikan tanda ; (titik koma) di akhir perintah

Outputnya :

F. ANALISIS Analisis keberhasilan dalam praktikum ini adalah : 1. Database berhasil dibuat :

2. Tabel berhasil dibuat :

3. Tabel dapat di isi :

G. KESIMPULAN Dalam menggunakan software MySQL, setiap syntax harus diperhatikan sebab jika salah memasukkan perintah maka akan terjadi error. Olehnya itu diperlukan tingkat ketelitian yang tinggi dan kesabaran dalam mengaplikasikan software ini.

H. DAFTAR PUSTAKA
http://lealy.wordpress.com/2009/10/21/pengertian-mysql/ http://linuxindo.web.id/2008/05/02/berkenalan-dengan-mysql/ http://serba-serbi-web.blogspot.com/2008/05/perintah-perintah-mysql-melalui-command.html

A. INTRODUCTION In this lab will discuss about creating a database, create tables, create a table of contents, to make use of the MySQL software. MySQL is MySQL is a software SQL database management system (English: database management system) or DBMS multithreaded, multi-user, with about 6 million installations worldwide. MySQL AB makes MySQL available as free software under the GNU General Public License (GPL), but they are also sold under a commercial license for those cases where its use is not compatible with the GPL.

B. PURPOSE AND OBJECTIVES The purpose and objectives of this lab are: 1. Students can create a database using MySQL 2. Students can create a table in MySQL 3. Students can fill in the data table that's been made

C. EQUIPMENT AND MATERIALS The tools and materials used in this lab are: 1. PC (Personal Computer) / Laptop 2. MySQL Software

D. BASIC THEORY According Sidik, (MySQL was developed by a Swedish company called MySQL AB, which at the time was called TcX Data Konsult AB circa 1994-1995. MYSQL has been around since 1979. MySQL including the type of RDBMS (Relational Database Management System). MYSQL is used by many internet portals as the database of the information displayed on the website. Popularity MYSQL possible because of its simplicity to use, for fast query performance, and insufficient for the needs of database companies of medium and small scale. terms such as tables, rows, and columns still be used in MySQL. A database contained on MYSQL contains one or more tables consisting of a number of rows and columns.

MySQL is a relationship database software (Relational Database Management System or RDBMS), like Oracle, PostgreSQL, MS SQL, and so on. MySQL AB refer to the product as the most popular open source database in the world. Based on the research stated that the Web platform, and is good for the general category and the open source, MySQL is the most widely used database. According to the company developer, MySQL has been installed in about 3 million computers. Tens to hundreds

of thousands of websites rely on MySQL works day and night to pump the data for the visitors. Not the same with projects like Apache, where the software was developed by the general community, and the rights to the source code are owned by their respective authors, MySQL is owned and sponsored by a Swedish commercial company MySQL AB, which holds the copyright to all the code almost the source. Both the Swedes and the Finns who founded MySQL AB are: David Axmark, Allan Larsson and Michael "Monty" Widenius. MySQL is available for multiple platforms, among them are for windows version and linux version. To perform administration easier for MySQL, you can use certain software, among them is phpmyadmin and mysql yog. On this occasion, we will use phpmyadmin, xampp contained in the bundle, Mysql several advantages: Free (free download) Stable and robust Flexible with various programming Security is good Support of many communities Ease of management database Ease of transaction The development of software are fast enough

Data types are supported in MySQL: 1. Data types for numbers No. Data Type Specification 1. TINYINT 1 byte size. Smallest integer, the range for the number labeled -128 to 127 and to which is not marked from 0 to 255. Numbers marked unmarked UNSIGNED words 2. SMALLINT size of 2 bytes. Integers with range for numbers up to 32 767 -32 768 marked and for the not marked from 0 to 65 535 3. MEDIUMINT Size 3 bytes. Integers with

range for number marked -8388608 to 8388607 and to which is not marked from 0 to 16,777,215 4. INT size of 4 bytes. Integers with range for number marked -2147483648 to 2147483647 and for that is not marked from 0 to 4294967295 5. Same as INTEGER INT. 6. BIGINT size of 8 bytes. Integers with range for number marked -9223372036854775808 to 9223372036854775807 and for which no marked 0 through 184467440737079551615 7. FLOAT size of 4 bytes. Biilangan fractions. 8. DOUBLE Size 8 bytes. Fractions. 9. DOUBLE PRECISION size of 8 bytes. Fractions precision double. 10. REAL size of 8 bytes. Synonym of DOUBLE. 11. DECIMAL (M, D) Size M bytes. Fractions. For example DECIMAL (5,2) can be used to store numbers up to -99.99 99.99 12. NUMERIC (M, D) Size M bytes. Same with Decimal.

2. Data types for date and time No Type Data Specification 1. DATETIME size of 8 bytes. The combination of date and time with a range from '1000-01-01 00:00:00 'to '9999-12-31 23:59:59 ' 2. DATE size of 8 bytes. The combination of date and time with a range from '1000-01-01 'to '9999-12-31' 3. TIMESTAMP size of 4 bytes. The combination of date and time with a range from '1970-01-01 'to '2037' 4. TIME Size 3 byte.waktu with a range of

-838:59:59 Up to 838:59:59 5. YEAR 1 byte size. Data from the 1901 to by 2155 3. Data types for characters and other No Type Data Specification 1. CHAR (M) Size M byte, 1 <= M <= 255. Data string with a fixed length. CHAR (1) is written with CHAR. 2. VARCHAR (M) Size L +1 bytes with L <= M and 1 <= M <= 255. Data string of length varies depending on the data. 3. TINYBLOB, TINYTEXT L +1 bytes, with L <28. Type TEXT or BLOB with a maximum length of 255 characters. 4. BLOB, TEXT L +2 bytes, with L <216. Type TEXT or BLOB with a maximum length of 65,535 characters. 5. MEDIUMBLOB, MEDIUMTEXT L +3 bytes, with L <224. Type TEXT or BLOB with a maximum length 1677215 characters. 6. LONGBLOB, LONGTEXT L +4 bytes, with L <232. Type TEXT or BLOB with a maximum length of 4294967295 characters. 7. ENUM ('value1', 'value2', ..) Size 1 or 2 bytes tergantungnilai max 65 535 enumeration value 8. SET ('value1', 'value2', ..) Size 1,2,3,4 or 8 bytes depending on the number of member of the set max 64 members.

E. STEP WORK 1. Make sure the MySQL program installed on your computer or laptop 2. Open MySQL MySQL All Programs the MySQL program in a manner to Start MySQL Command Line Chart as shown in the following figure:Server

3. The display will appear as follows:

4. Type the password that you enter when you install MySQL program in your PC or your lapto then press enter, while I enter the password "root" so it would appear as follows:

5. Furthermore, to create a database with the names of students, before making table and various related operasiyang table, we must first create a database. The commands used to create a database with the name of the database is a student that is: Command code:

Then: Create database students; Output:

If there is information such as the following: Query OK, 1 row affected (0.08 sec) then it means that the database has been successfully created. 6. Featuring a database that has been created. Command code:

Output:

7. Next is to create a student table into the student database that was created earlier. The trick is that we have to choose a database that was created first with the command

Output:

8. Next is to create a table, we will create a table named: tabel_mahasiswa. The syntax is:

Output:

9. Furthermore, look at the student table structure The syntax is:

Output:

10. Next is to enter data into a table that has been created. To enter data into a table that has been created, the command is:

Output:

If the information appears as follows: Query OK, 1 row affected (0.05 sec) then it means that the input data that we have been successful in the table terinput

11. Furthermore, to see the contents of the table, perintahny are:

The output:

F. ANALYSIS Analysis of efficacy in this lab are: 1. Database successfully created:

2. Table successfully created:

3. The table can be filled:

G. CONCLUSION In using the MySQL software, each syntax must be considered because if you enter the command error will occur. By him that required a high level of accuracy and patience in applying software.

H. REFERENCES

http://lealy.wordpress.com/2009/10/21/pengertian-mysql/ http://linuxindo.web.id/2008/05/02/berkenalan-dengan-mysql/ http://serba-serbi-web.blogspot.com/2008/05/perintah-perintah-mysql-melalui-command.html

You might also like