Results 1 to 4 of 4

Thread: What is a simple procedure for querying databases

  1. #1
    Join Date
    Nov 2009
    Posts
    624

    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.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    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'

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    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.

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    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.

Similar Threads

  1. Replies: 3
    Last Post: 31-01-2011, 07:58 PM
  2. Excel Macro querying a table by column name
    By Halyn in forum Software Development
    Replies: 3
    Last Post: 14-10-2009, 08:59 PM
  3. How to Querying blank records iso date in access
    By Quattro in forum Windows Software
    Replies: 3
    Last Post: 31-07-2009, 10:20 AM
  4. How to Generate menu from a databases
    By Gefry in forum Software Development
    Replies: 2
    Last Post: 30-04-2009, 12:50 PM
  5. Synchronization of databases
    By Dadhij in forum Software Development
    Replies: 4
    Last Post: 15-12-2008, 07:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,881,228.48974 seconds with 16 queries