Advertisement
JonathanA007

Jonathan Arya Priguna / LK12 BDT

May 6th, 2024 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 5.56 KB | Source Code | 0 0
  1. CREATE TABLE departemen_1111015 (
  2.   DNAME_1111015 VARCHAR(255),
  3.   DNumber_1111015 INT(15),
  4.   MGRSSN_1111015 VARCHAR(15) NOT NULL,  
  5.   MGR_TGL_1111015 DATE,
  6.   PRIMARY KEY (DNumber_1111015)
  7. );
  8.  
  9. CREATE TABLE EMPLOYEE_1111015 (
  10.   SSN_1111015 INT(15) PRIMARY KEY,
  11.   Nama_1111015 VARCHAR(255) NOT NULL,
  12.   Alamat_E_1111015 VARCHAR(255) NOT NULL,
  13.   Telepon_1111015 BIGINT NOT NULL,
  14.   DNO_1111015 INT NOT NULL,
  15.   SuperSSN_1111015 VARCHAR(10) NOT NULL,  
  16.   Gaji_1111015 DECIMAL(15, 2) NOT NULL,
  17.   Jenis_K_1111015 VARCHAR(10) NOT NULL,  
  18.   FOREIGN KEY (DNO_1111015) REFERENCES departemen_1111015(DNumber_1111015)
  19. );
  20.  
  21. CREATE TABLE dep_lokasi_1111015 (
  22.   DNumber_1111015 INT(15),
  23.   Alamat_D_1111015 VARCHAR(255) PRIMARY KEY,
  24.   FOREIGN KEY (DNumber_1111015) REFERENCES departemen_1111015(DNumber_1111015)
  25. );
  26.  
  27. CREATE TABLE keluarga_1111015 (
  28.   ESSN_1111015 INT,
  29.   Nama_Anggota_1111015 VARCHAR(255) NOT NULL PRIMARY KEY,
  30.   Hubungan_1111015 VARCHAR(20) NOT NULL,  
  31.   Jenis_Kelamin_1111015 VARCHAR(5) NOT NULL,  
  32.   FOREIGN KEY (ESSN_1111015) REFERENCES EMPLOYEE_1111015(SSN_1111015)
  33. );
  34.  
  35. CREATE TABLE project_1111015 (
  36.   PNumber_1111015 INT PRIMARY KEY,
  37.   PName_1111015 VARCHAR(255) NOT NULL,
  38.   Lokasi_P_1111015 VARCHAR(255) NOT NULL,
  39.   DNum_1111015 INT NOT NULL,
  40.   FOREIGN KEY (DNum_1111015) REFERENCES departemen_1111015(DNumber_1111015)
  41. );
  42.  
  43. CREATE TABLE bekerja_1111015 (
  44.   ESSN_1111015 INT(15),
  45.   PNO_1111015 INT(15),
  46.   Jam_1111015 TIME,
  47.   PRIMARY KEY (PNO_1111015),
  48.   FOREIGN KEY (ESSN_1111015) REFERENCES EMPLOYEE_1111015(SSN_1111015),
  49.   FOREIGN KEY (PNO_1111015) REFERENCES project_1111015(PNumber_1111015)
  50. );
  51.  
  52. INSERT INTO departemen_1111015 (DNAME_1111015, DNumber_1111015, MGRSSN_1111015, MGR_TGL_1111015) VALUES ('HR', 1000, '049004511', '1999-07-24');
  53. INSERT INTO departemen_1111015 (DNAME_1111015, DNumber_1111015, MGRSSN_1111015, MGR_TGL_1111015) VALUES ('Sales', 1001, '876734557', '1996-08-25');
  54. INSERT INTO departemen_1111015 (DNAME_1111015, DNumber_1111015, MGRSSN_1111015, MGR_TGL_1111015) VALUES ('Finance', 1002, '3564784019', '1997-03-04');
  55. INSERT INTO departemen_1111015 (DNAME_1111015, DNumber_1111015, MGRSSN_1111015, MGR_TGL_1111015) VALUES ('Security', 1003, '0013391544', '1980-01-10');
  56. INSERT INTO departemen_1111015 (DNAME_1111015, DNumber_1111015, MGRSSN_1111015, MGR_TGL_1111015) VALUES ('IT', 1004, '091355667', '2001-09-20');
  57.  
  58. INSERT INTO EMPLOYEE_1111015 (SSN_1111015, Nama_1111015, Alamat_E_1111015, Telepon_1111015, DNO_1111015, SuperSSN_1111015, Gaji_1111015, Jenis_K_1111015) VALUES (874329015, 'Rafli', 'Vermont Square', 3232921397, 1000, 'Z047',5000000.00,'Man');
  59. INSERT INTO EMPLOYEE_1111015 (SSN_1111015, Nama_1111015, Alamat_E_1111015, Telepon_1111015, DNO_1111015, SuperSSN_1111015, Gaji_1111015, Jenis_K_1111015) VALUES (571906832, 'Atha', 'Jl Moh Yamin', 0213101068, 1001, 'Z033',10000000.00,'Man');
  60. INSERT INTO EMPLOYEE_1111015 (SSN_1111015, Nama_1111015, Alamat_E_1111015, Telepon_1111015, DNO_1111015, SuperSSN_1111015, Gaji_1111015, Jenis_K_1111015) VALUES (236487519, 'Adhimu', 'Threadneedle St', 442034615545, 1002, 'Z022',40000000.00,'Man');
  61. INSERT INTO EMPLOYEE_1111015 (SSN_1111015, Nama_1111015, Alamat_E_1111015, Telepon_1111015, DNO_1111015, SuperSSN_1111015, Gaji_1111015, Jenis_K_1111015) VALUES (682951743, 'Xing', '3rd Ring', 861068450715, 1003, 'Z011',20000000.00,'Woman');
  62. INSERT INTO EMPLOYEE_1111015 (SSN_1111015, Nama_1111015, Alamat_E_1111015, Telepon_1111015, DNO_1111015, SuperSSN_1111015, Gaji_1111015, Jenis_K_1111015) VALUES (398165724, 'Baboon', 'Bayfront Ave', 6566888868, 1004, 'Z047',750000000.00,'Man');
  63.  
  64. INSERT INTO dep_lokasi_1111015 (DNumber_1111015, Alamat_D_1111015) VALUES (1000, 'Slausen Ave');
  65. INSERT INTO dep_lokasi_1111015 (DNumber_1111015, Alamat_D_1111015) VALUES (1001, 'Kipling Ave');
  66. INSERT INTO dep_lokasi_1111015 (DNumber_1111015, Alamat_D_1111015) VALUES (1002, 'Threadneedle St');
  67. INSERT INTO dep_lokasi_1111015 (DNumber_1111015, Alamat_D_1111015) VALUES (1003, 'Jalan Trunojoyo');
  68. INSERT INTO dep_lokasi_1111015 (DNumber_1111015, Alamat_D_1111015) VALUES (1004, '12th Ring');
  69.  
  70. INSERT INTO keluarga_1111015 (ESSN_1111015, Nama_Anggota_1111015, Hubungan_1111015, Jenis_Kelamin_1111015) VALUES
  71.   (874329015, 'Raras', 'Istri', 'Woman'),
  72.   (571906832, 'Pratama', 'Anak', 'Man'),
  73.   (236487519, 'Rizky', 'Anak', 'Man'),
  74.   (682951743, 'Jonathan', 'Suami', 'Man'),
  75.   (398165724, 'Arya', 'Ayah', 'Man');
  76.  
  77. INSERT INTO project_1111015 (PNumber_1111015, PName_1111015, Lokasi_P_1111015, DNum_1111015) VALUES (1001, 'HRM', 'Slausen Ave', 1000);
  78. INSERT INTO project_1111015 (PNumber_1111015, PName_1111015, Lokasi_P_1111015, DNum_1111015) VALUES (1002, 'POS', 'Kipling Ave', 1001);
  79. INSERT INTO project_1111015 (PNumber_1111015, PName_1111015, Lokasi_P_1111015, DNum_1111015) VALUES (1003, 'PNS', 'Threadneedle St', 1002);
  80. INSERT INTO project_1111015 (PNumber_1111015, PName_1111015, Lokasi_P_1111015, DNum_1111015) VALUES (1004, 'SCS', 'Jalan Trunojoyo', 1003);
  81. INSERT INTO project_1111015 (PNumber_1111015, PName_1111015, Lokasi_P_1111015, DNum_1111015) VALUES (1005, 'Networking', '12th Ring', 1004);
  82.  
  83. INSERT INTO bekerja_1111015 (ESSN_1111015, PNO_1111015, Jam_1111015) VALUES (874329015, 1001, '08:00:00');
  84. INSERT INTO bekerja_1111015 (ESSN_1111015, PNO_1111015, Jam_1111015) VALUES (571906832, 1002, '09:00:00');
  85. INSERT INTO bekerja_1111015 (ESSN_1111015, PNO_1111015, Jam_1111015) VALUES (236487519, 1003, '10:00:00');
  86. INSERT INTO bekerja_1111015 (ESSN_1111015, PNO_1111015, Jam_1111015) VALUES (682951743, 1004, '11:00:00');
  87. INSERT INTO bekerja_1111015 (ESSN_1111015, PNO_1111015, Jam_1111015) VALUES (398165724, 1005, '12:00:00');
  88.  
  89.  
  90.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement