SlideShare a Scribd company logo
1 of 26
SUBJECT : DATABASE SYSTEM
TOPIC : DATABASE LANGUAGES
PREPARED BY
Ms.J.Monica -III-B.Sc - Information Technology
Ms.V.K.Vidhyaa lakshmi -III-B.Sc-Information Technology
UNDER THE GUIDANCE OF
Mrs.P.Anusha M.Sc(IT).,M.Phil.,D.P.T.T.,(Ph.D).,
Assistant professor,
Department of Information Technology,
Bon secours college for women,
Thanjavur.
DATABASE
LANGUAGE
DEFINITION :
 A DBMS has appropriate languages and interface to
express database queries and updates.
 Database languages can be used to read, store and
update the date in the database.
CLASSIFICATION OF DBMS
LANGUAGE
1. CREATE 1. SELECT 1. COMMIT 1. GRANT
2. ALTER 2. INSERT 2. ROLLBACK 2. REVOKE
3. DROP 3. UPDATE 3. TRANSACTION
4. TRUNCATE 4. DELETE 4. SAVEPOINT
5. RENAME 5. MERGE
6. CALL
DATABASE LANGUAGES
DATA
DEFINITION
LANGUAGES
DATA
MANIPULATION
LANGUAGES
DATA CONTROL
LANGUAGES
TRANSACTION
LANGUAGES
DATABASE DEFINITION LANGUAGE
(DDL)
 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.
 Data definition language is used to store the information of metadata like the
number of tables and schemas, their names, indexes, columns in each table,
constraints, etc.
 Using the DDL statements, you can create the skeleton of the database.
QUERY
 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.
CREATE DATABASE
The CREATE DATABASE command is used to create a new SQL
database.
SYNTAX :
CREATE DATABASE databasename ;
EXAMPLE :
CREATE DATABASE bon secours ;
DROP DATABASE
The DROP DATABASE command is used to delete an
existing SQL database.
SYNTAX :
DROP DATABASE databasename ;
EXAMPLE :
DROP DATABASE bon secours ;
CREATE TABLE
The CREATE TABLE command creates a new table in the database.
SYNTAX :
CREATE TABLE Tablename(column1 datatype, column2
datatype, column3 datatype);
EXAMPLE :
CREATE TABLE Student(stud-id int, name varchar(255), age
int);
01 IVAN 25
02 JOSHIYA 30
03 VARUN 24
ALTER TABLE
 The ALTER TABLE command adds, deletes, or modifies columns in a table.
 The ALTER TABLE command also adds and deletes various constraints in a table.
(ALTER TABLE – ADD COLUMN)
SYNTAX:
ALTER TABLE tablename add columnname datatype;
EXAMPLE :
ALTER TABLE student add mobile int;
(ALTER TABLE – DROP COLUMN)
SYNTAX :
ALTER TABLE tablename drop column columnname;
EXAMPLE :
ALTER TABLE student drop column mobile;
01 Malini 20 1234456
02 mano 23 2345673
01 Malini 20
02 Mano 23
ALTER COLUMN
 The ALTER COLUMN command is used to change the data
type of a column in a table.
 The following SQL changes the data type of the column named
“BirthDate” in the “Employees” table to type year:
EXAMPLE :
ALTER TABLE Employees ALTER COLUMN BirthDate
year;
DROP TABLE
The DROP TABLE command deletes a table in the database.
SYNTAX :
DROP TABLE Tablename;
EXAMPLE :
DROP TABLE student ;
CREATED TABLE :
RESULT :
EMPTY SET
EMPTY SET
01 MOUNA 22
02 MARIYAM 23
TRUNCATE TABLE
The TRUNCATE TABLE command deletes the data inside a table, but not the table itself.
SYNTAX :
TRUNCATE TABLE Tablename;
EXAMPLE :
TRUNCATE TABLE student;
CREATED TABLE :
RESULT :
EMPTY SET
EMPTY SET
01 mano 34
02 velu 45
DATA MANUPULATION
LANGUAGE (DML)
 DML stands for Data Manipulation Language.
 It is used for accessing and manipulating data in a database.
 It handles user requests.
 A data-manipulation language (DML) is a language that
enables users to access or manipulate data as organized by
the appropriate data model.
The types of access are:
• Retrieval of information stored in the
database
• Insertion of new information into the
database
• Deletion of information from the
database
• Modification of information stored in the
database
CLASSIFICATION OF DML
DATA MANIPULATION LANGUAGE
PROCEDURAL DECLARATIVE
PROCEDURAL DML :
Procedural DMLs require a user to specify
what data are needed and how to get those data.
DECLARATIVE DML :
Declarative DMLs (also referred to as nonprocedural
DMLs) require a user to specify what data are needed
without specifying how to get those data.
QUERY
 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.
 MERGE :
