SlideShare a Scribd company logo
1 of 12
SE223
LECTURE 2
DATABASE LANGUAGE
Query
A query is a statement requesting the retrieval of information. The
portion of a DML that involves information retrieval is called a
query language.
There are a number of database query languages in use, either
commercially or experimentally. We study the most widely used
query language SQL.
2
Introduction
A database system provides a data-definition language to
specify the database schema and a data-manipulation language
to express database queries.
In practice, the data-definition and data-manipulation languages
are not two separate languages; instead they simply form parts
of a single database language, such as the widely used SQL
language.
SQL is abbreviation for Structured Query Language
โ€ข A Database Language that communicates with
Relational Database(stores and provides access to data points that
are related to one another)
โ€ข โ€ข Can be divided into more specific language
โ€ข โ€“ DDL
โ€ข โ€“ DML
โ€ข โ€“ DCL
โ€ข โ€“ TCL
7/17/2023
Database
3
DDL
โ€ข โ€ข DDL is abbreviation for Data Definition Language
โ€ข โ€ข Used to define the database structure or schema
โ€ข โ€ข CREATE - to create objects in the database
โ€ข โ€ข ALTER - alters the structure of the database
โ€ข โ€ข DROP - delete objects from the database
โ€ข โ€ข TRUNCATE - remove all records from a table
โ€ข โ€ข COMMENT - add comments to the data dictionary
โ€ข โ€ข RENAME - rename an object
7/17/2023
Database
4
DML
DML is abbreviation for Data Manipulation Language
โ€ข Used to manipulate data within schema objects
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
โ€ข SELECT - retrieve data from the a database
โ€ข INSERT - insert data into a table
โ€ข UPDATE - updates existing data within a table
โ€ข DELETE - deletes all records from a table, the space for the
records remain
โ€ข MERGE - UPSERT operation (Insert or Update)
โ€ข CALL - call a Stored-Procedure
7/17/2023
Database
5
DCL
โ€ข DCL is abbreviation for Data Control Language
โ€ข Used to define roles and permissions to access database
โ€ข GRANT - gives user's access privileges to database
โ€ข REVOKE - withdraw access privileges given with the
GRANT command
TCL
TCL is abbreviation for Transactional Control Language
โ€ข Used to manage the changes made by DML statements
โ€ข COMMIT - save work done
โ€ข ROLLBACK - restore database to original since the last
COMMIT
Database Design
Database systems are designed to manage large bodies of
information. These large bodies of information do not exist in
isolation. They are part of the operation of some enterprise
whose end product may be information from the database or
may be some device or service for which the database plays
only a supporting role.
Database design mainly involves the design of the database
schema.
Example : Database Design for a University
Organization
The university is organized into departments. Each department is
identified by a unique name (dept name), is located in a
particular building, and has a budget.
โ€ข Each department has a list of courses it offers. Each course has
associated with it a course id, title, dept name, and credits, and
may also have have associated prerequisites.
โ€ข Instructors are identified by their unique ID. Each instructor
has name, associated department (dept name), and salary.
โ€ข Students are identified by their unique ID. Each student has a
name, an associated major department (dept name), and tot cred
(total credit hours the student earned thus far)
9
โ€ข The university maintains a list of classrooms, specifying
the name of the building, room number, and room
capacity.
โ€ข The university maintains a list of all classes (sections)
taught. Each section is identified by a course id, sec id,
year, and semester, and has associated with it a semester,
year, building, room number, and time slot id (the time
slot when the class meets).
โ€ข The department has a list of teaching assignments
specifying, for each instructor, the sections the instructor is
teaching.
โ€ข The university has a list of all student course registrations,
specifying, for each student, the courses and the associated
sections that the student has taken (registered for). 10
11
Thanks
7/17/2023
Database
12

More Related Content

Similar to Lecture 2 DATABASE LANGUAGE.pptx

Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMDatabase Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMmoronfolabukunmi
ย 
Database Management System
Database Management SystemDatabase Management System
Database Management SystemNILESH UCHCHASARE
ย 
What is database.pptx
What is database.pptxWhat is database.pptx
What is database.pptxaftabjordan1
ย 
DBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL CommandsDBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL CommandsBHARATH KUMAR
ย 
Module 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptxModule 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptxSoniaDevi15
ย 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptxkavitha623544
ย 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptxAshokRachapalli1
ย 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbmsRupali Rana
ย 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).pptRAJULKUMARSUTHAR
ย 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdfTOUSEEQHAIDER14
ย 
CHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxCHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxkashishy2
ย 
9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2Mukund Trivedi
ย 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptxAshmitKashyap1
ย 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxuwmctesting
ย 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungaVaradKadtan1
ย 
Database management system lecture notes
Database management system lecture notesDatabase management system lecture notes
Database management system lecture notesUTSAHSINGH2
ย 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMMahmud Hasan Tanvir
ย 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
ย 

