SQL stands for Structred Query Language. SQL is database language which helps to interact with Relational Database.With the help of SQL we can create, select and manupulate database. In this sql tutorial, I have covered sql topics with example and queries. I have also shared Frequently asked SQL Interview Questions with Answers.
Insert command is used to insert data into database. There are many ways to insert data using insert command and these are following:-
Take table employee having two columns Emp_id and Emp_nameSQL Insert Command
Select command in sql is used to retrieve the data from tables. In this Article we will only discuss how to use the select statement. See the following table which will be used in the select statement:SQL Select command
Null is undefined value. If do not have any data for any column and we also don’t have any default value for that column, then we insert null in that column......SQL is null
Data integrity ensures that the data which is going to enter in the database is reliable, accurate and consistent. Data integrity maintains the correctness and completeness of data.SQL Constraints
Difference between primary key and unique key are as follows: -Continue...
Difference between primary key and Foreign key are as follows: -Primary key v/s foreign-key
Both commands are used to remove data from tables but they have following differences: -delete v/s truncate
Sql is having so many predefined function and aggregate functions are also part of it. These functions are used to summarize the output. For example, if we want to sum any column, find out the maximum or minimum etc. then we can use these functions.sql aggregate function
Like operator in SQL is very important and it is used to search or match the pattern.sql like
Sometimes you need to show data in some groups with some aggregate function. In this situation you can use group by statement.sql group by
If we want to sort the data on the particular column in that case we use order by command. We can sort data either in ascending order or in descending order. By default order by command sorts data in ascending order.sql order by
Sometimes we need to show the data of table in different way at runtime. In this situation we can use case statement with select query.sql case
Range operators are those operators which selects data according to particular range. There are two type of range operator and these are following:-sql range
The top command is used to select the top value from the table. We have to give the number of row with the top command.sql top
When we need to select data from more than one table then we can use joins in SQL Server. We can join two or more tables on the basis of common column between these tables.sql join
The stored procedure is a set of SQL Statements. In stored procedure we can accept the input and return the output. It is pre compiled object. Stored procedure increases the performance of the database as they are pre-compiled.stored procedure
There are following difference between stored procedure and user defined function:-stored procedure v/s function
Triggers can be defined as an area of code Which executes in response of a particular action like insert, update, delete, Create, drop etc. Triggers executes automaticallytriggers
When we need to store data in SQL Server in XML format .in this situation we can use XML Data Type.