Found 118 Articles for SQL

Difference between Primary key and Foreign key in SQL Database

Himanshu shriv
Updated on 21-Jan-2020 09:38:32

1K+ Views

In the relationaltonal database key is the most important element to maintain the relationship between two tables or to uniquely identify data from the table. Primary key is used to identify data uniquely therefore two rows can’t have the same primary key. It can’t be null.On the other hand, foreign key is used to maintain relationship between two tables. Primary of a table act as forgein key in the other table. Foreign key in a table enforce Referential Integrity constraint. It can be more than one in the table.Sr. No.KeyPrimary KeyForeign Key1Basic It is used to uniquely identify data in the ... Read More

Difference between Delete and truncate in sql query

Kiran Kumar Panigrahi
Updated on 04-Aug-2022 07:36:51

16K+ Views

Both the TRUNCATE statement and the DELETE statement are included in the category of SQL queries for deleting the data stored in a table. They carry out deletion operations on records or rows of a table that are no longer needed. A condition is applied before each entry in the table that is being deleted when using the DELETE command. To put it another way, it is possible to delete one or more rows all at once. However, with the TRUNCATE command, each row is removed from the table simultaneously. When we delete something using the DELETE query, a log ... Read More

What is NoSQL and is it the next big trend in databases?

Sharon Christine
Updated on 16-Jan-2020 11:13:44

968 Views

What is NoSQL?As per the official Wiki definition: “A NoSQL (originally referring to “non SQL” or “non relational”) database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relation databases (RDBMS). It encompasses a wide variety of different database technologies that were developed in response to a rise in the volume of data stored about users, objects and products, the frequency in which this data is accessed, and performance and processing needs. Generally, NoSQL databases are structured in a key-value pair, graph database, document-oriented or column-oriented structure.Over decades ... Read More

Difference between Function and Procedure

Kiran Kumar Panigrahi
Updated on 02-Sep-2023 11:42:06

58K+ Views

SQL (Structured Query Language) is a computer language which is used to interact with an RDBMS (Relational Database Management System). It is basically a method of managing, organizing, and retrieving data from a relation database. In SQL, two important concepts are used namely, function and procedure. A function calculates the results of a program based on the inputs provided, whereas a procedure is used to perform some tasks in a specific order. There are many other differences between functions and procedures, which we will discuss in this article. What is Function? A function, in the context of computer programming languages, ... Read More

Print pyramid of tutorialspoint in PL/SQL

Sunidhi Bansal
Updated on 09-Aug-2019 06:19:06

676 Views

PL/SQL stands for “Procedural Language extension to SQL” . It is the mixture of SQL and Procedural features provided by programming language. It was developed by Oracle Corporation in the late 1980s as procedural extension language for SQL and the Oracle relational database.PL/SQL programs consists of blocks that can be nested and a block structure look likes this −DECLARE    -- it contains declaration statements BEGIN    -- It contains executable statements EXCEPTIONS    -- It contains exception handling statements END;ExampleIn PL/SQL single-line comments begin with double hyphen(--) and Multi-line comments begin with a slash-asterisk ( /* ) and end ... Read More

How to pass a date variable in sql query in a JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25

859 Views

The tag is used as a nested action for the and the tag to supply a date and time value for a value placeholder. If a null value is provided, the value is set to SQL NULL for the placeholder.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueValue of the date parameter to set (java.util.Date)NoBodytypeDATE (date only), TIME (time only), or TIMESTAMP (date and time)NoTIMESTAMPExampleTo start with basic concept, let us create a simple table Students table in the TEST database and create a few records in that table as follows −Step 1Open a Command Prompt and change ... Read More

How to use parameterized SQL query in a JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

836 Views

The tag used as a nested action for the tag and the tag to supply a value for a value placeholder. If a null value is provided, the value is set to SQL NULL for the placeholder.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueValue of the parameter to setNoBodyExampleTo start with the basic concept, let us create an Employees table in the TEST database and create few records in that table as follows −Step 1Open a Command Prompt and change to the installation directory as follows −C:\> C:\>cd Program Files\MySQL\bin C:\Program Files\MySQL\bin>Step 2Login to the database as ... Read More

How to execute DELETE SQL in a JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25

631 Views

The tag executes an SQL statement that does not return data; for example, SQL INSERT, UPDATE, or DELETE statements.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultsqlSQL command to execute (should not return a ResultSet)NoBodydataSourceDatabase connection to use (overrides the default)NoDefault databasevarName of the variable to store the count of affected rowsNoNonescopeScope of the variable to store the count of affected rowsNoPageExampleTo start with basic concept, let us create a simple table Employees table in the TEST database and create few records in that table as follows −Step 1Open a Command Prompt and change to the installation directory as follows ... Read More

How to execute UPDATE SQL in a JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

1K+ Views

The tag executes an SQL statement that does not return data; for example, SQL INSERT, UPDATE, or DELETE statements.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultsqlSQL command to execute (should not return a ResultSet)NoBodydataSourceDatabase connection to use (overrides the default)NoDefault databasevarName of the variable to store the count of affected rowsNoNonescopeScope of the variable to store the count of affected rowsNoPageExampleTo start with basic concept, let us create a simple table Employees table in the TEST database and create few records in that table as follows −Step 1Open a Command Prompt and change to the installation directory as follows ... Read More

How to execute SQL update query in a JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25

340 Views

The tag executes an SQL statement that does not return data; for example, SQL INSERT, UPDATE, or DELETE statements.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultsqlSQL command to execute (should not return a ResultSet)NoBodydataSourceDatabase connection to use (overrides the default)NoDefault databasevarName of the variable to store the count of affected rowsNoNonescopeScope of the variable to store the count of affected rowsNoPageExampleTo start with basic concept, let us create a simple table Employees table in the TEST database and create few records in that table as follows −Step 1Open a Command Prompt and change to the installation directory as follows ... Read More

Advertisements