0% found this document useful (0 votes)
41 views

Petunjuk Soal: 1. Buat Folder: Apbs - Nobp - Nama - Kelas: 1. Buatlah Script Dan Proses Inquiry Seperti Berikut

1. Create tables for customers, products, and transactions with the appropriate fields. 2. Populate the customer, product, and transaction tables with sample data by running INSERT statements. 3. The document provides the SQL scripts to create 3 tables (customer, product, transaction) and populate them with data.

Uploaded by

bayoe11
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Petunjuk Soal: 1. Buat Folder: Apbs - Nobp - Nama - Kelas: 1. Buatlah Script Dan Proses Inquiry Seperti Berikut

1. Create tables for customers, products, and transactions with the appropriate fields. 2. Populate the customer, product, and transaction tables with sample data by running INSERT statements. 3. The document provides the SQL scripts to create 3 tables (customer, product, transaction) and populate them with data.

Uploaded by

bayoe11
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Petunjuk Soal :

1. Buat folder : APBS_NoBp_Nama_Kelas


1. Buatlah script dan proses inquiry seperti berikut :

2. Buatlah script dan proses inquiry seperti berikut :

3. Buatlah script dan proses inquiry seperti berikut :

Table customer
CREATE TABLE customer (
KdCust varchar(10) NOT NULL default '',
NmCust varchar(50) NOT NULL default '',
AlmCust varchar(45) NOT NULL default '',
Telp varchar(15) NOT NULL default '',
Hp varchar(16) NOT NULL default '',
email varchar(35) NOT NULL default '',
PRIMARY KEY (KdCust),
KEY NmCust (NmCust)
) TYPE=MyISAM;

Dumping data for table costumer


INSERT INTO CUSTOMER VALUES ('C-001', 'Andi', 'Jl. Lubuk Begalung',
'0751-7980235', '081374557800', '[email protected]');
INSERT INTO CUSTOMER VALUES ('C-002', 'Budi', 'Jl.Sudirman 40', '07517980235', '081374557800', '[email protected]');
INSERT INTO CUSTOMER VALUES ('C-003', 'Asyifa', 'Jl. Ujung Tanah',
'0751-7980235', '081374557800', '[email protected]');
INSERT INTO CUSTOMER VALUES ('C-004', 'Agung', 'Jl.Sudirman 01', '07517980235', '081374557800', '[email protected]');

Table Barang
CREATE TABLE barang (
KdBrg varchar(10) NOT NULL default '',
NmBrg varchar(45) NOT NULL default '',
Satuan varchar(15) NOT NULL default '',
StockBrg int(11) NOT NULL default '0',
HrgBrg double NOT NULL default '0',
PRIMARY KEY (KdBrg),
KEY NmBrg (NmBrg)
) TYPE=MyISAM;

Dumping Data for table barang


INSERT INTO barang VALUES ('B-001', 'Komputer', 'Unit', 10, '3500000');
INSERT INTO barang VALUES ('B-002', 'Laptop Dell', 'Unit', 50, '5000000');
INSERT INTO barang VALUES ('B-003', 'Printer HP', 'Unit', 100, '450000');
INSERT INTO barang VALUES ('B-004', 'LCD Dell', 'Unit', 200, '900000');
INSERT INTO barang VALUES ('B-005', 'Scanner', 'Unit', 350, '1600000');
INSERT INTO barang VALUES ('B-006', 'Laptop Thosiba', 'Unit', 10,
'5500000');

Table Transaksi
CREATE TABLE transaksi (
NoFact char(10) NOT NULL default '',
KdBrg char(10) NOT NULL default '',
KdCust char(10) NOT NULL default '',
Tgl date NOT NULL default '0000-00-00',
Jml int(11) NOT NULL default '0',
PRIMARY KEY (NoFact),
KEY Tgl (Tgl)
) TYPE=MyISAM;

Dumping data for table transaksi


INSERT INTO transaksi VALUES ('F-001', 'B-001', 'C-001', '2011-09-24', 3);
INSERT INTO transaksi VALUES ('F-002', 'B-002', 'C-001', '2011-09-23', 3);
INSERT INTO transaksi VALUES ('F-003', 'B-003', 'C-001', '2011-09-24', 4);
INSERT INTO transaksi VALUES ('F-004', 'B-001', 'C-002', '2011-09-25', 2);
INSERT INTO transaksi VALUES ('F-005', 'B-002', 'C-002', '2011-09-25', 1);
INSERT INTO transaksi VALUES ('F-006', 'B-003', 'C-002', '2011-09-25', 4);
INSERT INTO transaksi VALUES ('F-007', 'B-004', 'C-003', '2011-09-25', 3);
INSERT INTO transaksi VALUES ('F-008', 'B-003', 'C-003', '2011-09-23', 2);
INSERT INTO transaksi VALUES ('F-009', 'B-005', 'C-004', '2011-09-23', 4);
INSERT INTO transaksi VALUES ('F-010', 'B-001', 'C-004', '2011-09-23', 5);

You might also like