CC104 Lect5
CC104 Lect5
Databases serve an important function for many individuals and companies, providing a
practical way to organize and store information on a computer. In programming, developers
use database languages to maintain and monitor an electronic database and its management
system. These languages perform a variety of critical tasks that help a database management
system function correctly. In this article, we define database languages, explain the different
types of languages and provide a list of some common database languages and their uses.
Database languages, also known as query languages or data query languages, are a
classification of programming languages that developers use to define and access databases,
which are collections of organized data that users can access electronically. These languages
allow users to complete tasks such as controlling access to data, defining and updating data and
searching for information within the database management system (DBMS). A DBMS is a piece
of technology that interacts with users, applications and the database to record and analyze
data while also manipulating the database to offer a way to store, access and retrieve data.
A DBMS provides necessary database languages that allow users to express database updates
and queries, which are requests for data. There are different examples of database languages
available, including SQL, which is the standard programming language for many databases.
Database languages comprise four sublanguages that serve different functions to execute tasks.
Data definition language (DDL) creates the framework of the database by specifying the
database schema, which is the structure that represents the organization of data. Its common
uses include the creation and alteration of tables, files, indexes and columns within the
database. This language also allows users to rename or drop the existing database or its
components. Here's a list of DDL statements:
Data manipulation language (DML) provides operations that handle user requests, offering a
way to access and manipulate the data that users store within a database. Its common
functions include inserting, updating and retrieving data from the database. Here's a list of DML
statements:
Data control language (DCL) controls access to the data that users store within a database.
Essentially, this language controls the rights and permissions of the database system. It allows
users to grant or revoke privileges to the database. Here's a list of DCL statements:
Transaction control language (TCL) manages the transactions within a database. Transactions
group a set of related tasks into a single, executable task. All the tasks must succeed in order for
the transaction to work. Here's a list of TCL statements:
Here are six examples of database languages and how to use them:
SQL
SQL, which stands for Structured Query Language, is one of the most well-known and longest-
running database languages. It features both data definition and data manipulation languages
and allows you to write queries in a database. Specifically, SQL provides a way for you to extract
and manage data in a relational database management system. This type of DBMS organizes
data into groups called relations. Because most relational databases use SQL as the database
language, many jobs in the IT industry may require their employees to have an understanding
of it.
XQuery
XQuery is a database language that allows you to extract and manipulate data in XML formats,
which is a way to share data on the internet. You can use XQuery to access and retrieve any
data source in an XML format. With XQuery, you can generate reports on data within an XML
database, search text documents on the web for data and extract data for use online.
OQL
OQL, which stands for Object Query Language, is the standard language for object-oriented
databases, which represent data as variables, functions or data structures. These databases are
popular with companies that want to store large amounts of complex data. Much like SQL does
in relational databases, OQL gives you the option to perform queries and retrieve data in object
databases.
SQL/XML
The SQL/XML language is a combination of SQL and XQuery that supports the manipulation and
storage of XML data in a database that works with SQL. It enables applications to perform SQL
statements on XML data and vice versa. It's helpful when you want to extract content from an
XML document or if you want to ensure compatibility with future optimizations or systems that
may only support XML.
GraphQL
GraphQL is an open-source language that works with APIs, which are interfaces that allow users
to interact with data. It provides a way to define the structure of data and how the system
returns information in order to prevent the release of excessive amounts of data. It's helpful
when you want to extract data from multiple APIs, aggregate data from different sources or
specify the data efficiently.
LINQ
LINQ, or Language Integrated Query, is a language that extracts and processes data from XML
documents, relational databases and other third-party sources. With LINQ, you can access data
through various sources without having to use a separate database language for each one. This
ensures consistency among queries for objects, relational databases and XML, allowing you to
filter, order and group operations.