SlideShare a Scribd company logo
1 of 10
Database Management Systems
DBMS Languages/
Types of SQL Commands
by
GOWRU BHARATH KUMAR
M.Tech, (Ph.D)
Assistant Professor
You are My creator, But I am Your Master
Queries in a DBMS
• Here, we will consider the Sample University Database
1) Students(sid: string, name: string, login: string, age: integer,
gpa: real)
2) Faculty(fid: string, fname: string, sal: real)
3) Courses( cid: string, cname: string, credits: integer)
4) Rooms(no: integer, address: string, capacity: integer)
5) Enrolled (sid: string, cid: string, grade: string)
6) Teaches(fid: string, cid: string)
7) Meets_In( cid: string, rno: integer, time: string)
Queries in a DBMS Cont…
Here are some questions a user might ask:
1) What is the name of the student with student ID 1234567
2) What is the average salary of professors who teach course
CS5647
3) How many students are enrolled in CS5647
4) What fraction of students in CS564 received a grade better
than B7
5) Is any student with a CPA less than 3.0 enrolled in CS564
Queries in a DBMS Cont…
• Such questions involving the data stored in a DBMS are called queries.
• A DBMS provides a specialized language, called the query language, in
which queries can be posed.
• A very attractive feature of the relational model is that it supports
powerful query languages.
• Relational calculus is a formal query language based on mathematical
logic, and queries in this language have an intuitive, precise meaning.
• Relational algebra is another formal query language, based on a collection
of operators for manipulating relations, which is equivalent in power to the
calculus.
• A DBMS takes great care to evaluate queries as efficiently as possible.
DBMS Languages
• A DBMS has appropriate languages to express database queries and updates.
• Database languages can be used to read, store and update the data in the
database.
Data Definition Language
• DDL stands for Data Definition Language. It is used to define database
structure or pattern.
• It is used to create schema, tables, indexes, constraints, etc. in the database.
• Using the DDL statements, you can create the skeleton of the database.
• DDL is used to store the information of metadata like the number of tables and
schemas, their names, indexes, columns in each table, constraints, etc.
• DDL is used to define the external and Conceptual Schemas.
Here are some tasks that come under DDL:
• Create: It is used to create objects in the database.
• Alter: It is used to alter the structure of the database.
• Drop: It is used to delete objects from the database.
• Truncate: It is used to remove all records from a table.
• Rename: It is used to rename an object.
Data Manipulation Language
• DML stands for Data Manipulation Language. It is used for accessing and
manipulating data in a database. It handles user requests.
• The DDL and DML are collectively referred to as the data sublanguage
when embedded within a host language (Ex: C or COBOL)
Here are some tasks that come under DML:
• Select: It is used to retrieve data from a database.
• Insert: It is used to insert data into a table.
• Update: It is used to update existing data within a table.
• Delete: It is used to delete all records from a table.
Data Control Language
• DCL stands for Data Control Language. It is used to retrieve the stored or
saved data.
• The DCL execution is transactional. It also has rollback parameters.
Here are some tasks that come under DCL:
• Grant: It is used to give user access privileges to a database.
• Revoke: It is used to take back permissions from the user.
Transaction Control Language
• TCL is used to run the changes made by the DML statement. TCL can be
grouped into a logical transaction.
Here are some tasks that come under TCL:
• Commit: It is used to save the transaction on the database.
• Rollback: It is used to restore the database to original since the last
Commit.
DBMS languages/ Types of SQL Commands

More Related Content

What's hot (20)

ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Relational model
Relational modelRelational model
Relational model
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Dbms Introduction and Basics
Dbms Introduction and BasicsDbms Introduction and Basics
Dbms Introduction and Basics
 
Data independence
Data independenceData independence
Data independence
 
Transaction processing ppt
Transaction processing pptTransaction processing ppt
Transaction processing ppt
 
Triggers and active database
Triggers and active databaseTriggers and active database
Triggers and active database
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 
RDBMS
RDBMSRDBMS
RDBMS
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
Attributes
AttributesAttributes
Attributes
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
DATA WAREHOUSING AND DATA MINING
DATA WAREHOUSING AND DATA MININGDATA WAREHOUSING AND DATA MINING
DATA WAREHOUSING AND DATA MINING
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
 

Similar to DBMS languages/ Types of SQL Commands

dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdhdbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdhsaisanthoshreddy143
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptxAshokRachapalli1
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-convertedgayaramesh
 