- It performs UPSERT operation, i.e., insert or update
operations.
 CALL :
- It is used to call a structured query language or a Java
subprogram.
SELECT
The SELECT command is used to select data from a database. The
data returned is stored in a result table, called the result set.
• To display the column:
SYNTAX : SELECT column name1, column name2 from table
name;
EXAMPLE : SELECT customername, city from employee;
• To Display the Table:
SYNTAX : SELECT * from table name;
EXAMPLE : SELECT * from employee;
EXAMPLES
DISPLAY COLUMN
CUSTOMER
NAME
CITY
MOUNI TANJORE
MEGNA TRICHY
DISPLAY TABLE
CUSTOMER
NAME
CITY STATE
MOUNI TANJORE TAMILNADU
MEGNA TRICHY TAMILNADU
INSERT
The INSERT INTO command is used to insert new rows in a table.
SYNTAX :
INSERT INTO tablename (column1, column2, column3,
...)values (value1, value2, value3, ...);
(or)
INSERT INTO tablename values(value1,value2,value3,...valueN);
EXAMPLE :
INSERT INTO student (stud-id, name, age)values(‘01,’meli’,’20’); (or)
INSERT INTO student values(‘02’,’mouni’,’18’);
Stud-id name age
01 meli 20
02 mouni 18
UPDATE
The UPDATE statement is used to modify the existing records.
SYNTAX :
UPDATE tablename set column1 = value1, column2 = value2, ...where condition;
EXAMPLE :
UPDATE student set age = ‘40’ where stud-id = ‘01’;
CREATED TABLE : RESULT :
Stud-id name age
01 meli 20
02 stella 30
Stud-id name age
01 meli 40
02 stella 30
DELETE
The DELETE statement is used to delete existing records in a table.
SYNTAX :
DELETE FROM tablename where condition;
EXAMPLE :
DELETE FROM student where stud-id = ‘ 01 ‘ ;
CREATED TABLE :
RESULT :
Stud-id name age
01 meli 20
02 hema 30
Stud-id name age
02 hema 30
Delete All Records
It is possible to delete all rows in a table without deleting the table. This means that the
table structure, attributes, and indexes will be intact.
SYNTAX :
DELETE FROM tablename;
EXAMPLE :
DELETE FROM student ;
CREATED TABLE :
RESULT :
EMPTY SET
Stud-id name age
01 farana 30
02 doly 20
DATA CONTROL
LANGUAGES
 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.
 DCL consists of statements that controls security concurrent
access to table.
 The DCL has two commands and they are GRANT and
REVOKE.
TRANSACTIONAL CONTROL
LANGUAGES
 TCL is used to run the changes made by the DML
statement.
 TCL can be grouped into a logical transaction.
 TCL commands are manage transactions in
database.
 The TCL commands are COMMIT, ROLLBACK,
SAVEPOINT.

More Related Content

What's hot

What's hot (20)

basic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxbasic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptx
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Relational model
Relational modelRelational model
Relational model
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Trigger
TriggerTrigger
Trigger
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
 
SQL Functions
SQL FunctionsSQL Functions
SQL Functions
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
joins in database
 joins in database joins in database
joins in database
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Sql joins
Sql joinsSql joins
Sql joins
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 

Similar to Database Languages Overview

Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptDrRShaliniVISTAS
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languagesDivyaKS12
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL Rc Os
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleFarhan Aslam
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxEliasPetros
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfKeerthanaP37
 
BASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptxBASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptxNiyatiMandaliya
 
Sql queries - Basics
Sql queries - BasicsSql queries - Basics
Sql queries - BasicsPurvik Rana
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETEAbrar ali
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 

Similar to Database Languages Overview (20)

Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languages
 
Sql
SqlSql
Sql
 
Data base.ppt
Data base.pptData base.ppt
Data base.ppt
 
Module 3
Module 3Module 3
Module 3
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
DBMS LAB M.docx
DBMS LAB M.docxDBMS LAB M.docx
DBMS LAB M.docx
 
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using Oracle
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
BASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptxBASIC_OF_DATABASE_PPT__new[1].pptx
BASIC_OF_DATABASE_PPT__new[1].pptx
 
Sql queries - Basics
Sql queries - BasicsSql queries - Basics
Sql queries - Basics
 
