This document introduces database languages, specifically Data Definition Language (DDL) and Data Manipulation Language (DML), which are sublanguages used in database management systems (DBMS). DDL is used to define and modify database schemas, while DML provides operations for data manipulation such as insertion, modification, retrieval, and deletion. The document also distinguishes between procedural and non-procedural DML, providing examples of SQL statements for both DDL and DML.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views9 pages
Lecture Two - DDL and DML
This document introduces database languages, specifically Data Definition Language (DDL) and Data Manipulation Language (DML), which are sublanguages used in database management systems (DBMS). DDL is used to define and modify database schemas, while DML provides operations for data manipulation such as insertion, modification, retrieval, and deletion. The document also distinguishes between procedural and non-procedural DML, providing examples of SQL statements for both DDL and DML.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 9
LECTURE TWO
Introduction to database languages:
Data Definition Language Data Manipulation Language
DDL and DML
Database Language Database Languages are known as data Sublanguages. DBMSs have a facility for embedding the sublanguage in a high-level programming language e.g. C, C++, Java Or VB. The high-level language is then known as a host Language. Most data sublanguages also provide interactive commands that can be input directly from a terminal.
DDL and DML 1.2.2
Database languages cont. A data sublanguage consists of two parts: Data definition Language (DDL) Used to specify the database schema.
Data Manipulation Language (DML)
Used to read and update the database.
DDL and DML 1.2.3
Data Definition Language (DDL) This is a language that allows the DBA or user to describe and name the entities, attributes and relationships required for the application, together with any associated integrity and security constraints (Begg & Connolly, 2002)
DDL is not only used to specify new database schemas but
also to modify exiting ones. A database schema is a logical grouping of objects that belong to a user.
All created objects / structures (such as tables, views,
indexes) are stored in a database schema.
DDL and DML 1.2.4
DDL cont. Relation DB schema objects are created and maintained by using SQL DDL statements (such as CREATE, ALTER, DROP).
The result of compiling DDL statements is a set of tables
stored in special files collectively called the system catalog. The system catalog may also be referred to as a data dictionary.
DDL and DML 1.2.5
DDL cont. The data dictionary integrates the meta-data; definitive information about the structure is recorded in a data dictionary. For example: definitions about the records, data items and other objects of interest to users or required by the DBMS. The DBMS consults the data dictionary before accessing or manipulating the data.
Example of DDL SQL statement:
CREATE, ALTER, DROP, RENAME, TRUNCATE
DDL and DML 1.2.6
Data Manipulation Language (DML) This is a language that provides a set of operations to support the basic data manipulation operations on the data held in the database: Some of the operations include: Insertion of new data into the database Modification of data stored in the database Retrieval of data contained in the database (Query language). Deletion f data from the database.
DDL and DML 1.2.7
DML cont. Procedural DML This a language that allows the user to tell the system what data is needed and exactly how to retrieve the data; allows user to tell system exactly how to manipulate data.
Non-Procedural DML allows user to state what data is needed rather than how it is to be retrieved.