Home
Search results “Oracle update with select sql” for the 2013
SQL Tutorial - 21: The UPDATE Query
 
06:12
In this tutorial we'll check out the UPDATE Query which is used to update/change records in a table.
Views: 83396 The Bad Tutorials
SQL Tutorial - 13: Inserting Data Into a Table From Another Table
 
07:00
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Views: 241317 The Bad Tutorials
Database Tutorial 66 - SQL UPDATE Statement - Oracle DBA Tutorial
 
02:52
Database Tutorial 65 - SQL UPDATE Statement - Oracle DBA tutorial, Oracle Database Tutorial This video explains about SQL UPDATE Statement
Views: 343 Sam Dhanasekaran
Find Duplicate Rows in SQL - Select Statement Tutorial
 
02:06
Find duplicate row values in a field or multiple fields in SQL Server table with this tutorial. Do this for one column, or multiple columns. Uses SQL Server Management Studio for the demonstration.
Views: 41863 Edward Kench
SQL Tutorial - 9: Create Table Statement
 
07:48
In this tutorial we'll learn to create tables in SQL using the CREATE TABLE Statement.
Views: 297691 The Bad Tutorials
SQL Tutorials by Kash - Using SQL Update statement in MS SQL 2012
 
14:36
http://sqlserver2012tutorial.com/faqs/ In this SQL tutorial by Kash, we go over the SQL update statement using MS SQL 2012. This is used to modify data in a table. We first cover the syntax of the update query and then we go over some examples of update command including the following: -Update single and multiple fields or columns in the CUSTOMERS table -Modify multiple rows or records in the ORDERS table Finally we change data in one table with information from another table. Specifically we are going to modify shipcountry column in ORDERS table with information from the CUSTOMERS table. For these exercises we will use Northwind sample database in SQL server 2012. Visit our site for more sql tutorials and tips.
Views: 1379 baghul
SQL Tutorial - 24: The TOP and LIMIT Clauses
 
03:38
In this tutorial we'll see how we can use the LIMIT Clause in the MySQL environment to control the number of records that are returned in the result set of a query.
Views: 42204 The Bad Tutorials
SQL Tutorial - 12: Inserting Data Into Tables
 
10:10
In this tutorial we'll learn to insert data into tables using the INSERT INTO statement.
Views: 160511 The Bad Tutorials
SQL Server - How to Update Statement using Select Query (tr)
 
02:59
SQL Server - How to Update Statement using Select Query
Database Testing online training videos - Basics of Database testing - SQL
 
