In many scenarios, you may require entering multiple rows by using single query of SQL. In this tutorial, I will show you how to enter two or more records by INSERT INTO statement.Demos and Full Guide
The primary key (or keyword) is used to identify each row in a relational database table. It ensures that the tables do not contain duplicate records.
The primary key consists of one or more columns that contain unique values.
The MySQL DATEDIFF function returns the number of days between two given dates. The DATEDIFF takes two arguments as shown in the example belowDemos and Full Guide
I this tutorial, we will learn how to combine INSERT INTO and SELECT statements for copying the table data from one table to another.Demos and Full Guide
The stored procedure is pre-compiled code of SQL statements that is stored in the database server. The stored procedures enable us writingDemos and Full Guide
The SQL CHARINDEX function is used to return the position of the specified substring in a string. For example, finding the position of ‘@’ in an email address:Demos and Full Guide
This UPDATE command will update whole data in the specified column by new value. For limiting the changes only to the specific records, we use UPDATE with the WHERE clause.Demos and Full Guide
The SQL SUBSTRING function is used to return a part of the string by specified position. For example:
SELECT SUBSTRING(‘SUBSTRING Examples’, 1, 9);
The variables in Transact-SQL are generally used in the batch or stored procedures. The DECLARE statement is used for declaring a variable.Demos and Full Guide
The SQL LIKE operator enables us searching a column by specified pattern. The LIKE uses two wildcards for performing search: (% & _)Demos and Full Guide
The CREATE TABLE command is used to create new table in the Relational databases. This tutorial explains how to create new table, copy table from another table..Demos and Full Guide
The data is stored in the tables in relational database management systems. In order to retrieve data from tables, we use SQL SELECT statement.Demos and Full Guide
The MS SQL CONVERT function enables us changing the data type of expression from one to another. For example:
SELECT CONVERT(varchar, 50.55);
In the case of SQL Server, the IF statement is used to execute SQL statements if a condition is TRUE.
For example: IF @table_name = ’employees’
For returning the date part in a date e.g. day, month, year, hour, minute, second, day of year etc., use the SQL DATEPART function. The DATEPART function takes two arguments, for example:Demos and Full Guide