DATABASE & SQL/PLSQL

adplus-dvertising
DML (Data manipulation language)
Previous Home Next

DML statements are used to work with the data in tables. SELECT, INSERT, UPDATE, DELETE statements are consider as a DML statement.

  1. SELECT: SQL server provide the SELECT statement to retrieve data  from database. The keywords SELECT, FROM and WHERE makeup the basic SELECT statement . SELECT statement promote the server to querying single table or multiple tables in Database and prepare a result and return to the client application.
  2. Selecting Columns

    The column name from a table specified in the SELECT statement separated by a comma (,) and there is no need to insert a comma after the last column name.

    SELECT column_name 1,column_name 2....column_name n 
    FROM table_name
    

    The above query retrieve the column data  which you pass in the query from table which you pass after From keyword.

    Selecting All Columns

    The SELECT statement used with an asterisk (*) symbol to display all column of the table

    SELECT * 
    FROM table_name
    
  3. INSERT: The insert statement is used to add new rows to a table. There will need a separate INSERT statement for every row. The statement of Insert will be:
  4. INSERT INTO table_name VALUES (value 1, ... value n); 
    
    1. The number of attributes and the data type of each attribute.
    2. Character type values are always enclosed in single quotes.
    3. Number values are never in quote.
    4. Date values are often in the format 'yyyy-mm-dd' (for example, '2010-12-24').
  5. UPDATE: The update statement is used to change values that are already in a table.
  6. UPDATE table_name SET attribute_name 1 = value 1,  
    attribute_name 2 = value 2....attribute_name n = value n 
    WHERE condition;
    

If the WHERE clause is omitted, then the specified attribute is set to the same value in every row of the table

Set multiple attribute values at the same time with a comma-delimited list of attribute_name=value pair

The delete statement does just that, for rows in a table.

DELETE FROM table_name 
WHERE condition

If the WHERE clause is omitted, then every row of the table is deleted

  • CALL: Call a PL/SQL
  • EXPLAIN PLAN: Explain access path to data
  • LOCK TABLE: Control concurrency
  • Previous Home Next