To maintain database integrity, Foreign Key constraints are used. A column in a table which is marked as Foreign Key will always point to the Primary Key column of another table. Lets understand this concept with an example. First, we will create 2 tables tblEmployee and tblGender. Syntax for creating tblEmployee and tblGender is given
We have already created a table in previous tutorial. Now, we are going to add some records to it. To add a record in a table, we make use of INSERT INTO statement. You need to specify values followed by column names. Gender column contains integer values because in next tutorial, we are going to
In a database, the data is stored in the form of tables. In a table, there are couple of columns to store the data in an organized manner. One of the column in table is marked as Primary Key. Primary key is basically used to uniquely identify each record in a table. There are various
A database is basically a data structure where all the records are stored in an organized manner. Those records can be retrieved, updated, or deleted using a desktop application or a server-side scripting language like PHP, ASP.net etc. To create a database in SQL, we make use of Create statement. Sample code is given below.
SQL stands for Structured Query Language. It was initially introduced to the world as SEQUEL (Structured English Query Language). Later, its name changed to SQL, but we still pronounce it as SEQUEL. SQL is basically used to communicate with database. There are bunch of SQL statements which can help you in inserting, updating, retrieving, and