SQL Server - Minify Code Tutorials

Date and Time Conversions Using SQL Server

2021-10-03 SQL Server

Date and Time Conversions Using SQL Server - In this article, how will convert date and time in SQL, first considerations is the actual date/time needed. The most common is the current date/time using getdate(). This provides the current date and time according to the server providing the date and time. If a universal date/time is needed, then getutcdate() should be used.

Read More...

NULL VALUES and NULL FUNCTIONS in SQL

2020-05-25 SQL Server

NULL VALUES and NULL FUNCTIONS in SQL:- In this article, If we do not fill any data in any field if it is not required or we can say that if that field is optional then by default, a table column hold NULL value. You know that NULL value means 0 (Zero), Empty cell, empty, missing, or unknown data.

Read More...

Cursor in SQL

2020-05-15 SQL Server

Cursor in SQL may be a set of rows along side a pointer that identifies a current row. it's a database object to retrieve data from a result set one row at a time. it's useful once we want to control the record of a table during a singleton method, in other words one row at a time. use of a cursor in SQL, types of the cursor in SQL, cursor in SQL example with a stored procedure, sql server cursor example multiple columns, sql server cursor for update, trigger and cursor in sql, cursor in pl/sql, types of cursor in SQL, cursor in SQL minify code, cursor in SQLserver, cursor in SQL, nested cursor in SQLserver.

Read More...

SQL ALTER TABLE Statement

2020-05-12 SQL Server

SQL ALTER TABLE statement is used to modify the table structure, you can modify column(s), add column(s), drop column(s) or work on constraints. Here we will use tbl_employee table for practice. In this table we will add Address column, so we can write below query.

Read More...

CASE statement in SQL

2020-05-11 SQL Server

CASE statement in SQL, The CASE statement goes through conditions and returns a value when the first condition is ( IF-THEN-ELSE statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause.

Read More...

SQL Group By Clause

2020-05-07 SQL Server

SQL Group By Clause. Group by clause is used to group the results of a SELECT query based on one or more columns. It is also used with SQL functions to group the result from one or more tables.

Read More...

SQL UNION Operator

2020-05-07 SQL Server

The SQL UNION operator is employed to mix the result sets of two or more SELECT statements. It removes duplicate rows between the varied SELECT statements. Each SELECT statement within the UNION must have an equivalent number of fields within the result sets with similar data types.

Read More...

SQL Aliases

2020-04-26 SQL Server

SQL Aliases, It is used when the name of a column or table is used other than their original names, but the modified name is only temporary, Aliases are the temporary names given to the table or column for the purpose of a particular SQL query.

Read More...

SQL Wildcard

2020-04-26 SQL Server

SQL Wildcard, They are used just as LIKE operator, and also WHERE clause to search for a mere pattern in a column, The wildcard in SQL is used in a string to substitute characters.

Read More...

SQL DROP TABLE Statement

2020-04-14 SQL Server

SQL DROP TABLE statement is used to remove table in a database. When you use the SQL DROP TABLE statement to remove a table, the database engine deletes all objects associated schema to that table including data, indexes, constraints, table structure, triggers

Read More...

WHERE Keyword in SQL Server

2020-04-10 SQL Server

WHERE Keyword in SQL Server, In this post, The SQL WHERE keyword is used to select data conditionally, by adding it to already existing SQL SELECT query. The WHERE keyword can be used to select, update and delete data from table, but for now we will stick with conditionally retrieving data, as we already know how to use the SELECT keyword

Read More...

SQL Drop Database

2020-04-07 SQL Server

SQL Drop DataBase: The DROP DATABASE Statement is used to drop or delete a database. Dropping of the database will drop all database objects (tables, procedures, views, function etc.) inside it. The user should have admin privileges for deleting a database.

Read More...

EXISTS Keyword in SQL Server

2020-04-02 SQL Server

EXISTS Keyword in SQL Server: The SQL EXISTS condition is used to test for a subquery and is considered to be met, if the subquery returns at least one row. It can be used in a SELECT, INSERT, UPDATE, or DELETE statement.

Read More...