Escolar Documentos
Profissional Documentos
Cultura Documentos
Data storage definition language (DSDL) is used to define the internal schema in the database. The mapping between between internal schema and conceptual schema is done either by DDL or DSDL. DSDL is used to define the storage structure and the access methods used by the database system. View definition language (VDL) Used to specify users views (external schema) and their mappings to the conceptual schema. Some times DDL may be used for the same. [ Data view :- logical view is used by the programmers and other is the physical view]
Database Language
Data manipulation language (DML)
Provides set of operations to support the basic data manipulation operations. Helps in communicating with DBMS. The part of DML used for data retrieval is called query language. The following manipulations can be done Retrieval of data Addition of records Deletion of records Retrieval of records sequentially in the key sequence Retrieval of records in the physically recorded sequence. Rewrite of records that have been updated. Modification of data
Database Language
Fourth-generation language (4GL) is a compact, efficient and non-procedural programming language used to improve the productivity of the DBMS. The user has to define what is to be done not how to do. 4GL has the following components
Query languages
Report generators Spreadsheets Database languages Application generators to define operations like insertion, retrieval of data and updations. High-level languages to generate application programs
SQL DML and DDL SQL can be divided into two parts: The Data Manipulation Language (DML) and the Data Definition Language (DDL). The query and update commands form the DML part of SQL: SELECT - extracts data from a database UPDATE - updates data in a database DELETE - deletes data from a database INSERT INTO - inserts new data into a database
The DDL part of SQL permits database tables to be created or deleted. It also defines indexes (keys), specifies links between tables, and imposes constraints between tables. The most important DDL statements in SQL are: CREATE DATABASE - creates a new database ALTER DATABASE - modifies a database CREATE TABLE - creates a new table ALTER TABLE - modifies a table DROP TABLE - deletes a table CREATE INDEX - creates an index (search key) DROP INDEX - deletes an index
The "Persons" table: P_Id 1 2 3 LastName Hansen Svendson Pettersen FirstName Ola Tove Kari Address Timoteivn 10 Borgvn 23 Storgt 20 City Sandnes Sandnes Stavanger
Now we want to update the person "Tjessem, Jakob" in the "Persons" table.
UPDATE Persons SET Address='Nissestien 67', City='Sandnes' WHERE LastName='Tjessem' AND FirstName='Jakob;
The "Persons" table will now look like this:
P_Id 1 2 3 4 5
CREATE TABLE Persons (P_Id int,LastName varchar(255),FirstName varchar(255), Address varchar(255),City varchar(255));
The empty "Persons" table will now look like this: The empty table can be filled with data with the INSERT INTO statement.
P_Id
LastName FirstName
Addres City s
Transactional Mangement
Atomicity : Database modifications must follow an "all or nothing" rule. Consistency : Transaction should bring the database from one valid state to another. Isolation : No transactions that affect the same rows can run concurrently, since their sequence, and hence the outcome, would be unpredictable. Durability : once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors.
Applications
Physical Database
Two-tier Architecture
server
Physical Database
Three-tier Architecture