SlideShare a Scribd company logo
1 of 2
alter table mhs
add foreign key(id_matkul) references matkul(id_matkul)
on delete cascade
on update cascade;
INSERT INTO `mhs`(`nim`, `nama`, `alamat`, `id_matkul`) VALUES
('10107633','Adiputra Artupida','Bekasi','IF123'),
('10107634','Hermansyah','Bandung','IF222'),
('10107635','Budianto Nugroho','Semarang','IF111'),
('10107636','Silan','Bekasi','IF333');
SHOW CREATE TABLE mhs;
DROP INDEX id_matkul_4 ON mhs;
INSERT INTO `matkul`(`id_matkul`, `nm_matkul`, `sks`) VALUES
('IF123','Pemrograman Web',3),
('IF111','Pemrograman C',3),
('IF222','Pemrograman Java',3),
('IF333','Pemrograman OOP',3);
2 tabel
select mhs.nim, mhs.nama, mhs.id_matkul, matkul.nm_matkul from mhs inner join
matkul on mhs.id_matkul=matkul.id_matkul;
3 tabel
select mhs.nama, matkul.nm_matkul, dosen.nama_dosen from mhs inner join matkul
on mhs.id_matkul=matkul.id_matkul
inner join dosen on mhs.kode_dosen=dosen.kode_dosen
jam
INSERT INTO `jam_selesai`(`kode_jam_selesai`, `nama_jam_selesai`) VALUES
('11', '07:50:00'),('12', '08:40:00'),('13', '09:30:00'),('14', '10:20:00'),
('15', '11:10:00'),('16', '10:00:00'),('17', '12:50:00'),('18', '13:40:00'),
('19', '14:30:00'),('20', '15:20:00'),('21', '16:10:00'),('22', '17:00:00'),
('23', '17:45:00'),('24', '18:30:00'),('25', '19:15:00'),('27', '20:45:00'),
('28', '21:30:00');
select jadwal.kode_mk, matakuliah.nama_mk, jadwal.kelas, jadwal.ruang,
hari.nama_hari, jam_mulai.kode_jam_mulai, jam_selesai.kode_jam_selesai,
dosen.nidn, dosen.nama from jadwal
inner join matakuliah on jadwal.kode_mk=matakuliah.kode_mk
inner join hari on jadwal.kode_hari=hari.kode_hari
inner join jam_mulai on jadwal.kode_jam_mulai=jam_mulai.kode_jam_mulai
inner join jam_selesai on jadwal.kode_jam_selesai=jam_selesai.kode_jam_selesai
inner join dosen on jadwal.kode_dosen=dosen.nidn
periode kode_mk nidn kelas ruang
kode_hari kode_jam_mulai kode_jam_selesai
/////////////////////////////////////////////////////////////
select * from jadwal inner join matakuliah on jadwal.kode_mk=matakuliah.kode_mk
inner join dosen on jadwal.nidn=dosen.nidn
inner join hari on jadwal.kode_hari=hari.kode_hari
inner join jam_mulai on jadwal.kode_jam_mulai=jam_mulai.kode_jam_mulai
inner join jam_selesai on jadwal.kode_jam_selesai=jam_selesai.kode_jam_selesai
//////////////////////////////////////////////////////////////////////////////
20142 463013 9999 A K303 1 11 14 463013
Pemrograman Dasar 3 9999 Ali permai 1 senin 11
07:00:00 14 10:20:00
0 1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17 18 19
////////////////////////////////////////////////
<form name="form7" method="post" action="jadwal.php">
Periode <input type="text" name="periode" value=" " size="5">
<br>
<input value="Simpan" type="submit" name="submit"/>
</form>
$periode = $_POST['periode'];
//////////////////////////////////////////
insert into jadwal values ('20141','463013','9999','A','K305','5','19','22')
//////////////////////////////////////////
select * from krs inner join mahasiswa on krs.nim=mahasiswa.nim
inner join jadwal on krs.no=jadwal.no
//////////////////////////////////////////////

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