ppt.pdf
ppt.pdfppt.pdf
ppt.pdf
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
SQL
SQLSQL
SQL
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 

More from Anusha sivakumar

More from Anusha sivakumar (13)

deadline.pptx
deadline.pptxdeadline.pptx
deadline.pptx
 
Evolution of Computers ppt.pptx
Evolution of Computers ppt.pptxEvolution of Computers ppt.pptx
Evolution of Computers ppt.pptx
 
set operators.pptx
set operators.pptxset operators.pptx
set operators.pptx
 
PURPOSE OF DATABASE final.pptx
PURPOSE OF DATABASE final.pptxPURPOSE OF DATABASE final.pptx
PURPOSE OF DATABASE final.pptx
 
NESTED SUBQUERY.pptx
NESTED SUBQUERY.pptxNESTED SUBQUERY.pptx
NESTED SUBQUERY.pptx
 
join relation.pptx
join relation.pptxjoin relation.pptx
join relation.pptx
 
fundamental relation algebra.pptx
fundamental relation algebra.pptxfundamental relation algebra.pptx
fundamental relation algebra.pptx
 
DBMS ARCHITECTURE.pptx
DBMS ARCHITECTURE.pptxDBMS ARCHITECTURE.pptx
DBMS ARCHITECTURE.pptx
 
Database user and administrator.pptx
Database user and administrator.pptxDatabase user and administrator.pptx
Database user and administrator.pptx
 
AGGREGATE FUNCTION.pptx
AGGREGATE FUNCTION.pptxAGGREGATE FUNCTION.pptx
AGGREGATE FUNCTION.pptx
 
CSS
CSSCSS
CSS
 
Greedy method
Greedy methodGreedy method
Greedy method
 
