Category Archives: SQL Commands

SQL OVER() with PARTITION BY – Clause for Gourmets With Examples

OVER clause can belong to commands working with so-called Window functions in SQL. These types of functions enable us to look at the data not only in their aggregated form (using GROUP BY), but we can also look at functional operations via multiple other attributes. We, in fact, create windows of some sort and we… Read More »

SQL INSERT – Inserting Rows into Database Table (3 methods) + Common mistakes

SQL Command INSERT is suitable for situations when we want to insert entries into the table. Insertion of rows can be done in multiple ways (further description below): You can insert the values that you fixedly choose (INSERT INTO … VALUES (value1, value2, …)) You can insert the values into the table using script (SELECT… Read More »

SQL | Triggers in SQL Server – Definition, Types, Syntax and Examples

A trigger is a database object (procedure) that works as a watchdog for certain event. Using database triggers we can catch this event and initiate some additional action – such as logging or rejecting the action. The event that initiates the action may be: INSERT or UPDATE records in the table DELETE records from the… Read More »