DBMS में database queries और updates को व्यक्त करने के लिए उपयुक्त languages और interfaces हैं।
Database language
- डेटाबेस के साथ communicate करने के लिए।
- Database language का उपयोग database को create , maintain और update आदि करने के लिए किया जाता है।
Types of Database language
मुख्य रूप से database language दो प्रकार के होते है।
- DDL ( Data Definition Language )
- DML ( Data Manipulation Language )
Data Definition Language ( DDL )
- DDL पूरा नाम Data Definition Language है इसका उपयोग database structure या pattern को define करने के लिए किया जाता है।
- DDL का उपयोग DBA और Database designer दवारा डेटाबेस के conceptual schema को specify करने के लिए किया जाता है।
- DDL का उपयोग database में tables , schema , index , constraints, आदि को create करने के लिए किया जाता है।
उदाहरण के लिए :
create table account (
account-no char(11)
balance integer ) - Data Definition Language को Meta data की information को स्टोर करने के लिए उपयोग किया जाता है। जैसे tables और schema की संख्या, उनके name, index, प्रत्येक columns में table, constraints आदि।
Here are the lists of tasks that come under DDL
Create: इसका उपयोग database में objects बनाने के लिए किया जाता है।
Alter: इसका उपयोग database के structure को बदलने के लिए किया जाता है .
Drop: इसका उपयोग database से objects को delete करने के लिए किया जाता है।
Truncate: इसका उपयोग एक table से सभी रिकॉर्ड निकालने के लिए किया जाता है।
Rename: इसका उपयोग object का नाम बदलने के लिए किया जाता है
Comments : इसका उपयोग data dictionary पर comment करने के लिए किया जाता है।
Data Manipulation Language ( DML )
- DML पूरा नाम Data Manipulation Language है इसका उपयोग database में data को Access करने और manipulate करने के लिए किया जाता है।
- DML user को डेटाबेस से डाटा को insert , update , delete और retrieve करने के लिए allow करता है
- DML को query language भी कहते है |
Here are the lists of tasks that come under DML
- Select: इस कमांड का उपयोग database से data को retrieve करने के लिए किया जाता है।
- Insert: इस कमांड का उपयोग Table में data को insert करने के लिए किया जाता है।
- Update: इस कमांड का उपयोग table के data को update करने के लिए किया जाता है।
- Delete: इस कमांड का उपयोग किसी table से सभी records को delete करने के लिए किया जाता है।
- Merge: यह UPSERT ऑपरेशन करता है,जो हैं insert या update operations।
- Call: इसका उपयोग एक SQL या Java subprogram को Call करने के लिए किया जाता है।
Other Database language
- Data Control Language (DCL)
- Transaction Control Language (TCL)
Data Control Language (DCL)
- DCL पूरा नाम Data Control Language है | डेटा कंट्रोल लैंग्वेज (DCL) का उपयोग Authorization के लिए किया जाता है। अर्थात यूजर को access देने और access हटाने के लिए DCL का उपयोग करते है।
- डेटाबेस में किसी भी ऑपरेशन को करने के लिए (जैसे कि creating tables, sequences, or views) हमें विशेषाधिकारों की आवश्यकता होती है|
Here are some tasks that come under DCL:
-
- Grant: यह एक database को user access privileges को देने के लिए उपयोग किया जाता है।
- Revoke: इसका उपयोग user से permissions वापिस लेने के लिए किया जाता है।
Transaction Control Language (TCL)
DML statements द्वारा किए गए changes को run करने के लिए TCL का उपयोग किया जाता है। यह statements को logical transactions में classifying करने की अनुमति देता है |
Here are some tasks that come under TCL:
- Commit: यह database पर लेनदेन को बचाने के लिए उपयोग किया जाता है।
- Rollback: यह पिछले commit के बाद से original database को पुनर्स्थापित (restore) करने के लिए प्रयोग किया जाता है।