About SQL (Structure Query Language)

Tentang SQL (Structure Query Language)
SQL stands for Structure Query Language. SQL is often pronounced "Sequel" is a structured language used to query, update and manipulate databases. This language can be used to load, sort and filter a specific data from a database. SQL actually has become the standard language in the database server processing. Many vendors that offer SQL language with slight variations berbagainama and different.
Once we know little about SQL then we learn more about creating databases in MySQL. Can we create a database using the MySQL Command Line or use the interface as SQLYog version 5. In this SQLYog we can more easily in the manufacture of its database tables.
The table is a structure in the database used to store data. Table consists of one or more columns. Each column can be filled with data of the appropriate data type. One line of data (record) is a set of information that the parts in the columns. After we create the database tables we created as well as needed. The structure is part of the table must be specified when creating tables. Table structure contains columns, which each column has its own characteristics. Each column has a column name, data type that can be accommodated and the column width.
Type of data provided by MySQL is vast and complete. The selection of data types is essential. It is absolutely done is selected the data type must match the data stored or processed. If the data type does not match, an error will occur and the process will stop. In addition to the data types must match, the selection of an appropriate data type will save memory and speed up the process.
Simply MySQL data types can be grouped as follows:
1. Integer
2. Decimal and Numeric
3. Float and Double
4. DateTime, Date and Time
5. Char, varchar
6. And any other data type such as year, binary, text and other.

In a table requires a primary key index is a data sorting is physically joined with the table. In one table can only have one primary key, but the key to primary key sequence can consist of several columns. Primary key is always been updated when changes are related to record key column.
In a database containing the tables can be selected according to the needs of applications that we make. Selection of data is useful for many purposes. From a number of data owned by the tables in the database, we can choose specific data are taken. The data set includes a column selection and a particular record. Further selected data can be processed further directly or diinteraksikan with other data in a particular process.
Join the MySQL command provided to relationships (linking) multi-table. Join command does not stand alone but is used in other commands, the commands Select, Update and Delete. Additional join command is used to replace a single source table with a multi-table on these commands.
Aggregate function is a function that is often used in the selection of data pegelompokan (group by). Aggregate functions can be used to obtain statistical data from several database tables. Some aggregate functions are often used are as follows:
1. AVG (expr), Count (expr) and Sum (expr).
2. MIN ([DISTINCT] expr), MAX ([DISTINCT] expr)
3. STDDEV_POP (expr)
4. STDDEV_SAMP (expr)
5. VAR_POP (expr)
6. VAR_SAMP (expr)
View or Table View is a virtual table (virtual) that can display information from one table or more. View actually contains the definition of a command to view a table or more in a new table that is a virtual table, as collected and stored data remain in the original table. Each view will be seen as a separate table. In this way can be obtained some information which is often used, just like accessing a table, the view. Later view can also be accessed by application programs that we make. Although the view is a virtual table, but the view is stored in a database and stored in fact is the definition of view.
Stored Procedure is a sub program or set of SQL commands stored and integrated in a database. Stored procedure stored in the MySQL server, not the client computer, and will be merged with a database in server.Stored Procedure is a new facility was added in MySQL version 5. With the existence of this facility makes MySQL as a database application that can fully apply the concept of pemrogaman Client-Server, not just Multi-User. Stored Procedure can be accessed via application program a particular object in the program each application. At the time of execution of application programs such as the Delphi, stored procedures will be implemented on the server computer rather than on the client computer and the results sent to the client computer. Thus the division of labor will occur between the client and server, and network traffic activity becomes reduced. As a result of client server performance increases and more efficient.
Select the Stored Procedure has limitations, in Microsoft SQL Server, Stored Procedure same equivalent but with a little different way of making the Stored Procedure we have made above may work, either called directly from SQL Server or if called from an application program. But in MySQL there are still restrictions. If the Stored Procedure executed in Command Line obviously no problem but if run from an application program is still an error message error.

0 komentar:

Posting Komentar