Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-11-2009
Member
 
Join Date: Nov 2009
Posts: 620
What is a simple procedure for querying databases

Hi,
I need some explanation in querying a database. How to implement the judgments delete, insert into and update, for querying databases carefully. I am trying to implement some action queries which can return no records. This action queries are responsible for actions such as add and delete and modify records. Any suggestions will be appreciated. Thanks in advance.
Reply With Quote
  #2  
Old 06-11-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: What is a simple procedure for querying databases

You can create a delete query that eliminates records from one or multiple of the tables listed in the FROM clause that satisfy the WHERE clause. This query deletes entire records, not delete the contents of a particular field. Its syntax is: DELETE FROM table WHERE criteria. Once the records were deleted using a delete query can not undo this operation. If you want to know what records were deleted, first examine the results of a select query that uses the same approach and then run the delete query. Keep backups of your data at all times. If you delete the wrong entries are retrievable from the backup.
DELETE
FROM
Employees
WHERE
Cargo = 'Seller'
Reply With Quote
  #3  
Old 06-11-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: What is a simple procedure for querying databases

INSERT INTO adds a record in a table. It is known as a query of aggregate data. This query can be of two types: Insert a single record in a table or insert the records in another table. To insert a single record. In this case the syntax is: INSERT INTO Table (field1, field2, ..., abc) VALUES (value1, value2, ..., abc). This query recorded in the field1 the value1, and value2 into field2 and so on. To select and insert records into a new table In this case the syntax is: SELECT field1, field2, ..., abcINTO new table FROM [WHERE criteria]. You can use the make-table queries to archive records, make backup copies of the tables or make copies for export to another database or use in reports that display data from a particular time period. For example, you could create a monthly sales reports by region running the same make-table query each month.
Reply With Quote
  #4  
Old 06-11-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: What is a simple procedure for querying databases

If you want to insert records records from another table then use the following syntax. INSERT INTO table [IN base_external (field1, field2,, Comp) SELECT TableOrigin.comp1, TableOrigin.comp2,, TableOrigin.compN FROM Table Source. In this case we selected 1,2 ,..., n fields in the source table and will be recorded in the fields 1,2, .., n of the table. The condition can include SELECT WHERE clause to filter the records to be copied. If Source Table Table and have the same structure can simplify the syntax: INSERT INTO SELECT Table .* FROM Table Source Table Source.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is a simple procedure for querying databases"
Thread Thread Starter Forum Replies Last Post
An easy and simple procedure to sync Sony Ericsson with Macintosh Dexter85 Portable Devices 3 31-01-2011 07:58 PM
Excel Macro querying a table by column name Halyn Software Development 3 14-10-2009 08:59 PM
How to Querying blank records iso date in access Quattro Windows Software 3 31-07-2009 10:20 AM
How to Generate menu from a databases Gefry Software Development 2 30-04-2009 12:50 PM
Synchronization of databases Dadhij Software Development 4 15-12-2008 07:14 PM


All times are GMT +5.5. The time now is 04:08 PM.