pratikum databases IT(http://127.0.0.2/phpmyadmin/index.php?db=saiful&token=f58184557f729a77196fd164a20921e3) ~ Ivul varel

pratikum databases IT(http://127.0.0.2/phpmyadmin/index.php?db=saiful&token=f58184557f729a77196fd164a20921e3)

| novi               |
| oraktikum2         |
| percobaan          |
| performance_schema |
| phpmyadmin         |
| prak               |
| praktikum          |
| saiful             |
| test               |
| webauth            |
+--------------------+
16 rows in set (0.00 sec)

mysql> use saiful;
Database changed
mysql> show tables;
+------------------+
| Tables_in_saiful |
+------------------+
| fatherchild      |
| mahasiswa        |
| matakuliah       |
| motherchild      |
| person           |
| peserta          |
+------------------+
6 rows in set (0.03 sec)

mysql> select *from mahasiswa;
+------+---------+---------------+------------+---------+
| nim  | nama    | jenis_kelamin | alamat     | jurusan |
+------+---------+---------------+------------+---------+
| 1000 | Andri   | L             | Geuceu     | TI      |
| 1001 | Kurnia  | L             | Prada      | SI      |
| 1002 | Marni   | P             | Darussalam | SI      |
| 1003 | Heru    | L             | Tungkop    | SI      |
| 1004 | Susanti | P             | Lingke     | TI      |
| 1005 | Mei mei | P             | Lingke     | SI      |
| 1006 | Ismail  | L             | Lampineung | MI      |
| 1007 | Upin    | L             | TV         | MI      |
+------+---------+---------------+------------+---------+
8 rows in set (0.00 sec)

mysql> select nama,alamat from mahasiswa
    -> ;
+---------+------------+
| nama    | alamat     |
+---------+------------+
| Andri   | Geuceu     |
| Kurnia  | Prada      |
| Marni   | Darussalam |
| Heru    | Tungkop    |
| Susanti | Lingke     |
| Mei mei | Lingke     |
| Ismail  | Lampineung |
| Upin    | TV         |
+---------+------------+
8 rows in set (0.00 sec)

mysql> select nama,alamat from mahasiswa where alamat=lingke;
ERROR 1054 (42S22): Unknown column 'lingke' in 'where clause'
mysql> select nama,alamat from mahasiswa where alamat='lingke'
    -> ;
+---------+--------+
| nama    | alamat |
+---------+--------+
| Susanti | Lingke |
| Mei mei | Lingke |
+---------+--------+
2 rows in set (0.00 sec)

mysql> select nama,alamat jurusan from mahasiswa where jenis_kelamin='p' group b
y jurusan;
+---------+------------+
| nama    | jurusan    |
+---------+------------+
| Marni   | Darussalam |
| Susanti | Lingke     |
+---------+------------+
2 rows in set, 1 warning (0.00 sec)

mysql> select nama,count(jurusan)from mahasiswa group by jurusan;
+--------+----------------+
| nama   | count(jurusan) |
+--------+----------------+
| Ismail |              2 |
| Kurnia |              4 |
| Andri  |              2 |
+--------+----------------+
3 rows in set (0.00 sec)

mysql> select nama,jenis_kelamin,count from mahasiswa group by jurusan;
ERROR 1054 (42S22): Unknown column 'count' in 'field list'
mysql> select nama,jenis_kelamin, from mahasiswa group by jurusan;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'from
mahasiswa group by jurusan' at line 1
mysql> select nama,jenis_kelamin from mahasiswa group by jurusan;
+--------+---------------+
| nama   | jenis_kelamin |
+--------+---------------+
| Ismail | L             |
| Kurnia | L             |
| Andri  | L             |
+--------+---------------+
3 rows in set (0.00 sec)

mysql> select *from matakuliah;
+---------+------------+------+----------+
| kode_mk | nama_mk    | sks  | semester |
+---------+------------+------+----------+
| INF00   | Peng. TIK  |    2 |        1 |
| INF02   | Basis Data |    2 |        2 |
| INF03   | Pemr. OO   |    3 |        3 |
| INF10   | Algoritma  |    3 |        2 |
+---------+------------+------+----------+
4 rows in set (0.00 sec)

mysql> select nama_mk from matakuliah where  semester='2';
+------------+
| nama_mk    |
+------------+
| Basis Data |
| Algoritma  |
+------------+
2 rows in set (0.00 sec)

mysql> select *from peserta;
+------+----------+-------+
| nimp | kode_mkp | nilai |
+------+----------+-------+
| 1000 | INF00    |    90 |
| 1001 | INF10    |    70 |
| 1001 | INF02    |    90 |
| 1002 | INF02    |    85 |
| 1002 | INF00    |    80 |
| 1003 | INF03    |    70 |
| 1003 | INF00    |    90 |
| 1004 | INF03    |    90 |
| 1005 | INF10    |   100 |
| 1005 | INF02    |    90 |
| 1006 | INF00    |    70 |
+------+----------+-------+
11 rows in set (0.00 sec)

mysql> select nimp inf02 from peserta;
+-------+
| inf02 |
+-------+
|  1000 |
|  1001 |
|  1001 |
|  1002 |
|  1002 |
|  1003 |
|  1003 |
|  1004 |
|  1005 |
|  1005 |
|  1006 |
+-------+
11 rows in set (0.00 sec)

mysql> select nimp from peserta where kode_mkp='inf02';
+------+
| nimp |
+------+
| 1001 |
| 1002 |
| 1005 |
+------+
3 rows in set (0.00 sec)

mysql> select nim\p * from peserta where nilai>80;
--------------
select nim
--------------

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'from
peserta where nilai>80' at line 1
mysql> select nimp * from peserta where nilai>80;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'from
peserta where nilai>80' at line 1
mysql> select * from peserta where nilai>80;
+------+----------+-------+
| nimp | kode_mkp | nilai |
+------+----------+-------+
| 1000 | INF00    |    90 |
| 1001 | INF02    |    90 |
| 1002 | INF02    |    85 |
| 1003 | INF00    |    90 |
| 1004 | INF03    |    90 |
| 1005 | INF10    |   100 |
| 1005 | INF02    |    90 |
+------+----------+-------+
7 rows in set (0.02 sec)

mysql> select * from where kode_mkp='inf02 and nilai>80;
    '>
    '> select *from where kode_mkp='inf02 and nilai>80;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 kode_mkp='inf02 and nilai>80;

select *from where kode_mkp='inf02 and nila' at line 1
mysql> select *from peserta where kode_mkp='inf02 and nilai>80;
    '> select *from peserta where kode_mkp='inf02 and nilai> 80;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'inf02
 and nilai> 80' at line 1
mysql> select kode_mkp,count
    ->
    ->
    ->
    -> sq
    ->
    -> select kode_mkp,count
    ->
    -> select *from peserta where kode_mkp='inf02 and nilai>80;
    '> /c
    '> ;
    '> ;
    '> cd
    '> cd mysql
    '> =\
    '> ^A
    '> Bye
Ctrl-C -- exit!

C:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 68
Server version: 5.5.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use saiful;
Database changed
mysql> show tables;
+------------------+
| Tables_in_saiful |
+------------------+
| fatherchild      |
| mahasiswa        |
| matakuliah       |
| motherchild      |
| person           |
| peserta          |
+------------------+
6 rows in set (0.00 sec)

mysql> select *from peserta where kode_mkp='inf02 and nilai>80;
    '> select *from peserta;
    '> Bye
Ctrl-C -- exit!

C:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 69
Server version: 5.5.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use saiful;
Database changed
mysql> select *from peserta;
+------+----------+-------+
| nimp | kode_mkp | nilai |
+------+----------+-------+
| 1000 | INF00    |    90 |
| 1001 | INF10    |    70 |
| 1001 | INF02    |    90 |
| 1002 | INF02    |    85 |
| 1002 | INF00    |    80 |
| 1003 | INF03    |    70 |
| 1003 | INF00    |    90 |
| 1004 | INF03    |    90 |
| 1005 | INF10    |   100 |
| 1005 | INF02    |    90 |
| 1006 | INF00    |    70 |
+------+----------+-------+
11 rows in set (0.00 sec)

mysql>
Previous
Next Post »
Post a Comment
Thanks for your comment