| This is a test post.. Actually the site is under construction So catch you soon Admin |
/*--Google Analytics--*/ /*--Google Analytics--*/
Finally Clarified...!!
The Following Query is for the people who have some basic idea about databases, tables, SELECT statements, Sub-Queriesand these are some of the useful statements, mainly used in developing real time projects, so just remember their usage.
INSERT Customers (FirstName, LastName, City, State, PIN) VALUES ('John', 'Wesley', 'Hyderabad', 'AP', '500020')
Care Should be taken that number of coloumns is equal to the number of values, not more-not less. No need to have all the coloumns but all the coloumns which are not nulls are mandatory.
Care should be taken in matching the data types. No need to put single quotes for numbered data types but all other datatypes should be single quoted.
UPDATE
UPDATE Customers SET City = 'Delhi', PIN = '552520' WHERE LastName = 'Wesley'
Updates are Very very Dangerous among all Queries, so use them with extreme caution. If u leave the WHERE clause u will be in big trouble. So first check ur WHERE clause with a SELECT statement, before performing an UPDATE.
DELETE Customers WHERE LastName = 'Wesley'
Deletes are aslso very dangerous, so take the same precautions mentioned for UPDATES. Note that some rows cannot be deleted which are related with foreign keys.
Hope this small Article is useful. Our tutorials are short and simple but Useful.
Use UPDATES and DELETES with extreme caution.
Next Lesson Is About Stored Procedures
The Following Query is for the people who have some basic idea about databases, tables and SELECT statementsand these are some of the useful statements, mainly used in developing real time projects, so just remember their usage.
SELECT * FROM Orders WHERE OrderID IN
(SELECT DISTINCT OrderID FROM OrderItems WHERE ProductID = 3)
Sub Queries are very much useful in sutuations when it is not easy to express all the rows that need to be selected. In many real time situations these can be help ful, so understand them carefully.
Mainly These Are Useful in INSERTS, UPDATES and DELETES.
I am stoping here, bcoz all the sub queries syntaxes aresimilar but it is that how logically we think about the situation plays the key role.
Hope this article may be useful.
If u found any complex queries, post them as comments to share your knowledge with others.