0% found this document useful (0 votes)
34 views4 pages

DBMS

The document contains SQL commands used to create databases and tables for managing airline ticket sales in MariaDB. The commands create databases, tables for staff, customers, tickets, flights, and airlines. Data is then inserted into the staff table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

DBMS

The document contains SQL commands used to create databases and tables for managing airline ticket sales in MariaDB. The commands create databases, tables for staff, customers, tickets, flights, and airlines. Data is then inserted into the staff table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Microsoft Windows [Version 10.0.22000.

1219]

(c) Microsoft Corporation. All rights reserved.

C:\Users\asuss>cd c:/xampp/mysql/bin

c:\xampp\mysql\bin>mysql -u root -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 10

Server version: 10.4.20-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> create database pengelolaan_penjualan_tiket_pesawat;

Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> use pengelolaan_penjualan_tiket_pesawat;

Database changed

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table petugas

-> (

-> id_petugas varchar(10) not null primary key,

-> nm_petugas varchar(25),

-> alamat text,

-> no_telp int

-> );

Query OK, 0 rows affected (0.111 sec)


MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table konsumen

-> (

-> id_konsumen varchar(10) not null primary key,

-> id_petugas varchar(10),

-> nm_konsumen varchar(25),

-> alamat text,

-> no_telp int

-> );

Query OK, 0 rows affected (0.104 sec)

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table tiket

-> (

-> id_Tiket varchar(10) not null primary key,

-> id_petugas varchar(10),

-> id_konsumen varchar(10),

-> no

-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
MariaDB server version for the right syntax to use near ')' at line 7

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table tiket

-> (

-> id_Tiket varchar(10) not null primary key,

->

-> id_petugas varchar(10),

-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
MariaDB server version for the right syntax to use near ')' at line 6

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table tiket

-> (
-> id_Tiket varchar(10) not null primary key,

-> id_petugas varchar(10),

-> id_konsumen varchar(10),

-> harga_tiket int,

-> no_penerbangan varchar(20),

-> Tujuan varchar(50),

-> tanggal_keberangkatan date,

-> jam_keberangkatan int

-> );

Query OK, 0 rows affected (0.076 sec)

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table keberangkatan

-> (

-> id_keberangkatan varchar(10) not null primary key,

-> id_konsumen varchar(10),

-> id_tiket varchar(10),

-> id_maskapai varchar(10),

-> tanggal_keberangkatan date,

-> jam_keberangkatan int

-> );

Query OK, 0 rows affected (0.077 sec)

MariaDB [pengelolaan_penjualan_tiket_pesawat]> alter table tiket add jenis_tiket varchar(25) after


harga_tiket;

Query OK, 0 rows affected (0.060 sec)

Records: 0 Duplicates: 0 Warnings: 0

MariaDB [pengelolaan_penjualan_tiket_pesawat]> create table maskapai

-> (
-> id_maskapai varchar(10) not null primary key,

-> nm_maskapai varchar(25),

-> tujuan varchar(50)

-> );

Query OK, 0 rows affected (0.077 sec)

MariaDB [pengelolaan_penjualan_tiket_pesawat]> insert into petugas values

-> ('P001','Alvin','Lubuklinggau','085312344554'),

-> ('P002','Donita','Lubuklinggau','085212347720'),

-> ('P003','Farel','Musi Rawas','081230152233'),

-> ('P004','Tiara','Lubuklinggau','081330151060'),

-> ('P005','Sasa','Lubuklinggau','082264757823'),

-> ('P006','Doni','Musi Rawas','085311221994'),

-> ('P007','Diki','Musi Rawas','085211221922'),

-> ('P008','Handoko','Lubuklinggau','085311250321'),

-> ('P009','Rania','Lubuklinggau','081212223167'),

-> ('P010','Jaka','Lubuklinggau','085377841020');

Query OK, 10 rows affected, 10 warnings (0.124 sec)

Records: 10 Duplicates: 0 Warnings: 10

MariaDB [pengelolaan_penjualan_tiket_pesawat]> insert into konsumen values

('K001','P001','Rania','Lubuklinggau','081212223167'),

You might also like