Skip to main content

Database Languages in DBMS – DDL, DML, DCL, DQL Jitendra Ajmera The Crazy Programmer

Programming languages which are used to create and operate database, known as database language like Structured Query language aka SQL etc.

Most of database languages are non-procedural, means the language focus on “what to do instead of how to do?”

We can further divide database languages in these 4 categories as per the type of users:

  1. Data definition language aka DDL
  2. Data manipulation language aka DML
  3. Data control language aka DCL
  4. Data query language aka DQL

Database Languages in DBMS

DDL

It is used to specify or create database schema like new database or tables creation along with their properties. It is commonly used by Database administrator.

Sample codes are as per given below:

CREATE: To create new database or tables

ALTER: To change the structure of table

DROP: To delete objects from table

TRUNCATE: To remove all records from a table

COMMENT: To add comments to the data dictionary

It also updates data dictionary.

Data dictionary is kind of metadata about the database. In simple words data dictionary is like a map of the database, which contain all information about the database.

Example:

create table employee (id number (10), name char (20), address varchar (30));

After passing this code a table will be formed named “employee”.

Table employee
Id Name address

DML

It is used by end users to access or perform operations on a database or table. It helps users to manipulate the database or a table.

DML is further classify in two sections:

  • Procedural DML: In this section user needs to define “what data is needed and how to get that?” like PL/SQL.
  • Non-Procedural DML: In this section user needs to define just “what is needed?”. Its not required to define any procedure to get that data. Like SQL.

Sample codes are as per given below:

INSERT: To insert data in table

SELECT: To select data from a table or complete table

UPDATE: To update existing data in table

MODIFY: To modify or change any data in table

DELETE: To delete all records from a table without remove spaces allotted.

REMOVE: To remove selected data from a table

LOCK TABLE: To control concurrency

Example:

insert into table employee (id, name, address) values (‘01’,’Ajay’,’C5, Anand Vihar, Pune’);

After applying this command, the table employee will be look like this:

Table employee
Id Name Address
01 Ajay C5, Anand Vihar, Pune

DCL

This part is like components of SQL that are used to control access to data and database along with database users. These are function which help to manage any type of approach to database to maintain security and integrity.

Sample codes are as per given below:

COMMIT: To save the work done till current.

ROLLBACK: To revert the database till the last COMMIT point.

SAVE POINT: To make a save point so that we can revert to only that point in case of any changes needs to be done. By default, COMMIT point is a SAVE POINT, but SAVE POINT is not a COMMIT point.

GRANT/REVOKE: To give or take back permission from users of database.

SET TRANSACTION: To give or take back permission from users of database, and to set limit of permissions.

DQL

This is a format language which is used to get or retrieve any data from the database. This format creates different queries. Also, it helps database to understand the reaming part of the query except commands. All queries in database belongs to DQL.

The post Database Languages in DBMS – DDL, DML, DCL, DQL appeared first on The Crazy Programmer.



from The Crazy Programmer https://ift.tt/3Aj5pJt

Comments

Popular posts from this blog

Difference between Web Designer and Web Developer Neeraj Mishra The Crazy Programmer

Have you ever wondered about the distinctions between web developers’ and web designers’ duties and obligations? You’re not alone! Many people have trouble distinguishing between these two. Although they collaborate to publish new websites on the internet, web developers and web designers play very different roles. To put these job possibilities into perspective, consider the construction of a house. To create a vision for the house, including the visual components, the space planning and layout, the materials, and the overall appearance and sense of the space, you need an architect. That said, to translate an idea into a building, you need construction professionals to take those architectural drawings and put them into practice. Image Source In a similar vein, web development and design work together to create websites. Let’s examine the major responsibilities and distinctions between web developers and web designers. Let’s get going, shall we? What Does a Web Designer Do?

A guide to data integration tools

CData Software is a leader in data access and connectivity solutions. It specializes in the development of data drivers and data access technologies for real-time access to online or on-premise applications, databases and web APIs. The company is focused on bringing data connectivity capabilities natively into tools organizations already use. It also features ETL/ELT solutions, enterprise connectors, and data visualization. Matillion ’s data transformation software empowers customers to extract data from a wide number of sources, load it into their chosen cloud data warehouse (CDW) and transform that data from its siloed source state, into analytics-ready insights – prepared for advanced analytics, machine learning, and artificial intelligence use cases. Only Matillion is purpose-built for Snowflake, Amazon Redshift, Google BigQuery, and Microsoft Azure, enabling businesses to achieve new levels of simplicity, speed, scale, and savings. Trusted by companies of all sizes to meet

2022: The year of hybrid work

Remote work was once considered a luxury to many, but in 2020, it became a necessity for a large portion of the workforce, as the scary and unknown COVID-19 virus sickened and even took the lives of so many people around the world.  Some workers were able to thrive in a remote setting, while others felt isolated and struggled to keep up a balance between their work and home lives. Last year saw the availability of life-saving vaccines, so companies were able to start having the conversation about what to do next. Should they keep everyone remote? Should they go back to working in the office full time? Or should they do something in between? Enter hybrid work, which offers a mix of the two. A Fall 2021 study conducted by Google revealed that over 75% of survey respondents expect hybrid work to become a standard practice within their organization within the next three years.  Thus, two years after the world abruptly shifted to widespread adoption of remote work, we are declaring 20