Lecture 2 DATABASE LANGUAGE.pptx
Lecture 2 DATABASE LANGUAGE.pptxLecture 2 DATABASE LANGUAGE.pptx
Lecture 2 DATABASE LANGUAGE.pptxsazia7
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
 
Dbms Notes Lecture 3 : Types of database users
Dbms Notes Lecture 3 : Types of database usersDbms Notes Lecture 3 : Types of database users
Dbms Notes Lecture 3 : Types of database usersBIT Durg
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptxAshmitKashyap1
 
Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxRiannel Tecson
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Tushar Wagh
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdfTOUSEEQHAIDER14
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management systemPrerana Bhattarai
 
Database system concepts
Database system conceptsDatabase system concepts
Database system conceptsKumar
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structureRUpaliLohar
 
Database Management System (DBMS)
Database Management System (DBMS)Database Management System (DBMS)
Database Management System (DBMS)Kallol Roy
 

Similar to DBMS languages/ Types of SQL Commands (20)

dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdhdbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Dbms Basics
Dbms BasicsDbms Basics
Dbms Basics
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-converted
 
Lecture 2 DATABASE LANGUAGE.pptx
Lecture 2 DATABASE LANGUAGE.pptxLecture 2 DATABASE LANGUAGE.pptx
Lecture 2 DATABASE LANGUAGE.pptx
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Dbms Notes Lecture 3 : Types of database users
Dbms Notes Lecture 3 : Types of database usersDbms Notes Lecture 3 : Types of database users
Dbms Notes Lecture 3 : Types of database users
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
 
Week 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptxWeek 1 and 2 Getting started with DBMS.pptx
Week 1 and 2 Getting started with DBMS.pptx
 
8028.ppt
8028.ppt8028.ppt
8028.ppt
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
Complete first chapter rdbm 17332
Complete first chapter rdbm 17332Complete first chapter rdbm 17332
Complete first chapter rdbm 17332
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
 
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
 
DBMS architecture &; system structure
DBMS architecture &; system  structureDBMS architecture &; system  structure
DBMS architecture &; system structure
 
Database Management System (DBMS)
Database Management System (DBMS)Database Management System (DBMS)
Database Management System (DBMS)
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 

More from BHARATH KUMAR

Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptxBHARATH KUMAR
 
history and evaluation of java.pptx
history and evaluation of java.pptxhistory and evaluation of java.pptx
history and evaluation of java.pptxBHARATH KUMAR
 
Structure of a DBMS/Architecture of a DBMS
Structure of a DBMS/Architecture of a DBMSStructure of a DBMS/Architecture of a DBMS
Structure of a DBMS/Architecture of a DBMSBHARATH KUMAR
 
data abstraction in DBMS
data abstraction in DBMSdata abstraction in DBMS
data abstraction in DBMSBHARATH KUMAR
 
Trees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsTrees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsBHARATH KUMAR
 
ADT STACK and Queues
ADT STACK and QueuesADT STACK and Queues
ADT STACK and QueuesBHARATH KUMAR
 
Why we study LMC? by GOWRU BHARATH KUMAR
Why we study LMC? by GOWRU BHARATH KUMARWhy we study LMC? by GOWRU BHARATH KUMAR
Why we study LMC? by GOWRU BHARATH KUMARBHARATH KUMAR
 
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARIntroduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARBHARATH KUMAR
 
A Survey on Big Data Analytics
A Survey on Big Data AnalyticsA Survey on Big Data Analytics
A Survey on Big Data AnalyticsBHARATH KUMAR
 
Relation between Languages, Machines and Computations
Relation between Languages, Machines and ComputationsRelation between Languages, Machines and Computations
Relation between Languages, Machines and ComputationsBHARATH KUMAR
 

More from BHARATH KUMAR (16)

Object-Oriented concepts.pptx
Object-Oriented concepts.pptxObject-Oriented concepts.pptx
Object-Oriented concepts.pptx
 
Java buzzwords.pptx
Java buzzwords.pptxJava buzzwords.pptx
Java buzzwords.pptx
 
history and evaluation of java.pptx
history and evaluation of java.pptxhistory and evaluation of java.pptx
history and evaluation of java.pptx
 
Data Models
Data ModelsData Models
Data Models
 
Structure of a DBMS/Architecture of a DBMS
Structure of a DBMS/Architecture of a DBMSStructure of a DBMS/Architecture of a DBMS
Structure of a DBMS/Architecture of a DBMS
 
