modul4_201210370311313

7
LAPORAN PRAKTIKUM DESAIN DATABASE TERDISTRIBUSI MODUL 4 SQL Function Rahmat Basuki (201210370311313) B LABORATORIUM REKAYASA PERANGKAT LUNAK TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS MUHAMMADIYAH MALANG

description

Informatika, SQL, Tutorial SQL

Transcript of modul4_201210370311313

  • LAPORAN PRAKTIKUM DESAIN DATABASE

    TERDISTRIBUSI

    MODUL 4

    SQL Function

    Rahmat Basuki (201210370311313) B

    LABORATORIUM REKAYASA PERANGKAT LUNAK

    TEKNIK INFORMATIKA FAKULTAS TEKNIK

    UNIVERSITAS MUHAMMADIYAH MALANG

  • 2015

  • Laporan Praktikum 4

    1. SQL Functions SQL Aggregate Functions SQL aggregate functions mengembalikan nilai tunggal, menghitung nilai dalam suatu kolom. Kegunaan aggregate functions:

    AVG() - Returns the average value

    COUNT() - Returns the number of rows

    FIRST() - Returns the first value

    LAST() - Returns the last value

    MAX() - Returns the largest value

    MIN() - Returns the smallest value

    SUM() - Returns the sum SQL Scalar functions SQL scalar functions return a single value, based on the input value. Useful scalar functions:

    UCASE() - Converts a field to upper case

    LCASE() - Converts a field to lower case

    MID() - Extract characters from a text field

    LEN() - Returns the length of a text field

    ROUND() - Rounds a numeric field to the number of decimals specified

    NOW() - Returns the current system date and time

    FORMAT() - Formats how a field is to be displayed

    2. SQL AVG()

    Mencari rata-rata karyawan pada departemen finance

    Menghitung rata-rata karyawan dari tanggal 1986-06-26

  • 3. SQL COUNT()

    Menghitung banyaknya data pada tabel employees

    Menghitung banyaknya data employees pada tabel salaries

    Menghitung Jumlah data yang diawali first_name=parto

    4. SQL FIRST()

    5. SQL LAST()

    6. SQL MAX()

  • 7. SQL MIN()

    8. SQL SUM()

    9. SQL GROUP BY

    10. SQL HAVING

  • 11. SQL UCASE() & SQL LCASE()

    12. SQL MID()

    13. SQL LEN()

    14. SQL ROUND()

  • 15. SQL NOW()

    16. SQL FORMAT()