﻿IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name='NCI_TanuloMulasztas_OraTanuloiId_Tipus_IntezmenyId_TanevId') BEGIN
  CREATE INDEX NCI_TanuloMulasztas_OraTanuloiId_Tipus_IntezmenyId_TanevId
    ON T_TANULOMULASZTAS (C_ORATANULOIID, C_TIPUS, C_INTEZMENYID, C_TANEVID) 
  INCLUDE (C_TANITASIORAKID) 
  WHERE TOROLT = 'F'
  WITH (FILLFACTOR = 80)
END
GO

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name='NCI_TanitasiOra_TanevId_IntezmenyId_Datum') BEGIN
  CREATE INDEX NCI_TanitasiOra_TanevId_IntezmenyId_Datum 
    ON T_TANITASIORA (C_TANEVID, C_INTEZMENYID, C_DATUM) 
  WHERE TOROLT = 'F'
  WITH (FILLFACTOR = 80)
END
GO

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name='NCI_TanuloCsoport_IntezmenyId_TanevId') BEGIN
  CREATE NONCLUSTERED INDEX NCI_TanuloCsoport_IntezmenyId_TanevId
    ON [dbo].[T_TANULOCSOPORT] ([C_INTEZMENYID],[C_TANEVID])
  INCLUDE ([C_BELEPESDATUM],[C_KILEPESDATUM],[C_OSZTALYCSOPORTID],[C_TANULOID]) 
  WHERE [TOROLT] = 'F'
  WITH (FILLFACTOR = 80)
END
GO
