Professional Documents
Culture Documents
Data Definition Language (DDL) is a standard for commands that define the different structures in a
database. There are different types of DDL statements that are used to create, modify, and remove
database objects such as tables, indexes, and users. Common DDL statements used are
CREATE
The create statement is used to create either a new database or a table.
SELECT
Select command is used to retrieve the desired data from the database.
UPDATE table_name
SET column=value, column1=value1,…
WHERE someColumn=someValue;
DELETE:-
if one desires to delte all the records form the database then use of DELTE command will be
appropriate.
DATABASE OBJECTS
Views
Derived Tables or “Virtual Tables” are also known as Views. They provide an alternative way to look
at the data of one or more tables. This virtual table or view derives its values from the evaluation of a
query expression in a CREATE VIEW statement. The query expression can reference base tables,
other views, aliases, etc. Essentially, a view is a stored SELECT statement, of which you can retrieve
the results at a later time by querying the view as though it were a table. . A view can be read-only or
updatable. Currently, Point Base supports Read-Only Views.
The definition of each view is stored in PointBase’s system catalog SYSVIEWS. If no errors are
encountered, PointBase adds the view name to the SYSVIEWS catalog table. Additionally, all
referenced columns of all referenced tables will be added to the SYSVIEWTABLES catalog table
Indexes
Indexes. Indexes are special lookup tables that the database search engine can use to speed up data
retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to
an index in the back of a book
Synonyms
Synonyms are a form of database shorthand.
Synonyms allow the specification of a short reference name for a long, complex object name, e.g.
sys.dba_tablespaces may be shortened to tabspaces by creating a synonym named tabspaces.
Synonyms allow access to other databases on other nodes of a distributed database network that is
transparent to the system user.
Normally only private synonyms are created by system users – public synonyms are created by
database administrators.
Sequences
Sequences are special database objects used to generate numbers in sequential order, typically to be
stored as values in data rows for a data table.
Primary use: To generate unique key values for tables that can be used to link to other tables or that
will serve as primary keys (sequence generated primary keys are termed surrogate keys).
Example: Use a Order_Number_Sequence for a TestOrders table where the value of the
Order_Number_Sequence must be unique and in numerical sequence.
Data Dictionary
In SQL Server the data dictionary is a set of database tables used to store information about a
database’s definition. The dictionary contains information about database objects such as tables,
indexes, columns, datatypes, and views.
The data dictionary is used by SQL server to execute queries and is automatically updated whenever
objects are added, removed, or changed within the database.