data abstraction in DBMS
data abstraction in DBMSdata abstraction in DBMS
data abstraction in DBMS
 
File system vs DBMS
File system vs DBMSFile system vs DBMS
File system vs DBMS
 
DBMS introduction
DBMS introductionDBMS introduction
DBMS introduction
 
Trees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsTrees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and Algorithms
 
Sorting
SortingSorting
Sorting
 
Linked List
Linked ListLinked List
Linked List
 
ADT STACK and Queues
ADT STACK and QueuesADT STACK and Queues
ADT STACK and Queues
 
Why we study LMC? by GOWRU BHARATH KUMAR
Why we study LMC? by GOWRU BHARATH KUMARWhy we study LMC? by GOWRU BHARATH KUMAR
Why we study LMC? by GOWRU BHARATH KUMAR
 
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARIntroduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMAR
 
A Survey on Big Data Analytics
A Survey on Big Data AnalyticsA Survey on Big Data Analytics
A Survey on Big Data Analytics
 
Relation between Languages, Machines and Computations
Relation between Languages, Machines and ComputationsRelation between Languages, Machines and Computations
Relation between Languages, Machines and Computations
 

Recently uploaded

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 

Recently uploaded (20)

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 

DBMS languages/ Types of SQL Commands

  • 1. Database Management Systems DBMS Languages/ Types of SQL Commands by GOWRU BHARATH KUMAR M.Tech, (Ph.D) Assistant Professor You are My creator, But I am Your Master
  • 2. Queries in a DBMS • Here, we will consider the Sample University Database 1) Students(sid: string, name: string, login: string, age: integer, gpa: real) 2) Faculty(fid: string, fname: string, sal: real) 3) Courses( cid: string, cname: string, credits: integer) 4) Rooms(no: integer, address: string, capacity: integer) 5) Enrolled (sid: string, cid: string, grade: string) 6) Teaches(fid: string, cid: string) 7) Meets_In( cid: string, rno: integer, time: string)
  • 3. Queries in a DBMS Cont… Here are some questions a user might ask: 1) What is the name of the student with student ID 1234567 2) What is the average salary of professors who teach course CS5647 3) How many students are enrolled in CS5647 4) What fraction of students in CS564 received a grade better than B7 5) Is any student with a CPA less than 3.0 enrolled in CS564
  • 4. Queries in a DBMS Cont… • Such questions involving the data stored in a DBMS are called queries. • A DBMS provides a specialized language, called the query language, in which queries can be posed. • A very attractive feature of the relational model is that it supports powerful query languages. • Relational calculus is a formal query language based on mathematical logic, and queries in this language have an intuitive, precise meaning. • Relational algebra is another formal query language, based on a collection of operators for manipulating relations, which is equivalent in power to the calculus. • A DBMS takes great care to evaluate queries as efficiently as possible.
  • 5. DBMS Languages • A DBMS has appropriate languages to express database queries and updates. • Database languages can be used to read, store and update the data in the database.
  • 6. Data Definition Language • DDL stands for Data Definition Language. It is used to define database structure or pattern. • It is used to create schema, tables, indexes, constraints, etc. in the database. • Using the DDL statements, you can create the skeleton of the database. • DDL is used to store the information of metadata like the number of tables and schemas, their names, indexes, columns in each table, constraints, etc. • DDL is used to define the external and Conceptual Schemas. Here are some tasks that come under DDL: • Create: It is used to create objects in the database. • Alter: It is used to alter the structure of the database. • Drop: It is used to delete objects from the database. • Truncate: It is used to remove all records from a table. • Rename: It is used to rename an object.
  • 7. Data Manipulation Language • DML stands for Data Manipulation Language. It is used for accessing and manipulating data in a database. It handles user requests. • The DDL and DML are collectively referred to as the data sublanguage when embedded within a host language (Ex: C or COBOL) Here are some tasks that come under DML: • Select: It is used to retrieve data from a database. • Insert: It is used to insert data into a table. • Update: It is used to update existing data within a table. • Delete: It is used to delete all records from a table.
  • 8. Data Control Language • DCL stands for Data Control Language. It is used to retrieve the stored or saved data. • The DCL execution is transactional. It also has rollback parameters. Here are some tasks that come under DCL: • Grant: It is used to give user access privileges to a database. • Revoke: It is used to take back permissions from the user.
  • 9. Transaction Control Language • TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical transaction. Here are some tasks that come under TCL: • Commit: It is used to save the transaction on the database. • Rollback: It is used to restore the database to original since the last Commit.