contoh membuat table, alter, inner join pada database

  • 1. alter table mhs add foreign key(id_matkul) references matkul(id_matkul) on delete cascade on update cascade; INSERT INTO `mhs`(`nim`, `nama`, `alamat`, `id_matkul`) VALUES ('10107633','Adiputra Artupida','Bekasi','IF123'), ('10107634','Hermansyah','Bandung','IF222'), ('10107635','Budianto Nugroho','Semarang','IF111'), ('10107636','Silan','Bekasi','IF333'); SHOW CREATE TABLE mhs; DROP INDEX id_matkul_4 ON mhs; INSERT INTO `matkul`(`id_matkul`, `nm_matkul`, `sks`) VALUES ('IF123','Pemrograman Web',3), ('IF111','Pemrograman C',3), ('IF222','Pemrograman Java',3), ('IF333','Pemrograman OOP',3); 2 tabel select mhs.nim, mhs.nama, mhs.id_matkul, matkul.nm_matkul from mhs inner join matkul on mhs.id_matkul=matkul.id_matkul; 3 tabel select mhs.nama, matkul.nm_matkul, dosen.nama_dosen from mhs inner join matkul on mhs.id_matkul=matkul.id_matkul inner join dosen on mhs.kode_dosen=dosen.kode_dosen jam INSERT INTO `jam_selesai`(`kode_jam_selesai`, `nama_jam_selesai`) VALUES ('11', '07:50:00'),('12', '08:40:00'),('13', '09:30:00'),('14', '10:20:00'), ('15', '11:10:00'),('16', '10:00:00'),('17', '12:50:00'),('18', '13:40:00'), ('19', '14:30:00'),('20', '15:20:00'),('21', '16:10:00'),('22', '17:00:00'), ('23', '17:45:00'),('24', '18:30:00'),('25', '19:15:00'),('27', '20:45:00'), ('28', '21:30:00'); select jadwal.kode_mk, matakuliah.nama_mk, jadwal.kelas, jadwal.ruang, hari.nama_hari, jam_mulai.kode_jam_mulai, jam_selesai.kode_jam_selesai, dosen.nidn, dosen.nama from jadwal inner join matakuliah on jadwal.kode_mk=matakuliah.kode_mk inner join hari on jadwal.kode_hari=hari.kode_hari inner join jam_mulai on jadwal.kode_jam_mulai=jam_mulai.kode_jam_mulai inner join jam_selesai on jadwal.kode_jam_selesai=jam_selesai.kode_jam_selesai inner join dosen on jadwal.kode_dosen=dosen.nidn periode kode_mk nidn kelas ruang kode_hari kode_jam_mulai kode_jam_selesai ///////////////////////////////////////////////////////////// select * from jadwal inner join matakuliah on jadwal.kode_mk=matakuliah.kode_mk inner join dosen on jadwal.nidn=dosen.nidn inner join hari on jadwal.kode_hari=hari.kode_hari inner join jam_mulai on jadwal.kode_jam_mulai=jam_mulai.kode_jam_mulai inner join jam_selesai on jadwal.kode_jam_selesai=jam_selesai.kode_jam_selesai //////////////////////////////////////////////////////////////////////////////
  • 2. 20142 463013 9999 A K303 1 11 14 463013 Pemrograman Dasar 3 9999 Ali permai 1 senin 11 07:00:00 14 10:20:00 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 //////////////////////////////////////////////// <form name="form7" method="post" action="jadwal.php"> Periode <input type="text" name="periode" value=" " size="5"> <br> <input value="Simpan" type="submit" name="submit"/> </form> $periode = $_POST['periode']; ////////////////////////////////////////// insert into jadwal values ('20141','463013','9999','A','K305','5','19','22') ////////////////////////////////////////// select * from krs inner join mahasiswa on krs.nim=mahasiswa.nim inner join jadwal on krs.no=jadwal.no //////////////////////////////////////////////