Database Management Systems
Prof . R A Tela
The Language of DBMS�
SQL�Structured Query Language�Standard language for querying and manipulating data.
�1.Data Definition Language (DDL)
Create/alter/delete tables and their attributes
2.Data Manipulation Language (DML)
Insert/delete/modify tuples in tables
SQL
3
Tables in RDBMS
4
PName | Price | Category | Manufacturer |
Gizmo | 19.99 | Gadgets | GizmoWorks |
Powergizmo | 29.99 | Gadgets | GizmoWorks |
SingleTouch | 149.99 | Photography | Canon |
MultiTouch | 203.99 | Household | Hitachi |
Product
Attribute names
Table name
Tuples or rows
Steps to Define the Schema
5
PName | Price | Category | Manufacturer |
Gizmo | 19.99 | Gadgets | GizmoWorks |
Powergizmo | 29.99 | Gadgets | GizmoWorks |
SingleTouch | 149.99 | Photography | Canon |
MultiTouch | 203.99 | Household | Hitachi |
Product
Step 1: Define table name and its attributes
Product(PName, Price, Category, Manufacturer)
Basic data types
6
Data Types and Domain of Attributes
Product(PName, Price, Category, Manfacturer)
Data Types and Domain of Attributes
7
Steps to Define the Schema
8
Step 2: Define Data Types and Domain of Attributes.
Product(PName, Price, Category, Manfacturer)
Pname : Varchar,
Price: Float,
Category: Varchar
Manfacturer: Varchar
Constraints: Restrictions on values of
Attribute.
9
Step 3: Specifying Constraints.
Product(PName, Price, Category, Manfacturer)
Specifying Attribute and Domain Constraints
10
Schema of Table Product
11
Product(Pname varchar Primary Key,
Price float Not Null,
Category varchar, check(Gadget, Photoraphy,
Household
Manufacturer varchar )
Attribute | Data Type | Constraints |
Pname | Varchar | Primary Key |
Price | Float | Not Null |
Category | Varchar | Gadget, Photography, Household |
Manufacturer | Varchar | |