Skip to main content

Posts

Showing posts from October, 2022

What is the Query, Basic Sub-Query, Complex Sub-Query ?

Query,Basic Sub-Query,Complex Sub-Query Query A database query is the use of a select statement to display desired information based on conditions from one or more tables. Different tables in the database store different information. By using query user can view his desired information as desired. For example, let's say that the employees database contains information about many employees. It can display the results of any employee who has joined in the last one year. Use of Select statement: A command of data query language is select statement. A database query is created using SQL statements. A select statement can be used to display data from multiple columns from one or more tables. But remember that select is not an independent statement. It must be accompanied by one or more other clauses for it to work. Some clauses must be used with this, while some clauses are optional. The most commonly used statement in SQL queries is the select statement. Form clause must be used with t

View in Database

 View A view is a virtual table. A view looks like a table and works like a table. Apparently it will seem so to the user. In fact, a view is a table built with predefined queries. Some rows or all rows can be shown conditionally between views. Views can be created with one or more tables. When creating a view, the SELECT statement is actually executed, with which the view is created. The SELECT statement used to create the view can use only column names or more complex functions or calculated fields. A view is a predefined query stored in the database, which looks like a table and is used like a table, but which does not occupy any space in the database. A view is created in a database using the create view statement. A new view can be created from data from a single table, multiple tables or any other view. That user must have the necessary privileges to create the view. The syntax of the create view statement is as follows: CREATE [OR REPLACE] [ALGORITHM = (UNDEFINED | MERGE | TEMPT

Index in the database

 Index Large books have indexes or indexes at the end to facilitate the search for various topics. Through it, it is known that a topic has been discussed on some page of that book. In the case of database also there is system of such index to find various data quickly. Such indexes increase the performance of searching for any information in the database. Simply put, an index is a pointer to data in a table. The created index is stored in a different location from that table. The main purpose of the index is to speed up data retrieval from the database. Indexes can be created or deleted without changing the data. However, queries may take longer if an index is deleted. Keep in mind that indexes occupy physical space and in some cases may be larger than the original data table. Databases need to create indexes to increase query performance. Indexes can be created during table creation or later. The create index statement creates an index for a column in a table. However, it should be r

Synonyms in Database

 Synonyms in Database A synonym is another name for a table or view. Synonyms are used so a table name does not need to be qualified by specifying another user name. Typically database administrators create and manage synonyms. And synonyms created by themselves are managed by the owners of all those synonyms. Since there are two types of synonyms, creating these will require two types of system-level privileges. Generally, all users can create synonyms with the private option. However, to develop synonyms with the public option, the user must be a database administrator or have that level of privilege. But MySQL server doesn't support synonyms yet.