This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\xampp\mysql\bin>mysql -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 3 | |
Server version: 5.5.36 MySQL Community Server (GPL) | |
Copyright (c) 2000, 2014, 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- tabel master barang | |
create table items ( | |
id int auto_increment not null, | |
code varchar(50) not null, | |
name varchar(200) not null, | |
primary key (id), | |
constraint ak_items unique key (code) | |
); | |
-- tabel transaksi barang masuk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> use test ; | |
Database changed | |
mysql> -- -------------------------------------- | |
mysql> -- create table contoh | |
mysql> -- -------------------------------------- | |
mysql> create table garansi ( | |
-> id int auto_increment primary key, | |
-> awal_garansi date null, | |
-> akhir_garansi date null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D:\xampp\mysql\bin>mysql -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D:\xampp\mysql\bin>mysql -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ---------------------------- | |
-- Table structure for member | |
-- ---------------------------- | |
DROP TABLE IF EXISTS "public"."member"; | |
CREATE TABLE "public"."member" ( | |
"id" int4 NOT NULL, | |
"no_urut" int4, | |
"parent_id" int4, | |
"name" varchar(255) COLLATE "pg_catalog"."default" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Microsoft Windows [Version 6.1.7601] | |
Copyright (c) 2009 Microsoft Corporation. All rights reserved. | |
D:\xampp\mysql\bin>mysql -u root | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 1 | |
Server version: 5.5.16 MySQL Community Server (GPL) | |
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table students ( | |
id serial primary key, | |
code varchar(20) not null, | |
name varchar(200) not null | |
); | |
create table courses ( | |
id serial primary key, | |
code varchar(20) not null, | |
name varchar(200) not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- master table | |
create table transactions ( | |
id serial primary key, | |
code varchar(60) not null unique, | |
date integer not null, | |
value decimal(15,2) default 0, | |
remarks text | |
); | |
-- details table without generated column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> use test; | |
Database changed | |
mysql> --------------------------------- | |
mysql> -- buat table dan sample datanya | |
mysql> --------------------------------- | |
mysql> create table tbl_data as | |
-> select '1' ID ,'001' NOPEL, 'INQUIRY' KATEGORI union all | |
-> select '2' ID ,'002' NOPEL, 'COMPLAINT' KATEGORI union all | |
-> select '3' ID ,'003' NOPEL, 'REQUEST' KATEGORI union all |
NewerOlder