In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you the specific differences between oracle and mysql. I hope these contents can bring you practical use, which is also the main purpose of this article that I edit the specific differences between oracle and mysql. All right, don't talk too much nonsense, let's just read the following.
I have been using oracle since my work, but I found that many companies may use mysql, so I simply learn the syntax of mysql and start from scratch. MySQL has three main types of data, namely, number, date\ time, and string. In these three categories, many subtypes are divided in more detail: numeric integers: tinyint, smallint, mediumint, int, bigint floating-point numbers: float, double, real, decimal date and time: date, time, datetime, timestamp, year string types string: char, varchar text: tinytext, text, mediumtext, longtext binary (which can be used to store pictures, music, etc.): tinyblob, blob, mediumblob, longblob database common commands to view the structure of the table: desc tabletop800 Describe tabletop800; to view the creation structure of the table: show create table tabletop800; modifies the field type of the table alter table tabletop800 change rating rating char (10); modify the field of the table to NOT NULL + Defaultalter table tabletop800 change price price char (20) not null default 'Free'; modify the primary key of the table: alter table tableop800 drop primary key; deletes the primary key alter table tabletop800 add primary key (id, country, dtime, price), and then adds the primary key to update the field value of the table: update tabletop800 set price='Free' where price='' Export database mysqldump-u root top800 > sql_database_bk/top800_database_bk_2011-10-22.sql export database table mysqldump-u root top800 tabletop800 > sql_database_bk/top800_tabletop800_table_bk_2011-10-22.sql login MySQL: mysql-u root-packs 123456' create database: create database top800 Import the database: mysql-u root-pendant 123456 'top800 < top800_database_bk_2011-11-11.sql found that the basic syntax of mysql is the same as oracle The big difference is the syntax for modifying the established table: mysql operates on the table after creation as follows: alter table statement is used to modify the table after creation, and the basic usage is as follows: add column basic form: alter table table name add column name column data type [after insertion location] Example: append column address: alter table students add address char (60) to the end of the table; insert column birthday: alter table students add birthday date after age; modify column basic form: alter table table name change column name new data type; example: rename table tel column to telphone: alter table students change tel telphone char (13) default "-"; change the data type of name column to char (16): alter table students change name name char (16) not null Delete column basic form: alter table table name drop column name; example: delete birthday column: alter table students drop birthday; rename table basic form: alter table table name rename new table name; example: rename students table to workmates: alter table students rename workmates; delete entire table basic form: drop table table name; example: delete workmates table: drop table workmates; delete entire database basic form: drop database database name; example: delete samp_db database: drop database samp_db The syntax for oracle to operate on the table after creation is as follows: syntax for adding fields: alter table tablename add (column datatype [default value] [null/not null], … ); modify the syntax of the field: alter table tablename modify (column datatype [default value] [null/not null], … .); syntax for deleting fields: alter table tablename drop (column)
If you add, modify or delete multiple columns, separate them with commas.
For the above about what specific differences between oracle and mysql, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.