Simple Way To Understand Encapsulation And Abstraction

An example using C# //abstraction – exposing only the relevant behavior public interface IMakeFire { void LightFire(); } //encapsulation – hiding things that the rest of the world doesn’t need to see public class Caveman: IMakeFire { //exposed information public string Name {get;set;} // exposed but unchangeable information public byte Age {get; private set;} //internal… Continue reading Simple Way To Understand Encapsulation And Abstraction

RDBMS Keys

I’ll take example of an Employee table: Employee ( Employee ID, FullName, SSN, DeptID ) 1. Candidate Key: are individual columns in a table that qualifies for uniqueness of all the rows. Here in Employee table EmployeeID & SSN are Candidate keys. 2. Primary Key: is the columns you choose to maintain uniqueness in a… Continue reading RDBMS Keys

Cursor In MS Sql – Example

declare @UserId int declare @TrnDate datetime create table #TempAttendance( UserId  int, TrnDate datetime) –select max(UserID) as UserID, cast(TrnDate as date) as TrnDate from UserAttendanceInOut –group by cast(TrnDate as date) insert into #TempAttendance select max(UserID) as UserID, cast(TrnDate as date) as TrnDate from UserAttendanceInOut group by cast(TrnDate as date) –select * from #TempAttendance — Cursor Declaration… Continue reading Cursor In MS Sql – Example