Heap sort
Heap sortHeap sort
Heap sort
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Database Languages Overview

  • 1. SUBJECT : DATABASE SYSTEM TOPIC : DATABASE LANGUAGES
  • 2. PREPARED BY Ms.J.Monica -III-B.Sc - Information Technology Ms.V.K.Vidhyaa lakshmi -III-B.Sc-Information Technology UNDER THE GUIDANCE OF Mrs.P.Anusha M.Sc(IT).,M.Phil.,D.P.T.T.,(Ph.D)., Assistant professor, Department of Information Technology, Bon secours college for women, Thanjavur.
  • 3. DATABASE LANGUAGE DEFINITION :  A DBMS has appropriate languages and interface to express database queries and updates.  Database languages can be used to read, store and update the date in the database.
  • 4. CLASSIFICATION OF DBMS LANGUAGE 1. CREATE 1. SELECT 1. COMMIT 1. GRANT 2. ALTER 2. INSERT 2. ROLLBACK 2. REVOKE 3. DROP 3. UPDATE 3. TRANSACTION 4. TRUNCATE 4. DELETE 4. SAVEPOINT 5. RENAME 5. MERGE 6. CALL DATABASE LANGUAGES DATA DEFINITION LANGUAGES DATA MANIPULATION LANGUAGES DATA CONTROL LANGUAGES TRANSACTION LANGUAGES
  • 5. DATABASE DEFINITION LANGUAGE (DDL)  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.  Data definition language is used to store the information of metadata like the number of tables and schemas, their names, indexes, columns in each table, constraints, etc.  Using the DDL statements, you can create the skeleton of the database.
  • 6. QUERY  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. CREATE DATABASE The CREATE DATABASE command is used to create a new SQL database. SYNTAX : CREATE DATABASE databasename ; EXAMPLE : CREATE DATABASE bon secours ;
  • 8. DROP DATABASE The DROP DATABASE command is used to delete an existing SQL database. SYNTAX : DROP DATABASE databasename ; EXAMPLE : DROP DATABASE bon secours ;
  • 9. CREATE TABLE The CREATE TABLE command creates a new table in the database. SYNTAX : CREATE TABLE Tablename(column1 datatype, column2 datatype, column3 datatype); EXAMPLE : CREATE TABLE Student(stud-id int, name varchar(255), age int); 01 IVAN 25 02 JOSHIYA 30 03 VARUN 24
  • 10. ALTER TABLE  The ALTER TABLE command adds, deletes, or modifies columns in a table.  The ALTER TABLE command also adds and deletes various constraints in a table. (ALTER TABLE – ADD COLUMN) SYNTAX: ALTER TABLE tablename add columnname datatype; EXAMPLE : ALTER TABLE student add mobile int; (ALTER TABLE – DROP COLUMN) SYNTAX : ALTER TABLE tablename drop column columnname; EXAMPLE : ALTER TABLE student drop column mobile; 01 Malini 20 1234456 02 mano 23 2345673 01 Malini 20 02 Mano 23
  • 11. ALTER COLUMN  The ALTER COLUMN command is used to change the data type of a column in a table.  The following SQL changes the data type of the column named “BirthDate” in the “Employees” table to type year: EXAMPLE : ALTER TABLE Employees ALTER COLUMN BirthDate year;
  • 12. DROP TABLE The DROP TABLE command deletes a table in the database. SYNTAX : DROP TABLE Tablename; EXAMPLE : DROP TABLE student ; CREATED TABLE : RESULT : EMPTY SET EMPTY SET 01 MOUNA 22 02 MARIYAM 23
  • 13. TRUNCATE TABLE The TRUNCATE TABLE command deletes the data inside a table, but not the table itself. SYNTAX : TRUNCATE TABLE Tablename; EXAMPLE : TRUNCATE TABLE student; CREATED TABLE : RESULT : EMPTY SET EMPTY SET 01 mano 34 02 velu 45
  • 14. DATA MANUPULATION LANGUAGE (DML)  DML stands for Data Manipulation Language.  It is used for accessing and manipulating data in a database.  It handles user requests.  A data-manipulation language (DML) is a language that enables users to access or manipulate data as organized by the appropriate data model.
  • 15. The types of access are: • Retrieval of information stored in the database • Insertion of new information into the database • Deletion of information from the database • Modification of information stored in the database
  • 16. CLASSIFICATION OF DML DATA MANIPULATION LANGUAGE PROCEDURAL DECLARATIVE
  • 17. PROCEDURAL DML : Procedural DMLs require a user to specify what data are needed and how to get those data. DECLARATIVE DML : Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify what data are needed without specifying how to get those data.
  • 18. QUERY  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.  MERGE : - It performs UPSERT operation, i.e., insert or update operations.  CALL : - It is used to call a structured query language or a Java subprogram.
  • 19. SELECT The SELECT command is used to select data from a database. The data returned is stored in a result table, called the result set. • To display the column: SYNTAX : SELECT column name1, column name2 from table name; EXAMPLE : SELECT customername, city from employee; • To Display the Table: SYNTAX : SELECT * from table name; EXAMPLE : SELECT * from employee;
  • 20. EXAMPLES DISPLAY COLUMN CUSTOMER NAME CITY MOUNI TANJORE MEGNA TRICHY DISPLAY TABLE CUSTOMER NAME CITY STATE MOUNI TANJORE TAMILNADU MEGNA TRICHY TAMILNADU
  • 21. INSERT The INSERT INTO command is used to insert new rows in a table. SYNTAX : INSERT INTO tablename (column1, column2, column3, ...)values (value1, value2, value3, ...); (or) INSERT INTO tablename values(value1,value2,value3,...valueN); EXAMPLE : INSERT INTO student (stud-id, name, age)values(‘01,’meli’,’20’); (or) INSERT INTO student values(‘02’,’mouni’,’18’); Stud-id name age 01 meli 20 02 mouni 18
  • 22. UPDATE The UPDATE statement is used to modify the existing records. SYNTAX : UPDATE tablename set column1 = value1, column2 = value2, ...where condition; EXAMPLE : UPDATE student set age = ‘40’ where stud-id = ‘01’; CREATED TABLE : RESULT : Stud-id name age 01 meli 20 02 stella 30 Stud-id name age 01 meli 40 02 stella 30
  • 23. DELETE The DELETE statement is used to delete existing records in a table. SYNTAX : DELETE FROM tablename where condition; EXAMPLE : DELETE FROM student where stud-id = ‘ 01 ‘ ; CREATED TABLE : RESULT : Stud-id name age 01 meli 20 02 hema 30 Stud-id name age 02 hema 30
  • 24. Delete All Records It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact. SYNTAX : DELETE FROM tablename; EXAMPLE : DELETE FROM student ; CREATED TABLE : RESULT : EMPTY SET Stud-id name age 01 farana 30 02 doly 20
  • 25. DATA CONTROL LANGUAGES  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.  DCL consists of statements that controls security concurrent access to table.  The DCL has two commands and they are GRANT and REVOKE.
  • 26. TRANSACTIONAL CONTROL LANGUAGES  TCL is used to run the changes made by the DML statement.  TCL can be grouped into a logical transaction.  TCL commands are manage transactions in database.  The TCL commands are COMMIT, ROLLBACK, SAVEPOINT.