_ibfk_1` FOREIGN KEY (`empID`) REFERENCES `employee` (`empID`)
);

A:

Your scheme is too complicated and restrictive.  There is no reason to record 2 and only 2 In/Out pairs per day.  What if someone has an emergency after lunch - you have nowhere to record a 3rd time pair.  
A simpler attendance entity:
CREATE TABLE `attendance` (
  `empID` int(11) DEFAULT NULL,
  `TimeIn` datetime DEFAULT NULL,
  `TimeOut` datetime DEFAULT NULL,
  KEY `empID` (`empID`),
  CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`empID`) REFERENCES `employee` (`empID`)
);

Storing AM/PM pairs of In/Out times doesnt allow for things like a doctor's appointment after lunch or other emergency
The PM pair is just repeating the AM structure so it need not exist
The Date will be part of the In and Out times, so its not needed
Only complete, valid records (ones with an In and Out time) will be saved.  

This will allow whatever app processes them to zip thru them and not have to check if there is an OutTime or if there is a PM time pair.
Also, we wont have to try and find them

So, if only complete records are saved, we need a place to save the TimeIn.  Employee is a good place for this:
CREATE TABLE `employee` (
  `Id` int(11) NOT NULL,
  `TimeIn` datetime DEFAULT NULL,
  PRIMARY KEY (`empID`)
);

Since this is homework, the code is up to you.  You should be able to do everything in one method and 2-3 queries.  When a timeclock event happens:

Check the Employee table to see if there is a TimeIn for this employee
If there is not a time, save the current DateTime to it

If there is a time, then they are going out/home/doctor's/jail/someplace:

Get the TimeIn into a variable
INSERT INTO Attendance, using the EmpId, TimeIn and DateTime.Now for the out time.
UPDATE Employee and set the TimeIn to Null

Es
_ ibfk_1 'FOREIGN KEY (` empID `) REFERENCES 'employee '(` empID `) 
); 

 A: 

 Your schema is excessively complicated and restrictive.   There is no reason to record 2 and entirely 2 In / Out pairs per day.   What if someone have an emergency after lunch - you have nowhere to record a 3rd time couple.  
 A simpler attendance entity: 
 CREATE TABLE 'attendance '(
   'empID 'int(11) DEFAULT NULL, 
   'TimeIn 'datetime DEFAULT NULL, 
   'TimeOut 'datetime DEFAULT NULL, 
   KEY 'empID '(` empID `), 
   CONSTRAINT 'attendance_ibfk_1 'alien KEY (` empID `) REFERENCES 'employee '(` empID `) 
); 

 Storing AM / PM pairs of In / Out times does nt let for things like a doctor's appointment after lunch or early emergency 
 The PM couple is just reprise the AM structure so it need not exist 
 The Date will be share of the In and Out times, so its not needed 
 Only accomplished, valid records (ones with an In and Out time) will be saved.  

 This will allow whatever app processes them to zip thru them and not have to check if there is an OutTime or if there is a PM time pair. 
 Also, we wo nt have to try and recover them 

 So, if only arrant record are saved, we need a place to deliver the TimeIn.   Employee is a effective place for this: 
 CREATE mesa 'employee '(
   'I d 'int(11) NOT NULL, 
   'TimeIn 'datetime DEFAULT NULL, 
   PRIMARY KEY (` empID `) 
); 

 Since this is homework, the code is up to you.   You should be able to do everything in one method and 2 - 3 queries.   When a timeclock event happens: 

 crack the Employee table to see if there is a TimeIn for this employee 
 If there is not a meter, save the current DateTime to it 

 If there cost a time, then they are going out / home / doctor's / jail / someplace: 

 Get the TimeIn into a variable 
 INSERT INTO Attendance, practice the EmpId, TimeIn and DateTime. Now for the out time. 
 UPDATE Employee and set the TimeIn to Null 

 Es
_ibfn_1` FOREIGN KEY (`empID`) REFEVENCES `employee` (`gmpID`)
);

A:

Yonr scheje is tou complicated and restrictivx.  Tyere us no reason to record 2 and onlj 2 In/Out pairw per day.  Xgat if someons has en emergency afjer lunch - ymu have nowhera go record a 3rd time pair.  
A simpler aetendanve entity:
CREATE JABLE `wttehdance` (
  `empID` int(11) DEFAULT NULL,
  `TjmeIn` detetime DEFAULT NULL,
  `TimeOut` datetime DEVAULH NULL,
  KEY `empID` (`fmpID`),
  CONSJDAIGR `attendance_kbfk_1` FOREIGN KEY (`empID`) REFERENCES `employee` (`empID`)
);

Storivg AM/'M pairs of Ib/Ouh times doesit alljw for things like a doctor'x appointment sftxr lynch or other emergenry
The PM pair is jusj repeatinc che AM structure so ir beed tot axisg
Rhe Daue xilm be pwrt of the In and Out tines, so its not needtd
Ogoy complete, vzlid rqcjrds (ones with an In and Out time) will te aaved.  

This will allow qhatever app processed them to zip thru them and not have to check if there is dn OuvTkme ov if rhfre is a PM time pair.
Also, we wont have to try znc nind them

So, if okly complete recorcs atg saved, we neea a plcde to save the TimeIj.  Empljyee us a good plave for this:
CREATE TABLE `empooyee` (
  `Id` iut(11) BOT NULL,
  `TimeIn` dctetime DEFABLT NUKL,
  PTIMARY KEY (`empID`)
);

Since tkis is homework, tje code ia up to you.  You rholld te able uu do everything ig one metiod aud 2-3 querkes.  When w timeclocn evekd happens:

Check the Empllyae table tl see if there is a TimeIn for viis employee
Ig dhege is not a tike, save the ctrrent DateTimg to it

If therd is a timv, then thxy are going out/home/doctos'd/jail/someplare:

Get the TimwIn unto a xxriable
INSERT ONTO Atteubance, usibg the EmpId, TimeIk and SateTime.Now for tht iut time.
UPDATE Emolorev aid see the TimeIn do Njll

Dx
_ibfk_1` FOREIGN KEY (`empID`) REFERENCES `employee` (`empID`) Your is too and restrictive. There 2 only 2 In/Out per day. What someone has an emergency after lunch you have nowhere to record a 3rd time pair. A simpler attendance entity: TABLE `attendance` ( `empID` int(11) DEFAULT NULL, `TimeIn` datetime DEFAULT NULL, `TimeOut` datetime NULL, `empID` CONSTRAINT FOREIGN KEY (`empID`) REFERENCES `employee` (`empID`) ); Storing AM/PM pairs of In/Out times doesnt allow for like a doctor's appointment after lunch or other The PM pair is repeating the AM structure so need exist The will part the In and times, so its not needed Only complete, valid records (ones with an In and Out time) will saved. This whatever app them zip them and not check if there is an OutTime is a PM time pair. Also, we wont to try find them So, if only complete are saved, we need a place to save TimeIn. Employee is a good place for this: CREATE TABLE `employee` ( `Id` int(11) NOT datetime DEFAULT NULL, PRIMARY (`empID`) ); Since is the is to you. should be able to do everything in one method and 2-3 When a timeclock event happens: Check the Employee table to there a TimeIn for employee If there is a save the current DateTime If is they going Get the TimeIn into variable INSERT INTO Attendance, using EmpId, TimeIn and DateTime.Now Employee and set the TimeIn to Null Es
_ibfk_1` FOREIGN KEY (`empID`) REFEREnCES `employEe` (`empiD`)
);

A:

youR sChemE is tOo complicated aND resTrictive.  There is no reasoN to reCoRD 2 and ONlY 2 In/OuT pairs pER dAY.  whaT iF sOmeOnE HaS an emErgEncy aftEr lunch - you HavE nOwhere to recoRD a 3Rd time pair.  
a siMpler attendaNce Entity:
cReATe tABLE `AttEndanCe` (
  `empId` Int(11) DEFaULT NULL,
  `TImEin` dateTIme DEFAult NuLL,
  `TImeOut` datetime DEFauLt nULL,
  KEY `empID` (`emPID`),
  CONsTraInt `AttEndAnce_ibfk_1` FOrEiGN KEy (`EmpID`) REfeRenceS `eMPloyee` (`empID`)
);

StOring AM/PM paIRs oF In/Out TiMes DOesnt aLlow fOr THinGs like a doctOr's aPpointmenT after LUnch or oTHer emerGency
THe Pm paIr is JUsT rEpeAtINg tHE Am stRUctUre so it nEeD nOt exiSt
ThE dATE wilL be Part Of the in and Out times, So iTs noT NeeDed
OnLy comPletE, vAlid rEcords (Ones wItH an In and Out time) Will Be saved.  

ThIs wIlL alLoW whatEVer app ProCesSes them To zip thRU thEm AND NoT have to check if therE iS AN OUtTime or If therE Is A Pm Time pair.
alSo, wE wonT HAve to Try aND fInd them

SO, if onlY CoMpLete recOrDs are sAvEd, wE neEd a plACe to Save thE TimeIn.  EMployEE is a good place fOR this:
CREATE TAblE `EMPlOYee` (
  `ID` inT(11) NOT NULL,
  `TimEIn` dATetiMe DEfaUlT NulL,
  PRImARY KeY (`EMpid`)
);

Since this is homeworK, tHe code Is up tO you.  You should Be able to do EVERything iN one MEtHOd and 2-3 queries.  WhEn a tiMeclock eveNT happens:

check The EmploYee table tO SEe if therE is A TiMeIN foR THiS employee
If thERE is nOt A time, saVe tHe curreNt DAtetimE to It

if there is A time, theN tHeY aRe GoiNg out/HOme/doctoR's/JaiL/sOmePlace:

