|
The following are SQL components:-
1. DDL (Data Definition Language) :- DDL is used to define, modify and delete the schema (structure of the database objects).
Examples: - CREATE, ALTER, DROP, TRUNCATE.
2. DML (Data Manipulation Language):- DML is used to operate on the data in the database rather than the schema. The common operations are: Fetch the data according the user requirements and Insertion, Deletion and updating of the data. for example:- SELECT, INSERT, UPDATE, AND DELETE.
3. DCL (Data Control Language):- DCL is used to give and take the data access permissions and rights to the different users.for example : - GRANT, REVOKE
Transaction control statements Transaction Control Statements are used to control the overall transaction of the data. for example : - SET TRANSACTION, COMMIT, ROLLBACK
SQL Objects: An Overview
Tables: - Tables are logical structures maintained by the database manager. Tables are made up of columns and rows. The rows are not necessarily ordered within a table (order is determined by the application program). At the intersection of every column and row is a specific data item called a value. A column is a set of values of the same type or one of its subtypes. A row is a sequence of values arranged so that the nth value is a value of the nth column of the table.
Views: - A view provides an alternative way of looking at the data in one or more tables. It is a named specification of a result table. The specification is a SELECT statement that is executed whenever the view is referenced in an SQL statement.
Aliases: - An alias is an alternative name for a table or view. It can be used to reference a table or view in those cases where an existing table or view can be referenced. An alias cannot be used in all contexts. For example, it cannot be used in the check condition of a check constraint.
Indexes: - An index is an ordered set of pointers to rows of a base table. Each index is based on the values of data in one or more table columns. An index is an object that is separate from the data in the table. When an index is created, the database manager builds this structure and maintains it automatically. Indexes are used by the database manager to: Improve performance. In most cases, access to data is faster than without an index. An index cannot be created for a view. However, an index created for a table on which a view is based can sometimes improve the performance of operations on the view. Ensure uniqueness. A table with a unique index cannot have rows with identical keys.
Queries: - A query is a component of certain SQL statements that specifies a (temporary) result table. |