Found 140 Articles for SQL

Difference between stored procedure and triggers in SQL

Venu Madhavi
Updated on 22-Jan-2025 17:42:32

19K+ Views

Stored Procedures Stored Procedures is a group of pre-compiled SQL statements that is stored in a database and can be reused anytime. It allows you to do many things in one command. So doing several activities in a database will be easier and quicker than before. A stored procedure can be called from SQL commands as well as applications like Python, Java, or PHP. Syntax Following is the syntax to create a stored procedure − CREATE PROCEDURE procedure_name AS BEGIN -- SQL statements END; Example Let us create a stored procedure where it ... Read More

Difference between correlated and non-collreated subqueries in SQL

Himanshu shriv
Updated on 23-Dec-2024 19:33:52

12K+ Views

SQL query is used to fetch data from the database. In some of the scenario you may need some perquisite data to call subsequent SQL query to fetch data from a table so instead of writing two seperate query we can write SQL query within the query. Therefore subQuery is a way to combine or join them in single query. Subqurey can have two types −Correlated subquery - In correlated subquery, inner query is dependent on the outer query. Outer query needs to be executed before inner queryNon-Correlated subquery - In non-correlated query inner query does not dependent on the outer ... Read More

Difference between hierarchical and network database model in SQL

Himanshu shriv
Updated on 24-Dec-2024 17:56:16

11K+ Views

Hierarchical Data Model In the Hierarchical data model, the relationship between the table and data is defined in parent-child structure. In this structure, data is arranged in the form of a tree structure. This model supports one-to-one and one-to-many relationships. Network Model The Network model arranges data in a graph structure. In this model, each parent can have multiple children, and children can also have multiple parents. This model supports many-to-many relationships as well. Comparison Table ... Read More

Difference between Inner and Outer join in SQL

Himanshu shriv
Updated on 21-Jan-2020 09:41:05

2K+ Views

In Relational database tables are associated with each other and we used foreign key to maintain relationships between tables. We used join clause to retrieve data from associated tables. The join condition indicates how column in each table are matched against each other. There are two types of joins clause in SQL Inner join Outer joinOuter join is again divided into parts −LEFT OUTER JOIN - It will return all data of the left table and matched  records in both table RIGHT OUTER JOIN - it will return all the data of the right table and matched records in both tableSr. No.KeyInner joinOuter join1Basic It ... Read More

Difference between Delete and truncate in sql query

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

18K+ 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

2K+ 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

69K+ 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

897 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

1K+ 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

1K+ 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

Advertisements