Friday, February 26, 2016

Database basic questions part 1

DDL


Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT - add comments to the data dictionary
  • RENAME - rename an object

DML


Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
  • SELECT - retrieve data from the a database
  • INSERT - insert data into a table
  • UPDATE - updates existing data within a table
  • DELETE - deletes all records from a table, the space for the records remain
  • MERGE - UPSERT operation (insert or update)
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency

DCL


Data Control Language (DCL) statements. Some examples:
  • GRANT - gives user's access privileges to database
  • REVOKE - withdraw access privileges given with the GRANT command

TCL


Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
  • COMMIT - save work done
  • SAVEPOINT - identify a point in a transaction to which you can later roll back
  • ROLLBACK - restore database to original since the last COMMIT
  • SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use
Trigger
    A database trigger is procedural code that is naturally executed in light of specific occasions on a specific table or view in a database. The trigger is generally utilized for keeping up the uprightness of the data on the database. For instance, when another record (speaking to another laborer) is added to the workers table, new records ought to likewise be made in the tables of the charges, get-aways and pay rates. Triggers can likewise be utilized to log recorded information, for instance to monitor representatives' past compensations 

RDMS 

     RDBMS Database is a relational database. It is the standard dialect for relational database administration systems.Data is put away as lines and segments in RDBMS. The relations among tables are additionally put away as the table SQL (Structured quiry Language) is a programming Language used to perform undertakings, for example, refresh information on a database, or to recover information from a database. Some normal relational database administration frameworks that utilization SQL are: Oracle, Sybase, Microsoft SQL Server, Access, and so on.

 Schema
   
    A database schema is a approach to logically group objects such as tables, views, stored procedures etc. Think of a schema as a container of objects.You can assign a user login permissions to a single schema so that the user can only access the objects they are authorized to access.

Schemas can be  made and modified in a database, and users can be granted access to a schema. A schema can be owned by any user, and schema ownership is transferable. 

1 comment: