SQL Articles

Page 3 of 12

Difference between hierarchical and network database model in SQL

Himanshu shriv
Himanshu shriv
Updated on 24-Dec-2024 12K+ 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 correlated and non-collreated subqueries in SQL

Himanshu shriv
Himanshu shriv
Updated on 23-Dec-2024 14K+ 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

Embedded SQL, Dynamic SQL, and SQLJ

Amrendra Patel
Amrendra Patel
Updated on 23-Dec-2024 16K+ Views

Embedded SQL Embedded SQL is a method that combines SQL with a high−level programming language's features. It enables programmers to put SQL statements right into the source code files used to set up an application. Database operations may be carried out effortlessly by developers by adding SQL statements to the application code. The source code files having embedded SQL statements should be preprocessed before compilation because of the issue of interpretation of SQL statements by the high−level programming languages in embedded SQL. The terms EXEC SQL and END_EXEC must be used before and after each SQL statement in the source ...

Read More

Embedded SQL in DBMS

Amrendra Patel
Amrendra Patel
Updated on 23-Dec-2024 35K+ Views

Embedded SQL is a powerful method that allows the integration of high−level programming languages with database management systems (DBMS). It acts as a bridge between applications and databases which helps in data manipulation and communication. Various database management systems offer embedded SQL, giving developers the freedom to select the one that best serves their requirements. Popular DBMS that support Embedded SQL are Altibase, IBM Db2, Microsoft SQL Server, Mimer SQL, Oracle Database, PostgreSQL, and SAP Sybase. Need of Embedded SQL The goal to make database interactions simpler for application developers and end users determines the demand for embedded SQL. ...

Read More

SQL Query to Find the Name of a Person Whose Name Starts with Specific Letter

SQL
Mohammed Shahnawaz Alam
Mohammed Shahnawaz Alam
Updated on 18-Dec-2024 9K+ Views

When we work with databases, we often need to search for the name of a Person whose name starts with a specific Letter. We can also find the names of persons whose name starts with a specific letter using SQL. This is possible by using the 'LIKE' operator in SQL, it allows us to do pattern matching on a text. Prerequisites: The following are the prerequisites to understand this tutorial - Basic SQL syntax understanding. A database management tool like MySQL, Oracle SQL or SQLite. What is 'LIKE' Operator? The ...

Read More

SQL Query to Insert Multiple Rows

SQL
Mithlesh Upadhyay
Mithlesh Upadhyay
Updated on 09-Dec-2024 133 Views

When we work with database tables, we need to insert multiple rows into database tables. We can improve the efficiency of SQL queries if we use an efficient method to insert multiple rows into database tables. We can reduce the number of queries sent to the server. We will discuss different methods and their advantages for inserting multiple rows into database tables. You can select your best method depending on your data and your choice. We should follow practices when we insert data into database tables - We should prepare statements for dynamic data to ...

Read More

How to Compare Rows and Columns in the Same Table in SQL

SQL
Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 22-Nov-2024 481 Views

It is not uncommon in SQL to analyze tables vertically or horizontally in an attempt to obtain a solution. This might include establishing a baseline for evaluating successive states, determining boolean variables, or even classifying information without requiring joins over distinct tables. In this article, we explain relevant similarities with examples. Setting Up the Database Let us set up a database with a sample table to illustrate the processes involved in the case studies, this setup will feature the insertion of dummy values to test comparisons. First of all, create a database using the CREATE DATABASE statement − CREATE DATABASE ...

Read More

SQL Query to Compare Two Dates

SQL
Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 21-Nov-2024 391 Views

Working with dates in SQL can be challenging, especially for beginners. We need to make sure that the format of the date values are consistent throughout the queries, whether you're dealing with simple DATE types or complex DATETIME values. This article will walk you through the process of comparing two dates using different approaches, including examples and outputs, ensuring clarity and understanding. In SQL dates are typically stored in DATE or DATETIME format and to compare two dates, we can use comparison operators such as − =: Checks if two dates are equal. : Checks if one date is ...

Read More

SQL Query to Delete Duplicate Rows

SQL
Mithlesh Upadhyay
Mithlesh Upadhyay
Updated on 20-Nov-2024 279 Views

While working with a database to avoid duplicates, we should follow certain practices when we create the database table. Define primary key to identify rows cluster and non-cluster indexes. Use constraints for data integrity in performance. Database tables may have duplicate rows after following best practices. These duplicate rows create issues while we retrieve data from the database. So we must ensure unique database rows. To do so, first of all, we need to verify whether a table has duplicate rows, If duplicate rows exist, we must remove them by altering the table data. This article will ...

Read More

Authentication Bypass using SQL Injection on Login Page

SQL
Guruchandhran M
Guruchandhran M
Updated on 05-Nov-2024 754 Views

SQL Injection is a common security vulnerability. It occurs when an attacker manipulates a web application's database queries by injecting malicious SQL code. One of the most critical areas for SQL Injection exploitation is the login page of an application. When a user enters their credentials, these inputs are typically used to construct a database query to verify the user’s identity. If the application does not properly sanitize these inputs, an attacker can bypass authentication by injecting SQL statements that modify the intended query, granting them unauthorized access. What is SQL Injection? SQL injection is a code injection technique that ...

Read More
Showing 21–30 of 114 articles
« Prev 1 2 3 4 5 12 Next »
Advertisements