Similar to Lecture 2 DATABASE LANGUAGE.pptx (20)

Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMDatabase Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
ย 
Database Management System
Database Management SystemDatabase Management System
Database Management System
ย 
What is database.pptx
What is database.pptxWhat is database.pptx
What is database.pptx
ย 
DBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL CommandsDBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL Commands
ย 
Module 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptxModule 1 - Chapter 2.pptx
Module 1 - Chapter 2.pptx
ย 
2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
ย 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
ย 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
ย 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
ย 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
ย 
CHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptxCHAPTER 1 Database system architecture.pptx
CHAPTER 1 Database system architecture.pptx
ย 
9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2
ย 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
ย 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
ย 
Rdbms
RdbmsRdbms
Rdbms
ย 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptx
ย 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
ย 
Database management system lecture notes
Database management system lecture notesDatabase management system lecture notes
Database management system lecture notes
ย 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
ย 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
ย 

Recently uploaded

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
ย 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
ย 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
ย 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
ย 
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธDelhi Call girls
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...OnePlan Solutions
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
ย 
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
ย 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
ย 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
ย 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
ย 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
ย 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
ย 
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
ย 
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS LiveVip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
ย 
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
ย 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
ย 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ย 

Lecture 2 DATABASE LANGUAGE.pptx

  • 2. Query A query is a statement requesting the retrieval of information. The portion of a DML that involves information retrieval is called a query language. There are a number of database query languages in use, either commercially or experimentally. We study the most widely used query language SQL. 2
  • 3. Introduction A database system provides a data-definition language to specify the database schema and a data-manipulation language to express database queries. In practice, the data-definition and data-manipulation languages are not two separate languages; instead they simply form parts of a single database language, such as the widely used SQL language. SQL is abbreviation for Structured Query Language โ€ข A Database Language that communicates with Relational Database(stores and provides access to data points that are related to one another) โ€ข โ€ข Can be divided into more specific language โ€ข โ€“ DDL โ€ข โ€“ DML โ€ข โ€“ DCL โ€ข โ€“ TCL 7/17/2023 Database 3
  • 4. DDL โ€ข โ€ข DDL is abbreviation for Data Definition Language โ€ข โ€ข Used to define the database structure or schema โ€ข โ€ข CREATE - to create objects in the database โ€ข โ€ข ALTER - alters the structure of the database โ€ข โ€ข DROP - delete objects from the database โ€ข โ€ข TRUNCATE - remove all records from a table โ€ข โ€ข COMMENT - add comments to the data dictionary โ€ข โ€ข RENAME - rename an object 7/17/2023 Database 4
  • 5. DML DML is abbreviation for Data Manipulation Language โ€ข Used to manipulate data within schema objects 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 โ€ข SELECT - retrieve data from the a database โ€ข INSERT - insert data into a table โ€ข UPDATE - updates existing data within a table โ€ข DELETE - deletes all records from a table, the space for the records remain โ€ข MERGE - UPSERT operation (Insert or Update) โ€ข CALL - call a Stored-Procedure 7/17/2023 Database 5
  • 6. DCL โ€ข DCL is abbreviation for Data Control Language โ€ข Used to define roles and permissions to access database โ€ข GRANT - gives user's access privileges to database โ€ข REVOKE - withdraw access privileges given with the GRANT command
  • 7. TCL TCL is abbreviation for Transactional Control Language โ€ข Used to manage the changes made by DML statements โ€ข COMMIT - save work done โ€ข ROLLBACK - restore database to original since the last COMMIT
  • 8. Database Design Database systems are designed to manage large bodies of information. These large bodies of information do not exist in isolation. They are part of the operation of some enterprise whose end product may be information from the database or may be some device or service for which the database plays only a supporting role. Database design mainly involves the design of the database schema.
  • 9. Example : Database Design for a University Organization The university is organized into departments. Each department is identified by a unique name (dept name), is located in a particular building, and has a budget. โ€ข Each department has a list of courses it offers. Each course has associated with it a course id, title, dept name, and credits, and may also have have associated prerequisites. โ€ข Instructors are identified by their unique ID. Each instructor has name, associated department (dept name), and salary. โ€ข Students are identified by their unique ID. Each student has a name, an associated major department (dept name), and tot cred (total credit hours the student earned thus far) 9
  • 10. โ€ข The university maintains a list of classrooms, specifying the name of the building, room number, and room capacity. โ€ข The university maintains a list of all classes (sections) taught. Each section is identified by a course id, sec id, year, and semester, and has associated with it a semester, year, building, room number, and time slot id (the time slot when the class meets). โ€ข The department has a list of teaching assignments specifying, for each instructor, the sections the instructor is teaching. โ€ข The university has a list of all student course registrations, specifying, for each student, the courses and the associated sections that the student has taken (registered for). 10
  • 11. 11