Must Know 10+ Database Queries If You Work in an IT Company

People who study in IT will certainly be familiar with the terms database query, and SQL. But for those of you who are beginners in the field and need to understand this can be understood through our review. Each term will be explained in detail, so you will be able to understand it. Immediately, we begin with the understanding of the database.

table of contents

1 What Is a Database in the Computer World?

2 Understanding Database Queries?

3 What is SQL and how is it different from MySQL?

4 Why AQL, DMX, and Datalog are Less Famous

5 Curious about the Mechanism of Query Database Performance?

6 Two Types of Database Queries

6.1 · Data Definition Language (DDL)

6.2 · Data Manipulation Language (DML)

6.3 · Data Control Language (DCL)

7 Some Examples of Database Query Languages

7.1 · Create

7.2 · Drop

7.3 · Select

7.4 · Alter

7.5 · Insert

7.6 · Update

7.7 · Delete

What is a Database in the Computer World?

A database is a collection of data that is stored systematically on a computer. These data can be processed or manipulated by using a software or application to produce information. This database is very important in the information system section, because it acts as a full repository of data.

This data warehouse can carry out its function of organizing data, avoiding duplication of data, and preventing unclear relationships between data. All data in this database can be displayed by query. You already know about the database, now we move on to Query.

Definition of Database Query?

In everyday language query means a request for information. Whereas in computer language, database queries are requests for information taken and received from the database. Query is used as a programming language that is able to manipulate data, delete, add, and also change data.

This query is made carefully by using special requests. This query is created using a special set of pre-defined codes where the database will be able to understand the desired instructions. The pre-defined code is called the query language.

You need to manage the database using a special query called SQL (Structure Query Language). But this SQL is different from MySQL you know. To understand more about SQL, you need to listen to the following review.

What is SQL and What’s the Difference with MySQL?

SQL which has the structure of Structure Query Language is included in the query category. You will be able to use SQL to give commands to the database. This SQL software is most widely used in order to organize data or manipulate data taken from an SQL database .

Actually SQL is not the only type of query language. There are still AQL, DMX, and Datalog. While MySQL in the world of query is also an important function, because it acts as software that uses the SQL language.

Why AQL, DMX, and Datalog are Less Famous

Most of the query languages ​​used in Indonesia are indeed SQL. Even though there are other query languages, such as AQL, DMX, and Datalog. The three types of queries are not well known for a reason.

AQL which has an extension of ArangoDB Query Language is commonly used to retrieve data and modify data stored in ArangoDB server (Query database). AQL is really similar to SQL and the difference lies in not being able to support data definition operations, such as Create and Drop.

Some other query languages, such as DMX and Datalog are not well known, because there are not many Indonesian programmers who use them. Both of these query languages ​​are rarely used by our programmers, because there is rarely an explanation in Indonesian too.

Intrigued by the Database Query Performance Mechanism?

Are you curious about the query mechanism? Can be assumed with this story. Si A wants to order a mint flavored donut at JCO. He stood in front of the JCO barista while saying, “Order a mint flavored donut”. The barista will be able to understand your request and immediately get the donut you mean.

This supposition is similar to a query that works by using special instructions or code and is called a database query language. Whether the user uses SQL or Datalog, the user will be able to exchange information with the database. That can happen thanks to the language used by users with the same database, the query language.

Two Types of Database Queries

You now have a better understanding of queries, SQL, and databases. Also need to know about the three types of queries namely Data Definition Language (DLL), Data Manipulation Language (DML), and Data Control Language (DCL). The three types of queries have different functions.

  • Data Definition Language (DDL)

Type of Data Definition Language allows users to create and give definitions to data objects in the database, such as creating tables, relations, and others. You can also give commands in determining the structure of table storage. DDL compilation collection is a collection of tables stored in a data dictionary.

Examples of this DDL are create database, modify database, create table, and modify table.

  • Data Manipulation Language (DML)

Data Manipulation Language is needed to manipulate data. You will be able to manipulate data after retrieving data in a database. The manipulation can be in the form of adding or inserting new data, deleting data, and changing data from the database.

  • Data Control Language (DCL)

Data Control Language (DCL) is a type of query language used by users to control whether or not access to the database. This DCL also has commands like REVOKE which means to deny user access rights.

Some Examples of Database Query Languages

The last stage you need to know about queries is a few examples of commands that are often used in query languages. For example, Create, Drop, Select, Alter, Insert, Update, and Delete. You will see each of these commands below.

  • Create

The first example of syntax that is often used in query languages ​​is Create. This command is useful in creating databases, creating tables, creating views, and creating indexes. Create database functions to create a database. Create table is useful for creating tables in a database.

Then Create view is a command that makes the database will display data from a table or database. The create view command can help improve security and make it easier for users to work with databases.

  • Drop

Drop Syntax is also found in SQL which is useful for deleting data that already exists in a database. Can be a Drop Database or Drop Table.

  • Select

The Select command in the database query language is useful for displaying data tables in a database. You will be able to choose to display only partial data in all columns in the table, data in certain columns, or data in all tables.

  • Alter

You will also be able to make changes to existing tables in the database. The command to change the table data is Alter.

  • Insert

Another well-known command syntax is Insert. You will be able to manipulate data in the table using the Insert command. There are at least three types of insert forms, such as Insert in general, Insert adding one-row data, and insert adding rows in certain columns.

  • Updates

You want to change data from a database, you need to use the Update command syntax. Changing the data will be done by changing the contents of the data in certain columns in the table.

  • Delete

The last frequently used query command syntax is Delete. This Delete command is used as a command to delete data in a table.

 

Leave a Comment

Scroll to Top