MySQL, SQL Server, Oracle between the three types

 

Reprinted: https: //www.cnblogs.com/hubgit/p/6837081.html

Oracle

Oracle can run on all major platforms (including Windows). Fully supports all industry standards. A completely open policy. It allows customers to choose the most appropriate solution. Full support for developers, Oracle Parallel Server by making a set of nodes share the same cluster in the work to extend the capabilities of Windows NT to provide high availability and highly scalable cluster solution. If Windows NT does not meet the requirements, you can move the database to UNIX. Oracle Parallel Server cluster mechanism for various UNIX platforms have a very high degree of integration. Oracle received the highest level of ISO certification standards .Oracle highest performance, keep the TPC-D and TPC-C under the open platform world record Oracle multi-level network computing to support a variety of industry standard, you can use ODBC, JDBC, OCI-peer network client connections.
Oracle on compatibility, portability, may be coupled, high productivity, there is an advantage also open. Oracle products using standard SQL, and after the American National Standards and Technology (NIST) test. Compatible with IBM SQL / DS, DB2, INGRES , IDMS / R and so on. Oracle's products can be run on a wide range of hardware and operating system platforms. May be mounted on more than 70 kinds of large, medium, minicomputers; can work under VMS, DOS, UNIX, WINDOWS and other operating systems. Can be connected with a variety of communications networks, supports various protocols (TCP / IP, DECnet, LU6.2, etc.). Offers a variety of development tools, can greatly facilitate the user for further development. Oracle good compatibility, portability, connectivity and high productivity are Oracle RDBMS has good openness.
Oracle price is relatively expensive. It is said that a genuine Oracle software as early as the end of 2006 when the price in the market has reached six figures. So if your project is not the kind of super-large projects, Oracle or give it.

SQL Server

SQL Server is Microsoft launched a product that is easy to use, good scalability, and software integration advantages of higher degree, becoming one of the more ideal choice for database application development under Windows platform. SQLServer is one of the popular database, it has been widely used database-related industries as finance, insurance, electricity, administration and so on. Moreover, because of its ease of operation and friendly interface, won the majority of users of all ages, especially SQLServer and other databases, such as Access, FoxPro, Excel have a good ODBC interface, you can turn into the aforementioned database of SQLServer database, more and more readers are using SQLServer.
Because SQL Server is Microsoft's products, but also has so powerful, so his influence is one of several large database systems, users are also more and more. It is generally the same and are .net platform together with the use of Microsoft products. Of course, a variety of other development platform, provides its associated database connection. Therefore, the development of software to do the database with SQL Server is the right choice.

MySQL

MySQL does not support transactions (article tail of the transaction introduction of mysql), no view, no stored procedures and triggers, users no end custom database function, can not fully use the standard SQL syntax. 
The first thing I heard from an expert database MySQL is the lack of transactions, rollbacks, and subselects functions. If you plan to use MySQL to write about banking, accounting application, or a number of planned maintenance at any time require linear counter that is incremented different classes, you will lack transactions function. Under the current release version of MySQL, please do not have any of these ideas. (Please note, MySQL 3.23.x series of test version now supports transactions a). 
  In necessary cases, MySQL limitations can be overcome through the efforts of a part of the developer. In MySQL you lose primary function is subselect statement, and this is all the other databases have. In other words, this is a painful loss of function. 
