SQL stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems.
You can run the following, which will generate a set of ALTER SCHEMA statements for Table and procedure:
Table is a SQL Server object that is used to store related data or information. In table data is logically organized in rows and column format.
In SQL Server, each column, local variable, expression and parameter has a related data type. A data type is an attribute that specifies the type of data that the object can hold. Integer data, character data, monetary data, date and time data, binary strings, and so on...
SQL Server WHERE Clause is used to filter or extract records that fulfill a specified condition from SQL Table.
DML stands for Data Manipulation Language. DML statements are used to manipulate data. The SQL statements that are in the DML category are INSERT, UPDATE and DELETE.
Like operator is used with where clause in SQL Query. Like clause compares with an expression or a pattern using wildcard operators to match pattern in a column.
SQL Keys are important in relational database. A key can be defined as a single or combination of multiple columns in a table. SQL Keys are also used to create relationship between multiple tables. So, in this post we will discuss about the concept and types of keys used in SQL Server.
Primary key is used to uniquely identify the records in a SQL Table. Here we can say, primary key is a value of a column that value is unique in the table. Primary key don't accept any null value. Primary Key is also play an important role to create relationship between two tables.
Unique Key is used to uniquely identify the row in SQL Table. In Unique Key column only one value can be NULL. We can create more than one Unique Key.
Foreign Key is a reference key of Primary Key that is used to create a relationship between two table.
A composite key is a combination of two or more columns in a table that is used to uniquely identify each record in table. When the columns are combined uniqueness but when it taken individually it doesn't guarantee uniqueness.
If any table have more than one candidate key, then after choosing primary key from those candidate key, rest of candidate keys are known as alternate key of table.
The insert into statement is used to insert new record(s) in a table. If we are adding values in the columns of table we need to specify column name and that's values to be insert.
There is several way to insert data from one table to another existing table or we can create another new table and insert all the rows of existing table at same time.
The main functionality of cursor is to retrieve data one row at a time. Means cursor provide a functionality of looping in SQL Server.
In this article, you learn the difference between Stored Procedure and Function. Store procedure and function both are the SQL Server object which contain set of SQL Statements to complete there task. Both are difference from each other. We will discuss all the main differences between function and store procedure.
Function in SQL Server is a object that is used to perform a specific task. Like count of rows in table. Sum of values or finding maximum and minimum values in SQL Tables.
Actually, When we create a column with default value, SQL server creates a default constraint for that default value.
Both delete and truncate is used to remove rows from SQL Table. But in both delete and truncate having significant differences.