Featured
-
No Featured Found!
Tags
Query Languages
1. QUEL
It is the query language in the system INGRES. It is based on relational calculus. The fundamental aspect of the query languages based on the relational calculus is tuple variable ( which is a variable that "ranges over&...
Temporary tables
MySQL Temporary tables:
A temporary table allows a user to store temporary records and we can use these records several times until the session does not expire. They are useful in those situations when it is expensive to write a query havin...
SQL commands in database
SQL stands for structured query language. It is used to manage and access data from database.
A database may contain more than one table having unique name for each table.
SQL language have many different versions but it supports most of the co...
Inserting data using replace statement
REPLACE INTO Statement:
It is used to insert a row in a table.It is similar to INSERT INTO statement but it does not allow duplicate row as it replaces the old one with the new one.
Syntax:
REPLACE INTO tablename (column1, column2, col...
Handling Duplicates using INSERT IGNORE
INSERT IGNORE:
INSERT IGNORE is used for handling duplicacy in a table as it ignores the query if the data is already present in the table and if the data does not exist then new row will be inserted.
Syntax:
INSERT IGNORE INTO tablename...
Pattern Matching using REGEXP
REGEXP:
It is similar to LIKE which is used to fetch data based on regular expression from a table.
Syntax:
SELECT columnname(s) FROM tablename WHERE columnname REGEXP pattern;
Example 1:
SELECT name FROM Employee WHERE name R...
Joins In SQL
Joins
There are different type of joins in SQL
1.Inner Join-Return all the values if there is a match in both the table.
2.Outer join
-left outer join-Return all the values from left table and the values matched from the right table.
...
SQL Joins
Joins
Joins in SQL are nothing but a technique to join the two table based on a common field.
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 37 1996-09-19
10310 77 1996-09-20
Custom...
Primary Key
Primary Key
A primary key in a table is a unique key that is the element in this column are unique and can not be null.
It is used to mantain the integrity.
It uniquely identify the row in the table.
It is a constraint on the table.
...
Indexing
The index is used to search the data in a table.
The index is basically a data structure that search our data.
It is applied usually on a column of a table.
It is usually a B-tree but can also be hash table and other depending upon the ...
Referential Integrity
Referential Integrity
Referential Integrity is a concept in which the tables shares a relationship between them and that should be consistent.
Ex:
If we have a table called Employee and the other Employee Salary and columns in them of na...