Showing entries 11 to 20 of 1197
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: sql (reset)
SQL TOP, LIMIT Or ROWNUM Clause Example Tutorial

SQL TOP, LIMIT Or ROWNUM Clause Example Tutorial is today’s topic. SQL SELECT TOP clause is used to specify the number of records to be returned. The SELECT TOP clause is used on large tables having thousands of records because returning a very large number of records that can impact on the performance. The operation performed by TOP, LIMIT, and ROWNUM clause has almost the same functionality.

SQL TOP, LIMIT Or ROWNUM Clause

In some situations, you may not be interested in all of of the rows returned by a query, for example, if you want to retrieve the top 10 employees who have recently joined the organization and get top 3 students by score, or something like that.

If we want to handle such situations, you can use the SQL’s TOP clause in the SELECT statement. However, a TOP clause is only supported by the SQL Server and MS Access database systems. 

Not …

[Read more]
SQL Injection Example | What Is SQL Injection

SQL Injection Example | What Is SQL Injection is today’s topic. An SQL injection is a code injection technique that may lead to destroying your database. It is one of the most common web hacking techniques. It can also be defined as placement of malicious code in SQL statements from a web page input. Attackers can use the SQL Injection vulnerabilities to bypass the application security measures.

#What Is SQL Injection(S.I.)

SQL Injection (SQLi) is the type of injection attack that makes it possible to execute the malicious SQL statements. These statements control the database server behind a web application.

The SQL Injection vulnerability may affect any website or web application that uses the SQL database such as SQL Server, MySQL, Oracle, SQL Server, or others.

Cyber Criminals may use it to gain the unauthorized access to your sensitive data like customer information, personal data, trade …

[Read more]
SQL Views Example | Views In SQL Tutorial Explained In Detail

SQL Views Example | Views In SQL Tutorial is today’s topic. SQL views is a kind of virtual tables which have rows and columns as they are in a real database. A view can be accompanied with all the rows of a particular table or selected rows based on a certain condition. In Structured Query Language, a view is a virtual table based on the result-set of an SQL statement.

SQL VIEWS

SQL view contains rows and columns, just like the real table. The fields in the view are fields from one or more real tables in the database. You can add the SQL functions, WHERE, and JOIN statements …

[Read more]
SQL CREATE INDEX Statement Tutorial With Example

SQL CREATE INDEX Statement Tutorial With Example is today’s topic. SQL CREATE INDEX statement is used to create the indexes in the tables. Indexes are used to retrieve the data from the database very fast. The users cannot see the indexes, and they are just used to speed up the searches/queries. Updating the table with indexes takes more time than updating the table without (because the indexes also need the update). So, only create indexes on the columns that will be frequently searched against.

#What is an Index in SQL

The index is a performance-tuning method of allowing the faster retrieval of records. SQL index creates the entry for each value that appears in the indexed columns. Each index name must be unique in the database.

SQL CREATE INDEX Statement

[Read more]
SQL Truncate Table Statement Tutorial With Example

SQL Truncate Table Statement Tutorial With Example is today’s topic. The DROP TABLE the command deletes a table in the database. Be careful before removing a table and deleting table results in loss of all information stored in the table. The TRUNCATE TABLE command deletes the data inside a table, but not the table itself.

SQL Truncate Table Statement

TRUNCATE statement is the Data Definition Language (DDL) operation that is used to mark the extents of the table for deallocation (empty for reuse).

The result of this operation quickly deletes all the data from the table, typically bypassing the number of integrity enforcing mechanisms. The truncate was officially introduced in SQL:2008 standard.

SQL Truncate performs the same function as a …

[Read more]
SQL Delete Query Tutorial | Delete Statement In SQL Example

SQL Delete Query Tutorial | Delete Statement In SQL Example is today’s topic. The DELETE statement is used to remove existing records in a table. We have already seen the create table, insert row, update row, and now we will see how to remove or delete the row from the SQL table. You can use the WHERE clause with the DELETE query to delete the selected rows; otherwise, all the records would be eliminated.

SQL Delete Query

Delete …

[Read more]
SQL Merge Statement Tutorial With Example | Merge In SQL

SQL Merge Statement Tutorial With Example is today’s topic. SQL MERGE STATEMENT is the combination of INSERT, UPDATE, and DELETE statement. Merge Statement can perform all these operations in our main target table when the source table is provided. MERGE is very useful when it comes to loading the data warehouse tables, which can be very large and require the specific actions to be taken when the rows are or are not present.

SQL Merge Statement

The syntax is following.

MERGE <target_table> [AS TARGET]
USING <table_source> [AS SOURCE]
ON <search_condition>
[WHEN MATCHED 
THEN <merge_matched> ]
[WHEN NOT MATCHED [BY TARGET]
THEN …
[Read more]
How To Add Comments in SQL Query Tutorial With Example

How To Add Comments in SQL Query Tutorial With Example is today’s topic. Comments are used to explain the sections of SQL statements, or to prevent the execution of SQL statements. Comments are not supported in the Microsoft Access databases. Mozilla Firefox and Microsoft Edge are using Microsoft Access database in our examples.

How To Add Comments in SQL

In SQL, you can comment the code just like any other language. Comments can appear on the single line or span across the multiple lines. Let’s explore how to comment on your SQL statements.

Comments can be written in the following formats:

  1. Single line comments.
  2. Multi-line comments
  3. Inline comments

#Syntax #Syntax Using — Symbol

The syntax for creating the comment in SQL using — symbol is the following.

-- comment goes here

[Read more]
SQL LIKE Operator Tutorial With Example

SQL LIKE Operator Tutorial With Example is today’s leading topic. The LIKE operator is used in the WHERE clause to search for the specified pattern in a column. There are two wildcards often used in conjunction with a LIKE operator:

  1. % – Percent sign represents zero, one, or multiple characters.
  2. _ – Underscore represents a single character.

SQL LIKE Operator

The SQL LIKE  is the logical operator that determines if the character string matches the specified pattern. The pattern may include the regular characters and wildcard characters. SQL Like operator is used in the WHERE clause of the …

[Read more]
SQL Constraints Tutorial With Example | Understand SQL Constraints

SQL Constraints Tutorial With Example | Understand SQL Constraints is today’s topic. SQL Constraints are rules used to limit a type of data that can go into the table, to maintain the accuracy and the integrity of a data inside the table. Constraints can be divided into the following two types,

  1. Column level constraints: Limits only the column data.
  2. Table-level constraints: Limits whole table data.

SQL Constraints

Constraints are the set of rules enforced on the data columns of the table. These are used to limit the type of data that can go into the table. It ensures the accuracy, integrity, and reliability of the data in the SQL database.

Constraints in SQL are used to make sure that an integrity of the data is maintained in the database.

See the following most used constraints that can be applied to the table.

[Read more]
Showing entries 11 to 20 of 1197
« 10 Newer Entries | 10 Older Entries »