Skip to main content

Posts

Showing posts from January, 2022

How to passing data table as parameter to stored procedures for SQL servers

  In this article, we will learn how to passing data table as parameter to stored procedures for SQL servers with different examples.   A stored procedure is a bunch of statements that stored in the database. stored procedures accept the parameters and execute the T-SQL statements in procedure and get the result returns.    Read also: SQL Between   Stored procedures are easy to edit or modify code inside and the stored procedure without needed to restart the application. And easily eliminate the storing the code anytime in the database. and needed to change the logic in procedure just use Alter procedure statement. Passing Data table as Parameter to Stored Procedures for SQL Server are the name of over the network that different of writing T-SQL Queries and Reduced the network traffic.    stored procedures are reusable and can be executed the multiple users without code again.    The applications need to make multip...

How to create a random captcha Generator

In this tutorial, we are going to learn how to create a random captcha generator . In the HTML using a form tag creating a register form.    Most of the time the allowing users are entering into a website or registering data into our website.    We just need to know the users are bots or humans. If the bots are easy to insert the bulk of records without permission and push in the database.    sometimes the bots are inserted malicious file to access hackers like SQL injection and the process make a lot of problem on our website.    Captcha is the only way to filter the humans and bots prevent access before sending data.    For example, Create a random captcha generate code.   Here, I have created a contact form using HTML and PHP to manage captcha sessions.    HTML create a input tag and named as Name, Email, Mobile No, Gender.     In the HTML select tags are performs option method and ...

this keyword in JavaScript

The this keyword, is an extremely important concept to understand in JavaScript. And many beginners, find it especially difficult. But don't worry, It's actually not that much hard if you know exactly how the this Keyword works.     So, the this keyword or this variable is basically a special variable in JavaScript that is created for every execution context and therefore any function. In fact, we learned before that it's one of the three components of any execution context, along with the variable environment and scope chain that we are learned about next aticles .  Read also: Funciton in Javascript with Examples This keyword Now, in general terms, the this keyword, will always take the value of the "owner" of the function (owner of the function means that assigned method and follows) in which, the this keyword is used. We also say, that it points to the owner of that function.    And that sounds very abstract but we will see what that means in a foll...

SQL cross Join with Examples

A SQL cross join is a join that produces a cartesian product combine one or two tables. In a mathematical operation that returns multiple sets and pairs. Let's think we have two table m and n.and have three rows A, B, C, and the second table have x,y,z. ok, Now we are going to use the mathematical method of cartesian in SQL. table 1- A,B,C table 2- X,Y,Z SQL CROSS JOIN As a result of cross join: (A,X),(A,Y),(A,Z), (B,X),(B,Y),(B,Z), (C,X),(C,Y),(C,Z); Now, you will little bit understand how the SQL cross join works. After the performing of the result of the cross join between the two tables that illustrate the cartesian product has 9 rows. Let's see the syntax of SQL cross join operation: SQL CROSS JOIN Syntax:   SELECT column1,column2.... FROM table1,table 2; SQL CROSS JOIN Examples: Here, we are create a two table Animals and Hungry table for demonstrate purpores and how it's works on cross Join. Animals Table:   CREATE TABLE animals( id int primary key identity(1,...

SQL select

The SQL SELECT statement is used in the SQL command and it's is used in the database to retrieve the selected data by the conditions in queries. In the SQL select statements have wanted to select data from one or more tables by the basic syntax. This syntax for a single table :   SELECT columns_list or select FROM table_name; Here, the columns_list are the fields that table values want to retrieves. If we want to fetch all the data from the table then you can use the Asterix '*' and follow the syntax. And this is the shorthand for calling all the columns in the table.     SELECT * FROM table_name; Here I created a table named as customers in SQL Server    Here the sample table Database to Download     cust_id cust_name age city 1 Rahul 18 vellore 2 Anbu 26 chennai 3 ...

SQL Union

In this tutorial, we are going to learn how to use the SQL UNION operator. An SQL union operator is used to combine two or more result sets from multiple queries.   Table of Contents:    Union  Union All   Subquery with Union   Subquery with Union All Union syntax: SELECT column1,column2,column3 FROM table_name 1 UNION SELECT column4,column5 FROM table_name 2; Union All syntax: SELECT column1,column2,column3 FROM table_name 1 UNION ALL SELECT column4,column5 FROM table_name 2; Use of the SELECT statements and the keyword join them by UNION OR UNION ALL   Union: In the database system, the query to executing two select statements and then combines the two results set into one and eliminates the duplicate rows by using UNION keywords. UNION Keywords are sorting the combined result from the table and set by every column matching the rows and eliminating it.    Here ,I just created tables in sql server customer,or...

SQL Having

  In this tutorial, we are going to learn how to use SQL having clause to details table and query into group and apply aggregate function in having clause.      The HAVING clause is used with the GROUP BY clause on the select statement query. Without a GROUP BY clause has having clause can't use. Having clause behave like the where clause. SQL HAVING Clause Syntax: SELECT column_names from table WHERE condition GROUP BY column_names HAVING condition you will see the having clause appears after the group by clause. SQL HAVING vs WHERE Clause:  The WHERE clause applies the condition to filter individual rows before groups by clause. The GROUP BY clause details the row s into matches groups. However, the HAVING clauses apply the condition to the groups after the rows are grouped into groups. SELECT column_names FROM table WHERE condition GROUP BY column_names HAVING condition ORDER BY column_names H...