LATIHAN FLUTTER WEEK#5 : SIKAR MEMBUAT DATABASE DAN TABEL MYSQL

LATIHAN FLUTTER WEEK#5 : SIKAR MEMBUAT DATABASE DAN TABEL MYSQL

database : sikar

tabel : karyawan

CREATE TABLE `karyawan` ( `karId` int(11) NOT NULL, `karNik` char(4) DEFAULT NULL, `karNama` varchar(40) DEFAULT NULL, `karGol` char(2) DEFAULT NULL, `karStatus` char(1) DEFAULT NULL, `karHp` char(15) DEFAULT NULL, `karEmail` varchar(40) DEFAULT NULL, `karAlamat` text, `karFoto` varchar(100) DEFAULT NULL, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdUser` char(5) DEFAULT NULL, `updatedUser` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

tabel : user

CREATE TABLE `user` ( `userId` int(11) NOT NULL, `userNik` char(4) DEFAULT NULL, `userName` varchar(40) DEFAULT NULL, `userPass` varchar(40) DEFAULT NULL, `userLevel` char(1) DEFAULT NULL, `userStatus` char(1) DEFAULT NULL, `userToken` varchar(200) DEFAULT NULL, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `createdUser` char(5) DEFAULT NULL, `updatedUser` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

view : viewKaryawan

CREATE VIEW viewKaryawan AS SELECT a.karId,a.karNik,a.karNama,a.karGol,a.karStatus, a.karHp,a.karEmail,a.karAlamat,a.karFoto, b.userId,b.userName,b.userPass,b.userLevel,b.userStatus,b.userToken FROM karyawan AS a INNER JOIN user AS b ON a.karNik = b.userNik

Flutter Developer