MySQL can not handle complex relational database functions, such as sub-queries (subqueries), although most of the sub-query can be rewritten to join 
another MySQL does not provide support for the function of transaction processing (transaction) and transaction submitted to (commit ) / undo (rollback). A transaction refers to a group or set of commands are treated as a unit for joint implementation. If a transaction is not completed, then the entire transaction there is no instruction is actually executed a go. For online orders must be processed commercial web sites, MySQL does not support this feature, really make people feel very disappointed. But you can use MaxSQL, a separate server, it supports transactional functionality through plug-in form.  
Foreign key (foreignkey) and referential integrity limit (referentialintegrity) allows you to develop the table constraints between data, then constraints (constraint) added to the inside information you specified. The MySQL does not have a functional representation of a complex application data depends on the relationship is not suitable for use MySQL. When we say that MySQL does not support foreign keys, we mean that the referential integrity of the database --MySQL limit rule does not support foreign keys, of course, without the support of the cascading delete (cascadingdelete) function. In short, if your work requires the use of the information associated with complex, you still use the original Access bar.  
You will not find the storage process (storedprocedure) and trigger (trigger) in MySQL. (For these functions, the Access provides a relatively course of events (eventprocedure).
MySQL + PHP + three are the Apache software developers called "php golden combination."

The main difference between Oracle and MySQL

Oracle: Client and Command window, the contents are determined by the user -> conn user_name / password;

MySQL: The client and the command window, are determined by the contents of the database -> use datebase;

Can create a multi-user multi-database, individuals tend to Oracle database in the form of a plurality of users, MySQL users in the form of a plurality of multiple databases (the best one for each database user)

Oracle is a large database and MySQL is a small and medium sized databases, Oracle market share of 40%, only about 20% of MySQL, but MySQL is open source and Oracle price is very high.

Oracle supports concurrent big, big traffic, is the OLTP (On-Line Transaction Processing online transaction processing system) the best tool.

Differences in the installation space used is great, MySQL and Oracle have only about 152M 3G after installation, when the occupancy and use of Oracle particularly large memory space and other machine performance.

Oracle also some differences on the operations and MySQL

Group function usage rules

MySQL Feel free to use the set of functions in the select statement, but in Oracle if the query has set of functions that other column name must be a function of the treated group, or a group by clause column otherwise an error
EG:
select name, count (money) from user ; this is not a problem on MySQL have a problem in Oracle.

Automatically increase the type of data processing

Automatic growth of MySQL data types, do not operate in this field when the record is inserted, it will automatically get the data value. Oracle does not automatically increase the type of data, a sequence number need for automatic increase, take the next sequence number value when a record assigns this field.
Name CREATE SEQUENCE serial number (preferably table name + SEQ ID tag) INCREMENT BY 1 START WITH 1 MAXVALUE 99999 CYCLE NOCACHE;
wherein the values as the maximum length field to set, if the automatic growth sequence defined number NUMBER (6 ), a maximum of 999999
the iNSERT statement to insert the field value: name serial number .NEXTVAL

Single quotes treatment

MySQL where you can wrap the string with double quotation marks, Oracle where you can only wrap the string in single quotation marks. Single quotes must be replaced before insertion and modify the string: replace every occurrence of a single quote into two single quotes.

SQL statement handle flip

MySQL flip process is relatively simple SQL statements, with LIMIT starting position, the number of records; can also be used in the PHP SEEK result set target position. Oracle SQL statement handle flip a relatively complicated. ROWNUM each result set is only one field indicating its position, and can only use ROWNUM <100, can not use ROWNUM> 80.
The following analysis is better after two flip Oracle SQL statement (ID is the only keyword field name):
Statement a:
the SELECT ID, [FIELD_NAME, ...] the FROM TABLE_NAME the WHERE ID the IN (the SELECT ID the FROM (the SELECT ROWNUM AS NUMROW, ID FROM TABLE_NAME WHERE condition 1 ORDER BY condition 2) WHERE NUMROW> 80 AND NUMROW <100) ORDER BY conditions 3;

语句二:
SELECT * FROM (( SELECT ROWNUM AS NUMROW, c.* from (SELECT [FIELD_NAME,...] FROM TABLE_NAME WHERE 条件1 ORDER BY 条件2) c) WHERE NUMROW > 80 AND NUMROW < 100 ) ORDER BY 条件3;

Handle long strings

Long string handling Oracle also has its special place. When the maximum string length INSERT and UPDATE operable 4000 single-byte or less, if you want to insert a longer string, consider using CLOB type field, a method borrowed in Oracle's own DBMS_LOB package. Non-empty and must be done before insertion length determination modify records, can not be null and the field value exceeds the length field should be warned to return the last operation.

Processing date field

MySQL date field DATE and TIME two kinds of points, Oracle date fields only DATE, minute and second information comprising the date, with the current system time of the database is SYSDATE, accurate to the second, or converted into a string date type function TO_DATE ( '2001 -08-01 ',' YYYY-MM-DD ') Year - month - day 24 hours: minutes: seconds format YYYY-MM-DD HH24: MI: SS TO_DATE () there are many date formats, you can see Oracle DOC.

Date fields to convert string function TO_CHAR ( '2001-08-01', 'YYYY -MM-DD HH24:: MI SS')
math formulas date field are very different. MySQL found from the current time of 7 days with DATE_FIELD_NAME> SUBDATE (NOW (), INTERVAL 7 DAY) Oracle found from the current time of 7 days with DATE_FIELD_NAME> SYSDATE -. 7;
MySQL inserting the current time is several functions: NOW () function to ` 'YYYY-MM-DD HH : MM: SS' returns the current date and time, can be stored directly into DATETIME column. CURDATE () to return to today's date 'YYYY-MM-DD' format, can be stored directly in a DATE field. CURTIME () to return the current time 'HH:: MM SS' format, can be stored directly into the TIME field. Example: insert into tablename (fieldname) values (now ())
and the current time is Oracle sysdate

Handling null characters

MySQL is non-empty field is also empty of content, Oracle in the definition of non-empty fields will not allow the free content. Oracle table structure to define, guide data according to the MySQL NOT NULL when an error occurs. Therefore to judge the null characters guide data, or if a null character is NULL, it needs to change a string of space.

Fuzzy string comparison

Like a field name in MySQL% '% string', can also be held like the Oracle% 'string%' but this method can not be used for index field names, slow speed, with a string comparison function InStr (field names, 'character string ')> 0 will be more accurate search results.

Procedures and functions, the operation of the database work Note that the result set and release the pointer after completion.

Primary key

MySQL is generally used automatic growth type, as long as the specified table to create a table primary key auto increment, when a record, do not need to specify the primary key of the record, MySQL will automatically increase; the Oracle does not automatically increase the type of the primary key commonly used sequence, when a record with the next value of the sequence number field to be paid; ORM framework is just as long as the primary key generation strategy can be native.

Oracle has implemented most of ANSIISQL function, such as transaction isolation level, propagation characteristics and MySQL in this area is still relatively weak

Guess you like

Origin www.cnblogs.com/xiaominkang/p/10955249.html