Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
quan ly chuyen bay
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
CREATE TABLE KHACHHANG( MAKH NCHAR(15), TEN NCHAR(50), DCHI NCHAR(50), DTHOAI NCHAR(12), PRIMARY KEY(MAKH) ); CREATE TABLE NHANVIEN( MANV NCHAR(15), TEN NCHAR(50), DCHI NCHAR(50), DTHOAI NCHAR(12), LUONG FLOAT, LOAINV BIT, PRIMARY KEY(MANV) ); CREATE TABLE LOAIMB( MALOAI NCHAR(15), HANGSX NCHAR(15), PRIMARY KEY(MALOAI) ); CREATE TABLE MAYBAY( SOHIEU INT, MALOAI NCHAR(15), PRIMARY KEY(SOHIEU, MALOAI) ) CREATE TABLE CHUYENBAY( MACB NCHAR(15), SBDI NCHAR(3), SBDEN NCHAR(3), GIODI TIME, GIODEN TIME, PRIMARY KEY(MACB) ); CREATE TABLE LICHBAY( NGAYDI DATE, MACB NCHAR(15), SOHIEU INT, MALOAI NCHAR(15) PRIMARY KEY(NGAYDI, MACB) ); CREATE TABLE DATCHO( MAKH NCHAR(15), NGAYDI DATE, MACB NCHAR(15) PRIMARY KEY(MAKH, NGAYDI, MACB) ); CREATE TABLE KHANANG( MANV NCHAR(15), MALOAI NCHAR(15), PRIMARY KEY(MANV, MALOAI) ); CREATE TABLE PHANCONG( MANV NCHAR(15), NGAYDI DATE, MACB NCHAR(15), PRIMARY KEY(MANV, NGAYDI, MACB) ); ALTER TABLE DATCHO ADD CONSTRAINT FK_DATCHO_KHACHHANG FOREIGN KEY (MAKH) REFERENCES KHACHHANG(MAKH) ALTER TABLE DATCHO ADD CONSTRAINT FK_DATCHO_LICHBAY FOREIGN KEY (NGAYDI, MACB) REFERENCES LICHBAY(NGAYDI, MACB) ALTER TABLE LICHBAY ADD CONSTRAINT U_MALOAI_SOHIEU UNIQUE(SOHIEU, MALOAI) ALTER TABLE LICHBAY ADD CONSTRAINT FK_LICHBAY_CHUYENBAY FOREIGN KEY (MACB) REFERENCES CHUYENBAY(MACB) ALTER TABLE LICHBAY ADD CONSTRAINT FK_LICHBAY_MAYBAY FOREIGN KEY (SOHIEU, MALOAI) REFERENCES MAYBAY(SOHIEU, MALOAI) ALTER TABLE MAYBAY ADD CONSTRAINT FK_MAYBAY_LOAIMB FOREIGN KEY (MALOAI) REFERENCES LOAIMB(MALOAI) ALTER TABLE PHANCONG ADD CONSTRAINT FK_PHANCONG_LICHBAY FOREIGN KEY (NGAYDI, MACB) REFERENCES LICHBAY(NGAYDI, MACB) ALTER TABLE PHANCONG ADD CONSTRAINT FK_PHANCONG_NHANVIEN FOREIGN KEY (MANV) REFERENCES NHANVIEN(MANV) ALTER TABLE KHANANG ADD CONSTRAINT FK_KHANANG_NHANVIEN FOREIGN KEY (MANV) REFERENCES NHANVIEN(MANV) ALTER TABLE KHANANG ADD CONSTRAINT FK_KHANANG_LOAIMB FOREIGN KEY (MALOAI) REFERENCES LOAIMB(MALOAI) INSERT INTO NHANVIEN VALUE ('1006', 'CHI', '12/6 NGUYEN KIEM', '8120012', '150000', '0'), ('1005','GIAO','65 NGUYEN THAI SON','8324467','500000','0'), ('1001','HUONG','8 DIEN BIEN PHU','8330733','500000','1'), ('1002','PHONG','1 LY THUONG KIET','8308117','450000','1'), ('1004','PHUONG','351 LAC LONG QUAN','8308155','250000','0'), ('1003','QUANG','78 TRUONG DINH','8324461','350000','1'), ('1007','TAM','36 NGUYEN VAN CU','8458188','500000','0') INSERT INTO KHACHHANG VALUE ('0009','NGA','223 NGUYEN TRAI','8932320'), ('0101','ANH','567 TRAN PHU','8826729'), ('0045','THU','285 LE LOI','8932203'), ('0012','HA','435 QUANG TRUNG','8933232'), ('0238','HUNG','456 PASTEUR','9812101'), ('0397','THANH','234 LE VAN SI','8952943'), ('0582','MAI','789 NGUYEN DU',''), ('0934','MINH','678 LE LAI',''), ('0091','HAI','345 HUNG VUONG','8893223'), ('0314','PHUONG','395 VO VAN TAN','8232320'), ('0613','VU','348 CMT8','8343232'), ('0586','SON','123 BACH DANG','8556223'), ('0422','TIEN','75 NGUYEN THONG','8332222') INSERT INTO KHANANG VALUE ('1001','B727'), ('1001','B747'), ('1001','DC10'), ('1001','DC9'), ('1002','A320'), ('1002','A340'), ('1002','B757'), ('1002','DC9'), ('1003','A310'), ('1003','DC9') INSERT INTO
View schema
Execution time: 0,03 sec, rows selected: 0, rows affected: 0, absolute service time: 0,17 sec
edit mode
|
history
|
discussion