Skip to main content

Featured Post

How to use Tabs in ASP.NET CORE

I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component  public class AllViewComponent : ViewComponent     {         private readonly UserManager<ApplicationUser> _userManager;         public AllViewComponent(UserManager<ApplicationUser> userManager)         {             _userManager = userManager;         }         public async Task<IViewComponentResult> InvokeAsync()         {             List<StudentViewModel> allUsers = new List<StudentViewModel>();             var items = await _userManager.Users.ToListAsync();             foreach (var item in items)             {                 allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email });             }            

What are the types of Data Integrity in SQL Programming?

If checks are not applied while defining and creating tables, the data stored in the tables can become redundant. For example, if you do not store the data about all the employees with complete address details, then the data would not be useful.

Similarly, if a database used by the Human Resource department stores employee contact details in two separate tables, the details of the employees might not match. This would results inconsistency and confusion.
Therefore, it is important to ensure that the data stored in tables is complete and consistent. The concept of maintaining consistency and completeness of data is called data integrity. Data integrity is enforced to ensure that the data in a database is accurate, consistent, and reliable. It is broadly classified into the following categories:

  • Entity integrity: ensures that each row can be uniquely identified by an attribute called the primary key column contains unique value in all the rows. In addition, this column cannot be NULL. Consider a situation where there might be two candidates for an interview with the same name ‘Jack’. By enforcing entity integrity, the two candidates can be identified by using the unique code assigned to them. For example, one candidate can have the code 001 and the other candidate can be 002.
  • Domain integrity: Ensures that only a valid range of values is stored in a column. It can be enforced by restricting the type of data, the range of values, and the format of the data. For example, you have a table called Branchoffice with a column called offices are located in ‘Berkeley’, ‘Boston’, ‘Chicago’, ‘Dallas’, ‘Munchen’, ‘New Jersey’, ‘New York’, ‘Paris’, and ‘Washington’. By enforcing domain integrity, you can ensure that only valid values (as per the list specified) are entered in the City column of the BranchOffice TABLE.
  • Referential integrity: Ensures that the values of the foreign key match the value of the corresponding primary key. For example, if a bicycle has been ordered and an entry is to be made in the OrderDetail table, then that bicycle code should exist in the product table. This ensures that an order is placed only for the bicycle that is available.
  • User-defined integrity: Refers to a set of rules specified by a user, which do not belong to the entity, domain, and referential integrity categories.

When creating tables, the SQL Server allows you to maintain integrity by:

  • Applying constraints
  • Applying rules
  • Using user-defined types

Comments

Popular Post

Polynomial representation using Linked List for Data Structure in 'C'

Polynomial representation using Linked List The linked list can be used to represent a polynomial of any degree. Simply the information field is changed according to the number of variables used in the polynomial. If a single variable is used in the polynomial the information field of the node contains two parts: one for coefficient of variable and the other for degree of variable. Let us consider an example to represent a polynomial using linked list as follows: Polynomial:      3x 3 -4x 2 +2x-9 Linked List: In the above linked list, the external pointer ‘ROOT’ point to the first node of the linked list. The first node of the linked list contains the information about the variable with the highest degree. The first node points to the next node with next lowest degree of the variable. Representation of a polynomial using the linked list is beneficial when the operations on the polynomial like addition and subtractions are performed. The resulting polynomial can also

How to use Tabs in ASP.NET CORE

I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component  public class AllViewComponent : ViewComponent     {         private readonly UserManager<ApplicationUser> _userManager;         public AllViewComponent(UserManager<ApplicationUser> userManager)         {             _userManager = userManager;         }         public async Task<IViewComponentResult> InvokeAsync()         {             List<StudentViewModel> allUsers = new List<StudentViewModel>();             var items = await _userManager.Users.ToListAsync();             foreach (var item in items)             {                 allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email });             }            

Memory representation of Linked List Data Structures in C Language

                                 Memory representation of Linked List              In memory the linked list is stored in scattered cells (locations).The memory for each node is allocated dynamically means as and when required. So the Linked List can increase as per the user wish and the size is not fixed, it can vary.                Suppose first node of linked list is allocated with an address 1008. Its graphical representation looks like the figure shown below:       Suppose next node is allocated at an address 506, so the list becomes,   Suppose next node is allocated with an address with an address 10,s the list become, The other way to represent the linked list is as shown below:  In the above representation the data stored in the linked list is “INDIA”, the information part of each node contains one character. The external pointer root points to first node’s address 1005. The link part of the node containing information I contains 1007, the address of