Subject Name Code Credit Hours
Database System COMP 219 3
Chapter II
Subject Name Code Credit Hours
Database System COMP 219 3
DBMS Languages:
Types
Data Definition Language( DDL) Data Manipulation Language (DML)
storage definition language (SDL)
storage definition language (SDL)
Procedural DML
Non-Procedural DML
Subject Name Code Credit Hours
Database System COMP 219 3
DBMS Languages
– Used by the DBA and database designers to specify the
conceptual schema of a database.
– In many DBMSs, the DDL is also used to define internal and
external schemas (views).
– In some DBMSs, separate storage definition language (SDL) and
view definition language (VDL) are used to define internal and
external schemas.
• SDL is typically realized via DBMS commands provided to the
DBA and database designers
Data Definition Language (DDL):
Subject Name Code Credit Hours
Database System COMP 219 3
Data Manipulation Language (DDL):
• Data Manipulation Language (DML):
– Used to specify database retrievals and updates
– DML commands (data sublanguage) can be embedded in a
general-purpose programming language (AKA host
language), such as COBOL, C, C++, or Java.
– Alternatively, stand-alone DML commands can be applied
directly (called a query language).
DBMS Languages
Subject Name Code Credit Hours
Database System COMP 219 3
Data Definition Language (DDL):
– Used by the DBA and database designers to specify the
conceptual schema of a database.
– In many DBMSs, the DDL is also used to define internal and
external schemas (views).
– In some DBMSs, separate storage definition language (SDL)
and view definition language (VDL) are used to define
internal and external schemas.
• SDL is typically realized via DBMS commands provided to the DBA
and database designers
Subject Name Code Credit Hours
Database System COMP 219 3
Data Manipulation Language (DML)
• Language for accessing and manipulating the data organized
by the appropriate data model
– DML also known as query language
• Two classes of languages
– Procedural – user specifies what data is required and
how to get those data
– Declarative (nonprocedural) – user specifies what data is
required without specifying how to get those data
• SQL is the most widely used query language
Subject Name Code Credit Hours
Database System COMP 219 3
Data Definition Language (DDL)
• Specification notation for defining the database schema
Example: create table account (
account-number char(10),
balance integer)
• DDL compiler generates a set of tables stored in a data dictionary
• Data dictionary contains metadata (i.e., data about data)
– Database schema
– Data storage and definition language
• Specifies the storage structure and access methods used
– Integrity constraints
• Domain constraints
• Referential integrity (references constraint in SQL)
• Assertions
– Authorization
Subject Name Code Credit Hours
Database System COMP 219 3
DDL statements/commands in SQL
• Create table table name(list of attribute & their
datatypes);
• Create schema schema name authorization
author name;
• Drop schema schema name cascade/restrict;
• Drop table tablename cascade/restrict;
• Alter table talename add/drop
• Create view view name as (select …..)

Dbms chapter ii

  • 1.
    Subject Name CodeCredit Hours Database System COMP 219 3 Chapter II
  • 2.
    Subject Name CodeCredit Hours Database System COMP 219 3 DBMS Languages: Types Data Definition Language( DDL) Data Manipulation Language (DML) storage definition language (SDL) storage definition language (SDL) Procedural DML Non-Procedural DML
  • 3.
    Subject Name CodeCredit Hours Database System COMP 219 3 DBMS Languages – Used by the DBA and database designers to specify the conceptual schema of a database. – In many DBMSs, the DDL is also used to define internal and external schemas (views). – In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas. • SDL is typically realized via DBMS commands provided to the DBA and database designers Data Definition Language (DDL):
  • 4.
    Subject Name CodeCredit Hours Database System COMP 219 3 Data Manipulation Language (DDL): • Data Manipulation Language (DML): – Used to specify database retrievals and updates – DML commands (data sublanguage) can be embedded in a general-purpose programming language (AKA host language), such as COBOL, C, C++, or Java. – Alternatively, stand-alone DML commands can be applied directly (called a query language). DBMS Languages
  • 5.
    Subject Name CodeCredit Hours Database System COMP 219 3 Data Definition Language (DDL): – Used by the DBA and database designers to specify the conceptual schema of a database. – In many DBMSs, the DDL is also used to define internal and external schemas (views). – In some DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas. • SDL is typically realized via DBMS commands provided to the DBA and database designers
  • 6.
    Subject Name CodeCredit Hours Database System COMP 219 3 Data Manipulation Language (DML) • Language for accessing and manipulating the data organized by the appropriate data model – DML also known as query language • Two classes of languages – Procedural – user specifies what data is required and how to get those data – Declarative (nonprocedural) – user specifies what data is required without specifying how to get those data • SQL is the most widely used query language
  • 7.
    Subject Name CodeCredit Hours Database System COMP 219 3 Data Definition Language (DDL) • Specification notation for defining the database schema Example: create table account ( account-number char(10), balance integer) • DDL compiler generates a set of tables stored in a data dictionary • Data dictionary contains metadata (i.e., data about data) – Database schema – Data storage and definition language • Specifies the storage structure and access methods used – Integrity constraints • Domain constraints • Referential integrity (references constraint in SQL) • Assertions – Authorization
  • 8.
    Subject Name CodeCredit Hours Database System COMP 219 3 DDL statements/commands in SQL • Create table table name(list of attribute & their datatypes); • Create schema schema name authorization author name; • Drop schema schema name cascade/restrict; • Drop table tablename cascade/restrict; • Alter table talename add/drop • Create view view name as (select …..)