gEt the TImeIn Into A vArIAblE
INSERT inTo aTtenDaNcE, usiNg tHe empId, timeiN anD DateTiMe.Now for tHe oUT timE.
UpDaTE EmplOyee and set the tiMeIn to Null

es
_ibfk_1` FOREIGN KEY (`emp ID`) REFER ENCES  `e mpl oy ee`(`em pID`)
);

A:
Y ourscheme is too complica ted a nd rest r ic tive.   There is n o r ea so n t or ec ord 2  an d only2 In/Out p air sper day.  Wh a tif someone  ha s an emergen cyafterlu nch - you  ha ve no wheret o reco rd a 3rdti m e pair .   
A si m p le r at tendance entity:C RE A TE TABLE `atte ndance `( 
` emp ID`  int(11) D EF AULTN ULL,
 ` Ti m e I n`d atetime DEFAU LT NULL,
 ` Tim eOut`da tet i me DEF AULTNU L L,  KEY `empI D` ( `empID`), 
  CON S TRAINT` attenda nce_ib fk_ 1`FORE I GN  K EY(` e mpI D `)  RE F ERE NCES `em pl oy ee` ( `emp I D ` ) 
);
St orin g AM/ PM pairs of I n/O ut t i mes  does nt al lowfo r thi ngs li ke ado ctor's appointm entafter lun chor  ot he r eme r gencyThe  PM  pair i s justr epe at i n g  t he AM structure so  i t ne ed not e xist
T h eDa t e will b epar t of t he In  and Ou t times,  so it s  n ot  needed 
O nly co mp let e,valid reco rds (o nes with  an I n  and Out time) will be saved .  Th i s wi llallow whate vera pp p roce s se s t h em to  zipth r ut hem and not have to  c heck i f the re is an OutT ime or ift h e re is aPM t i me pair.
Also, we  wont  have to t r y and fi nd th em

So,if only c o m plete re cor dsare  sa v e d,  we need a pl a c e to  s ave the  Ti meIn. Emp loy eeisagood plac e for th is :CR EA TETABLE `employe e`  ( `Id ` int ( 11) NO T NUL L,
 ` Ti m eIn ` datet i me D EFAU LT  N ULL, 
 PR IMARY  KEY (`e mpID`));

Since  th i s is  h om ework,the code is u pto you.  Y ou  sh ould b e able todo everything in one me t hod and  2- 3 que ries .  When a  ti mecloc k e v ent ha ppens: 

Che ck  th e Emplo y e etab le  to see if t her e isaTime In forthis employee
If t h ere  is not a tim e,save t he  cu r re n t D at e Tim e to it

If there  is a time ,t he n they are goi ng  out/ho me/doct or's/ j ail/som eplace:
Get the T im eIni n toa variable 
INSERTINTO Atte n dance ,  u singthe  EmpId ,Tim eIn a nd Dat e Tim e.Now  for t he  out t ime.UP DATE Emp loyee and set the TimeI n to N ull
Es
_ibfk_1` FOREIGN_KEY (`empID`)_REFERENCES `employee` (`empID`)
);

A:

Your scheme_is too_complicated_and restrictive.__There is no_reason to record_2 and only 2_In/Out pairs per_day._ What if someone has an emergency after lunch - you have nowhere to_record_a 3rd_time_pair._ 
A simpler attendance entity:
CREATE_TABLE `attendance` (
  `empID`_int(11) DEFAULT_NULL,
  `TimeIn` datetime DEFAULT NULL,
  `TimeOut`_datetime_DEFAULT NULL,
 _KEY `empID` (`empID`),
  CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`empID`)_REFERENCES `employee` (`empID`)
);

Storing AM/PM pairs of_In/Out times doesnt_allow_for_things like a doctor's_appointment after lunch or other emergency
The_PM pair is just repeating the_AM structure so it need not exist
The_Date will be part of the_In and Out times, so_its not_needed
Only complete, valid records (ones_with an In_and Out_time) will be_saved.  

This will allow whatever_app processes them_to zip thru them and not_have_to check if_there_is_an OutTime_or if there_is_a PM_time_pair.
Also, we wont have to try_and_find them

So, if only complete records are_saved, we need a_place_to save the TimeIn._ Employee is a good_place for this:
CREATE TABLE `employee` (
_ `Id`_int(11) NOT_NULL,
  `TimeIn` datetime DEFAULT NULL,
  PRIMARY KEY (`empID`)
);

Since this_is homework, the code is up_to you.  You_should be_able_to do everything_in_one method_and 2-3 queries.  When a timeclock_event happens:

Check_the Employee table to see if_there is a TimeIn_for_this employee
If there is not a_time, save the current DateTime to_it

If there is a time,_then_they_are going out/home/doctor's/jail/someplace:

Get the TimeIn_into a variable
INSERT INTO Attendance, using_the EmpId, TimeIn_and DateTime.Now for the out time.
UPDATE Employee_and_set the TimeIn to Null

Es