0% found this document useful (0 votes)
4 views12 pages

Week 9

The document provides an overview of query languages, highlighting their purpose in retrieving and manipulating data from databases. It distinguishes between procedural and declarative query languages, with SQL being a prominent example of the latter. Additionally, it outlines various applications of query languages and categorizes SQL commands into five main types.

Uploaded by

Rica Guiuo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views12 pages

Week 9

The document provides an overview of query languages, highlighting their purpose in retrieving and manipulating data from databases. It distinguishes between procedural and declarative query languages, with SQL being a prominent example of the latter. Additionally, it outlines various applications of query languages and categorizes SQL commands into five main types.

Uploaded by

Rica Guiuo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

OVERVIEW OF

QUERY LANGUAGE
AND SQL
COMMANDS
- Week 9 -
IT 221-Information
Management 1

1
OVERVIEW OF QUERY LANGUAGES
• A query language is a computer
programming language used to retrieve
and manipulate data from databases.
• It allows users to communicate with
the database management system
(DBMS) in order to perform operations
such as inserting, updating, deleting, and
retrieving data.

2
OVERVIEW OF QUERY LANGUAGES
Query languages vs. Programming languages
PL QL
Programming languages like Query languages are specialized
Python or Java are designed to for interacting with databases.
build software applications,
handling everything from
algorithmic processing to data
manipulation and user interface
design.
3
TYPES OF QUERY LANGUAGES
Procedural languages
• Procedural languages instruct a computer on how to execute tasks,
and the focus is on defining step-by-step procedures.
• Procedural languages require a specific exact src to the data,
accounting for every step taken to fetch and construct the desired
output.
• Procedural paradigms are exemplified by languages like PL/SQL
(Procedural Language/Structured Query Language).

4
TYPES OF QUERY LANGUAGES
Procedural languages
CREATE OR REPLACE PROCEDURE GetEmployeeInfo AS
BEGIN
FOR emp_rec IN (SELECT * FROM employees) LOOP
DBMS_OUTPUT.PUT_LINE('Employee ID: ' || emp_rec.employee_id
|| ', Name: ' || emp_rec.first_name || ' ' || emp_rec.last_name);
END LOOP;
END;
/

5
TYPES OF QUERY LANGUAGES
Declarative languages
• Declarative query languages abstract the 'how-to,' focusing on the
'what' — defining only the desired outcome without dictating the
retrieval method. They are more aligned with traditional database
queries and allow for easier manipulation of data structures,
increasing productivity.
• Declarative query examples include the widely-used SQL (Structured
Query Language).

6
COMMON QUERY LANGUAGES
• GraphQL is a data query language developed by Facebook as an alternate
to REST and ad-hoc web service architectures.
• SQL is a well-known query language and data manipulation language for
relational databases;
• DMX is a query language for data mining models
• XQuery is a query language for XML (eXtensible Markup Language) data sources
• Search engine query languages, e.g., as used by Google or Bing
• SPARQL (SPARQL Protocol and RDF Query Language) is a query language used to
retrieve and manipulate data stored in RDF (Resource Description Framework)
format. RDF is a standard model for representing data on the web, particularly for
describing resources and their relationships.
• Oracle PL/SQL is used by Oracle Corporation in its Oracle relational database
management system (RDBMS).

7
APPLICATIONS OF QUERY LANGUAGES
• Web development. Query languages like SQL and MongoDB's MQL are integral in
web development, enabling seamless data access for applications.

• Business Intelligence (BI). BI tools allow users to query databases directly using
familiar declarative query language commands to analyze trends or insights from
large datasets.

• Data warehousing. Efficiently manage and transform huge amounts of data with
the help of query languages, enabling data warehousing and business intelligence
solutions.

• Database administration. Query languages empower database administrators


with the tools necessary to manage, maintain, and optimize databases for
different use cases within an organization.

8
SQL COMMANDS
• SQL commands are like instructions to a table. It is used to interact
with the database with some operations.
• It is also used to perform specific tasks, functions, and queries of
data.
• SQL can perform various tasks like creating a table, adding data to
tables, dropping the table, modifying the table, set permission for
users.

9
CATEGORIES OF SQL COMMANDS
SQL commands are mainly categorized into five categories:
1. DDL – Data Definition Language
2. DQL – Data Query Language
3. DML – Data Manipulation Language
4. DCL – Data Control Language
5. TCL – Transaction Control Language

10
11
Performance Task
• Choose one SQL command, give the description as well as one
example of the command. Use the template below:

CATEGORY COMMAND DESCRIPTION EXAMPLE

12

You might also like