38:15
Introduction to Data and Database Agenda: What is data Importance of data` Where is data stored What is a database --collection of data TYPES OF DATABASES MICROSOFT SQL SERVER ORACLE DB2 FROM IBM SYBASE MYSQL Definition of SQL DDL COMMANDS - DATA DEFINITION LANGUAGE CREATE ALTER DROP DML COMMANDS - DATA MANIPULATION LANGUAGE INSERT UPDATE DELETE --structured query language Sample Application: http://www.deal4loans.com/ Viewing the data in the database Conclusion Future Sessions
Views: 48334 Qatestingtraining
Subqueries in sql   Part 59
 
14:34
In this video we will discuss about subqueries in sql server. Let us understand subqueris with an example. Please create the required tables and insert sample data using the script below. Create Table tblProducts ( [Id] int identity primary key, [Name] nvarchar(50), [Description] nvarchar(250) ) Create Table tblProductSales ( Id int primary key identity, ProductId int foreign key references tblProducts(Id), UnitPrice int, QuantitySold int ) Insert into tblProducts values ('TV', '52 inch black color LCD TV') Insert into tblProducts values ('Laptop', 'Very thin black color acer laptop') Insert into tblProducts values ('Desktop', 'HP high performance desktop') Insert into tblProductSales values(3, 450, 5) Insert into tblProductSales values(2, 250, 7) Insert into tblProductSales values(3, 450, 4) Insert into tblProductSales values(3, 450, 9) Write a query to retrieve products that are not at all sold? This can be very easily achieved using subquery as shown below. Select [Id], [Name], [Description] from tblProducts where Id not in (Select Distinct ProductId from tblProductSales) Most of the times subqueries can be very easily replaced with joins. The above query is rewritten using joins and produces the same results. Select tblProducts.[Id], [Name], [Description] from tblProducts left join tblProductSales on tblProducts.Id = tblProductSales.ProductId where tblProductSales.ProductId IS NULL In this example, we have seen how to use a subquery in the where clause. Let us now discuss about using a sub query in the SELECT clause. Write a query to retrieve the NAME and TOTALQUANTITY sold, using a subquery. Select [Name], (Select SUM(QuantitySold) from tblProductSales where ProductId = tblProducts.Id) as TotalQuantity from tblProducts order by Name Query with an equivalent join that produces the same result. Select [Name], SUM(QuantitySold) as TotalQuantity from tblProducts left join tblProductSales on tblProducts.Id = tblProductSales.ProductId group by [Name] order by Name From these examples, it should be very clear that, a subquery is simply a select statement, that returns a single value and can be nested inside a SELECT, UPDATE, INSERT, or DELETE statement. It is also possible to nest a subquery inside another subquery. According to MSDN, subqueries can be nested upto 32 levels. Subqueries are always encolsed in paranthesis and are also called as inner queries, and the query containing the subquery is called as outer query. The columns from a table that is present only inside a subquery, cannot be used in the SELECT list of the outer query. Next Video: What to choose for performance? Queries that involve a subquery or a join Text version of the video http://csharp-video-tutorials.blogspot.com/2013/01/subqueries-in-sql-part-59.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-59-subqueries-in-sql-server.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 199545 kudvenkat
Introduction to Oracle: PL-SQL - Manipulating Table Data with DML Statements
 
04:46
Introduction to Oracle: PL-SQL - Manipulating Table Data with DML Statements
Views: 404 David Hays
SQL Tutorial - 10: Creating Tables from Other Tables
 
05:51
In this tutorial we'll learn to use the CREATE TABLE statement to create a table using a preexisting table in the database. Hope you guys had fun watching the tutorial!
Views: 104124 The Bad Tutorials
What is a Materialized View?
 
06:10
http://zerotoprotraining.com This video explains the concept of a materialized view in a database also known as materialized query table an indexed view. Category: Databases Tags: Materialized View
Views: 104968 HandsonERP
BULK COLLECT and FORALL-A PL/SQL Performance Booster
 
25:07
In this Video Tutorial, I have covered 2 great feature in Oracle PL/SQL - BULK COLLECT and FORALL with some demos.
Views: 53696 Anindya Das
Oracle username and password and Account unlocking
 
08:37
all education purpose videos
Views: 269149 Chandra Shekhar Reddy
SQL SELECT command I
 
04:59
How to use SQL to SELECT records from a MySQL table.
Views: 125 mobileAppDesignDev
Sql 2012 Update set Statement
 
04:10
Sql Server tutorial using update set operator.
Views: 213 Paul Juverdeanu
C# Tutorial 7: Edit/Update a data from Database with button
 
13:46
------------------Online Courses to learn---------------------------- Java - https://bit.ly/2H6wqXk C++ - https://bit.ly/2q8VWl1 AngularJS - https://bit.ly/2qebsLu Python - https://bit.ly/2Eq0VSt C- https://bit.ly/2HfZ6L8 Android - https://bit.ly/2qaRSAS Linux - https://bit.ly/2IwOuqz AWS Certified Solutions Architect - https://bit.ly/2JrGoAF Modern React with Redux - https://bit.ly/2H6wDtA MySQL - https://bit.ly/2qcF63Z ----------------------Follow--------------------------------------------- My Website - http://www.codebind.com My Blog - https://goo.gl/Nd2pFn My Facebook Page - https://goo.gl/eLp2cQ Google+ - https://goo.gl/lvC5FX Twitter - https://twitter.com/ProgrammingKnow Pinterest - https://goo.gl/kCInUp Text Case Converter - https://goo.gl/pVpcwL -------------------------Stuff I use to make videos ------------------- Stuff I use to make videos Windows notebook – http://amzn.to/2zcXPyF Apple MacBook Pro – http://amzn.to/2BTJBZ7 Ubuntu notebook - https://amzn.to/2GE4giY Desktop - http://amzn.to/2zct252 Microphone – http://amzn.to/2zcYbW1 notebook mouse – http://amzn.to/2BVs4Q3 ------------------Facebook Links ---------------------------------------- http://fb.me/ProgrammingKnowledgeLearning/ http://fb.me/AndroidTutorialsForBeginners http://fb.me/Programmingknowledge http://fb.me/CppProgrammingLanguage http://fb.me/JavaTutorialsAndCode http://fb.me/SQLiteTutorial http://fb.me/UbuntuLinuxTutorials http://fb.me/EasyOnlineConverter ------------------------------------------------------------------------------------- How to update/edit data using Visual C# Update the data in a database C# edit data in mysql database Visual C# Update a MySQL database field data with C# select,edit,delete,update data in datagridview control[c#] How To Update a SQL Server Database by Using How to use a ComboBox control to edit data How to Edit Data Update and Delete data in database Tutorial how to how can I
Views: 131717 ProgrammingKnowledge
StoredProcedure Update
 
02:21
stored procedure,ict 130,web dev't and internet technology,update statement
Views: 2538 Arnie Mateo
SQL Inner Join Multiple Tables with SUM Tutorial - SQL 2008/2012/2016/2017
 
18:03
Use inner joins with multiple tables to create reports. Uses aliases, and the SUM aggregate function to demonstrate the flexibility of the join statement. Get the SQL script to create the database and run the exercies in the video here: https://www.qewbi.com/sql/scripts/qewbijoins.zip
Views: 133404 Edward Kench
Database Tutorial 63 - SQL SELECT Statement - Oracle DBA Tutorial
 
06:28
Database Tutorial 63 - SQL SELECT Statement - Oracle DBA tutorial, Oracle Database Tutorial This video explains about SQL SELECT Statement
Views: 1420 Sam Dhanasekaran
How Oracle SQL Query Process
 
39:10
For complete professional training visit at: http://www.bisptrainings.com/course/Oracle-Fundamentals-and-PL-SQL-for-beginners Follow us on Facebook: https://www.facebook.com/bisptrainings/ Follow us on Twitter: https://twitter.com/bisptrainings Email: [email protected] Call us: +91 975-275-3753 or +1 386-279-6856
Views: 23023 Amit Sharma
Oracle SQL DDL and DML Basic Tutorial through scripting.
 
16:34
Creating Tablespace, User, Tables and using insert, update and delete statement on tables
Views: 1860 Subhroneel Ganguly
Introduction to Oracle: PL-SQL Table Updates
 
07:01
Introduction to Oracle: PL-SQL Table Updates. See www.mathheals.com for more videos
Views: 578 David Hays
Using Cursor in Oracle PL SQL
 
10:04
Using Cursor in Oracle PL SQL By Dr. RD Balaji Help us caption & translate this video! http://amara.org/v/DWUs/
Connect Excel to Oracle Database
 
05:03
How to connect an Oracle Database to Microsoft Excel. https://www.elance.com/s/edtemb/
Views: 98047 i_marketing
SQL Tutorial - 22: The DELETE Query
 
04:07
In this tutorial we'll see in action the DELETE Query which is used to remove records from a table in the database.
Views: 43091 The Bad Tutorials
How to Use SQL Server with VB6 (inc. select & insert)
 
16:50
This video shows how to create a simple 1 table database in SQL Server Management Studio and then use Visual Basic 6.0 to access it and insert new records in a simple program. The download link to Microsoft SQL Server Express 2008 R2 can be found on my blog: http://www.martin2k.co.uk/blog/2013_08.php
Views: 48748 Martin Allen
How to Create and Drop Table in SQL
 
01:53
Follow this easy step by step easy tutorial to learn how to create and drop table in SQL Server via Query Editor. Don't forget to check out our site http://howtech.tv/ for more free how-to videos! http://youtube.com/ithowtovids - our feed http://www.facebook.com/howtechtv - join us on facebook https://plus.google.com/103440382717658277879 - our group in Google+ In this tutorial we will guide you on creating tables in SQL Server. As we know, the main components in databases are the tables, in which the data actually resides. Tables contain rows and columns, where columns act like the entity identifiers such as employee name, employee salary etc and rows contain the data values for those entities. So in this tutorial we will see how to create tables in SQL Server. Step 1 -- Navigating to the Desired Database Creating tables in SQL server is very easy. It can be done via commands which have to be written in the Query Editor. For that, first of all, let's move to the database where the table has to be created. Expand the Databases folders from top and further expand the required database inside which table has to be created. After that, right click on that Database and open up the Query Editor. Step 2 -- Creating Table In the Query Editor we will write the following queries: create table Inventory ( ID int, Product varchar(50), Quantity int, Price decimal (18,2) ); The query here means that we are interested to create a new table which would be called Inventory. It will have an ID column for the Product Ids and its Data type would be an Integer. It will have a column for Products containing the product names, so its data type would be Varchar. It will also contain a Quantity field with Integer set as its data type And last of all, a column for Price that will accept data as real numbers. Therefore we will declare its type as decimal and set its maximum length as 18 with a precision of 2 decimal places. After that is done, click on the Execute Button on top. A message will appear below the Query Editor that the query has been executed successfully. Step 3 -- Identifying the Table Now for verifying whether the table has been made, just click on the Tables icon and then on the Refresh Icon, located under the Object Explorer. With that done, our newly created Inventory table would appear over there. Click on the Inventory table and expand its columns. The fields would appear to be created exactly like we had mentioned in the query earlier. Step 4 -- Drop Table Now let's move on to how to drop tables in SQL. To delete a table and all of its contents, we use the DROP table command in SQL. Over here, let's drop the table we just made. For that, simply write: drop table Inventory With that done, let's execute the command. Now when we will Refresh the Object Explorer, we can see that the Inventory table has been deleted. And that was how to create table in SQL.
Database Tutorial 64 - SQL INSERT Statement - Oracle DBA Tutorial
 
04:32
Database Tutorial 64 - SQL INSERT Statement - Oracle DBA tutorial, Oracle Database Tutorial This video explains about SQL INSERT Statement
Views: 743 Sam Dhanasekaran
SQL - част II - групиране, агрегатни функции, UPDATE, INSERT, DELETE
 
01:46:28
Лекция: SQL - част II - групиране, агрегатни функции, UPDATE, INSERT, DELETE Курс: Бази данни Лектор: Светлин Наков Дата: 10.07.2013 Уебсайт на Академията на Телерик: http://academy.telerik.com Следете за предстоящи безплатни обучения на Академията на Телерик във Facebook: http://www.facebook.com/TelerikAcademy.
Views: 3886 Telerik Academy
C# Tutorial 6:  Insert/Save data to database
 
13:48
------------------Online Courses to learn---------------------------- Java - https://bit.ly/2H6wqXk C++ - https://bit.ly/2q8VWl1 AngularJS - https://bit.ly/2qebsLu Python - https://bit.ly/2Eq0VSt C- https://bit.ly/2HfZ6L8 Android - https://bit.ly/2qaRSAS Linux - https://bit.ly/2IwOuqz AWS Certified Solutions Architect - https://bit.ly/2JrGoAF Modern React with Redux - https://bit.ly/2H6wDtA MySQL - https://bit.ly/2qcF63Z ----------------------Follow--------------------------------------------- My Website - http://www.codebind.com My Blog - https://goo.gl/Nd2pFn My Facebook Page - https://goo.gl/eLp2cQ Google+ - https://goo.gl/lvC5FX Twitter - https://twitter.com/ProgrammingKnow Pinterest - https://goo.gl/kCInUp Text Case Converter - https://goo.gl/pVpcwL -------------------------Stuff I use to make videos ------------------- Stuff I use to make videos Windows notebook – http://amzn.to/2zcXPyF Apple MacBook Pro – http://amzn.to/2BTJBZ7 Ubuntu notebook - https://amzn.to/2GE4giY Desktop - http://amzn.to/2zct252 Microphone – http://amzn.to/2zcYbW1 notebook mouse – http://amzn.to/2BVs4Q3 ------------------Facebook Links ---------------------------------------- http://fb.me/ProgrammingKnowledgeLearning/ http://fb.me/AndroidTutorialsForBeginners http://fb.me/Programmingknowledge http://fb.me/CppProgrammingLanguage http://fb.me/JavaTutorialsAndCode http://fb.me/SQLiteTutorial http://fb.me/UbuntuLinuxTutorials http://fb.me/EasyOnlineConverter -------------------------------------------------------------------------------- How to: Insert New Records into a Database Database Access with Visual C#.NET sql server - Insert Data into database in C# How to insert Data to Ms SQL server 2008 using C#.net .net - C# insert data into SQL table Using Visual C# and SQL cannot insert data into table..‎ c# import data from text file into sql databse line by line‎ store xml in SQL Server 2008 from C#‎ Using SQL in C# - Cannot insert data into SQL table visual C# - Could not Insert the data using VC# in MYSQl Add, save & retrieve data in SQL insert data in sql 2005 from excel file through c# asp.net‎ insert data into SQL table from pre filled boxes in C# 4.0‎ insert into database unsing ado.net and C#‎ Insert DateTime into SQL Server using C#‎ Searches related to c# insert data into sql c# insert data into sql table c# insert data into sql server inserting data into sql table insert query sql insert statement from another table
Views: 351397 ProgrammingKnowledge
Introduction to Oracle: PL-SQL - LOOP Statement
 
04:36
Introduction to Oracle: PL-SQL - LOOP Statement
Views: 238 David Hays
Informatica pre and post sql
 
10:36
Pre-Post SQL properties of source qualifier transformation Pre SQL: The SQL query fires initially when loading to that database. Post SQL: The SQL query fires at the end i.e., after loading the records to the database. Pre and Post SQL to execute SQL statement like Insert, Update, Delete before and after the load. pre SQL means " SQL statement executed using the source connection,before a pipeline is run" and post SQL means " SQL statement executed using the source connection,after a pipeline is run".
Views: 17000 Informatica
Using an inline view in an sql statement in SQL / PLSQL
 
08:32
Using an inline view in an sql statement in SQL/PLSQL
Views: 2524 Subhroneel Ganguly
Database Tutorial 65 - SQL DELETE Statement - Oracle DBA Tutorial
 
02:03
Database Tutorial 65 - SQL DELETE Statement - Oracle DBA tutorial, Oracle Database Tutorial This video explains about SQL DELETE Statement
Views: 586 Sam Dhanasekaran
SQL - SELECT statement
 
02:53
Link to the tutorial http://www.itcuties.com/sql/sql-select-statement-tutorial-video/ SQL select statement is a part of the SQL-Data Statements which is a subset of SQL's Data Manipulation Language for SQL and is in short called SQL DML.SQL select statement is used to query databases for data stored in tables. You start a select statement by providing a SELECT keyword at the beginning of the statement. The basic select statement consist of two clauses SELECT and FROM. SELECTclause specifies the table's columns that we want to retrieve from the table.
Views: 10353 ITCuties
Microsoft SQL Server Tutorial For the beginners - How to Update the data in tables
 
10:46
This video tells us how to update the data in the tables in the SQL server, TSQL
Views: 529 CrazyVids
Oracle Database 12c Security - Oracle Virtual Private Database (VPD)
 
12:29
Learn how to use Oracle Virtual Private Database (VPD) to secure your data. See all lessons at http://skillbuilders.com/12c-TSDP-Tutorial First, Virtual Private Database. What is it? Answer: It's a declarative technique for enforcing security. Typically, it's based on user application context. That was the first limitation of 8i. Backed with 8i context were session-specific. The context variables were sort in the PGA. That means you simply couldn't use this in a web environment. However, global context, with use of 9i, Virtual Private Database became usable for web applications with connection pooling. But whether you're using it to client server or on a three tier environment, it's declarative technique rather than a programmatic technique. I can go behind the back of the application as a DBA and generate predicates to get appended to all SQLs. Select, insert, update, delete the end users. Issue the SQL and I will generate a predicate that filters the access. It's impossible to bypass. All users will have predicates appended to all their code. It doesn't matter whether they're using SQL Plus, Discoverer, Business Objects, Crystal Reports, eBusiness Suites, whatever they're using, I as DBA can filter their access to roles. The end result, different users see different data sets while running the same code and accessing the same tables, hence, the name Virtual Private Database. Different users will think they're seeing a totally different set of tables, but in fact it's one column database, one set of tables hosting a single application shared by all the users. The mechanism - you can apply VPD to tables, to views, to synonyms, and a declarative technique. Once the technique you write a function that generates the predicate, you associate the function with the table. From then on whenever the user issue SQL against that table the Cost-Based Optimizer rewrites the code. The Cost-Based Optimizer rewrites the user SQL to call the function to generate the predicate. The predicate is then appended to the SQL and it's the modified SQL that is parsed and executed. Let's see how this actually works. I'm working here by the way. This is just a perfectly normal 12.1 database. But what I'm going to demonstrate at this point will in fact work on 11g as well. I'm not going to be using any of the 12c enhancements to VPD for this little demonstration. I'll work in the scott schema. What do we have to do? We write a function to generate the predicate string. Create function. And I'll my function vpdf. The function must conform to a fixed specification. It must take two varchar arguments. One of the arguments is intended to be the schema to which the function will be applied. The other argument is the object within the schema to which the function will be applied. And it must return a varchar2, which is the generated predicate. Let's begin. Within this function you can do just about anything. There are some limitations. It's impossible for the function to query or update the table against which the VPD calls here is going to be applied or we violate the rules of purity that we come across so often with PL/SQL. But apart from that, it can do just about anything - including a number of dreadful side effects can be introduced by writing VPD functions. I'm going to do a very simple one on this one. I'll shall simple return immediately a predicate. What predicate? Ename, which is the ename column from this scott.emp table. Ename should equal sys_context. I'll go to the local context, my user end context, and just extract session user. We can see that John has tested this earlier today and therefore the object already was suggesting and he's just dropping it now and cleaning up the recreate. I hope you realize these really are live demonstrations. I'm not just running scripts. I've created a function. What's that function going to do? It's going to return this value here. Test it. Always test it and see what it's actually going to do. I'll select vpdf. I have to give it a couple of arguments. This one will do for now.
Views: 4427 SkillBuilders
The Sub Query in SQL
 
01:21
Follow this tutorial to learn how to use Transactions in SQL and see how we can roll back to previous changes done in database. Don't forget to check out our site http://howtech.tv/ for more free how-to videos! http://youtube.com/ithowtovids - our feed http://www.facebook.com/howtechtv - join us on facebook https://plus.google.com/103440382717658277879 - our group in Google+ Sub query in SQL is basically referred to a query inside a query, to restrict the data further depending upon certain conditions set by us. In SQL, sub queries are used with commands like SELECT, UPDATE, DELETE or INSERT along with comparison operators like Equals to, Less than or Greater than Equal to. Step 1- Query Structure Suppose a scenario in which we want to see the name and salary of those employee who are getting more than what Blake is earning, we will first write the column name with the Select keyword, which in our case will be "ename" and "SAL". Then with a From keyword, a table name has to be given in which these columns are present. Here, we will choose the employee table. Now after that, we will write a Where clause and use the Salary column as an argument, a greater than sign and then within a pair of parenthesis we will write our condition. This condition will basically act as a sub query in SQL, so for that we will write Select alongwith Salary. Next, we will define from which table the data is to be tabulated from and define ename as BLAKE with a Where clause. Hence the query would be: select ename,SAL from EMP where SAL ( select SAL from EMP where ENAME='BLAKE' ) And this is how in SQL, sub queries can be written.
Optional parameters in sql server stored procedures  Part 68
 
27:52
Text version of the video http://csharp-video-tutorials.blogspot.com/2013/09/part-68-optional-parameters-in-sql.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-68-optional-parameters-in-sql_16.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists Parameters of a sql server stored procedure can be made optional by specifying default values. We wil be using table tblEmployee for this Demo. CREATE TABLE tblEmployee ( Id int IDENTITY PRIMARY KEY, Name nvarchar(50), Email nvarchar(50), Age int, Gender nvarchar(50), HireDate date, ) Insert into tblEmployee values ('Sara Nan','[email protected]',35,'Female','1999-04-04') Insert into tblEmployee values ('James Histo','[email protected]',33,'Male','2008-07-13') Insert into tblEmployee values ('Mary Jane','[email protected]',28,'Female','2005-11-11') Insert into tblEmployee values ('Paul Sensit','[email protected]',29,'Male','2007-10-23') Name, Email, Age and Gender parameters of spSearchEmployees stored procedure are optional. Notice that, we have set defaults for all the parameters, and in the "WHERE" clause we are checking if the respective parameter IS NULL. Create Proc spSearchEmployees @Name nvarchar(50) = NULL, @Email nvarchar(50) = NULL, @Age int = NULL, @Gender nvarchar(50) = NULL as Begin Select * from tblEmployee where (Name = @Name OR @Name IS NULL) AND (Email = @Email OR @Email IS NULL) AND (Age = @Age OR @Age IS NULL) AND (Gender = @Gender OR @Gender IS NULL) End Testing the stored procedure 1. Execute spSearchEmployees - This command will return all the rows 2. Execute spSearchEmployees @Gender = 'Male' - Retruns only Male employees 3. Execute spSearchEmployees @Gender = 'Male', @Age = 29 - Retruns Male employees whose age is 29
Views: 70735 kudvenkat
SQL:  How to Use Variables With Select Statements
 
06:28
Describes how to use variables with Select
Views: 5596 A Estrada

dating girl borderline personality disorder
epilepsy dating website
bb dating site free
36 year old man dating a 24 year old woman
dating at 35 years old