Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
“Kehadiran Mahasiswa”
Sella Monica
311 510 225
TI. 15. D7
STT PELITA BANGSA
2017
TUGAS UAS
PRAKTEK BASIS DATA 2
MAKALAH KEHADIRAN MAHASISWA
Disusun oleh :
TEKNIK INFORMATIKA
2017
1. Membuat database dan table Mahasiswa, Absensi, Kehadiran, Nilai
--membuat database--
create Database Kehadiran_Mahasiswa
use Kehadiran_Mahasiswa
2
2. SP Status Kehadiran Mahasiswa
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Sella Monica>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE Status_Kehadiran
@Tgl date
AS
BEGIN
SET NOCOUNT ON;
declare @NIM varchar (9),
@Cursor_sts as cursor
set @Cursor_sts = cursor for select NIM from Absensi where
convert (date, Date_in)=@tgl;
open @Cursor_sts
fetch next from @Cursor_sts into @NIM
while (@@FETCH_STATUS=0)
Begin
update Kehadiran set Status = 'Hadir' where Date_in=@tgl and
NIM=@NIM;
fetch next from @Cursor_sts into @tgl
End
Close @Cursor_sts
Deallocate @Cursor_sts
END
GO
3. SP-Kehadiran mahasiswa
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Sella Monica>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
alter PROCEDURE Kehadiran_Mhs
@Tgl date
AS
BEGIN
SET NOCOUNT ON;
declare @NIM varchar (9),
@Cursor_Mahasiswa as cursor
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: < Sella Monica >
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE FUNCTION F_mhs
(
@TglAw date,
@TglAk date,
@NIM varchar (9)
)
RETURNS smallint
AS
BEGIN
declare @jm smallint;
END
GO
4. Store Prosedure Nilai
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
1. Mahasiswa
2. Absensi
3, Kehadiran
4, Nilai