Update record
2017.7.20: Online SQL formatting/compression tool completed online

Online SQL formatting/compression tool

This is an online tool that can format and compress SQL statements, can achieve the formatting, beautification, compression and other functions of SQL statements, and can also copy the processed SQL code to the clipboard, is a very practical SQL code processing tool. Free for those who need it.

Paste SQL code to format or compress:
The XML display area after formatting or compression

About the online formatting SQL tool | Sql Format

  • SQL statement is specially used to deal with the database data language, you can through a variety of operations such as sorting, from the database server to obtain the data you want.
  • The current web system is more and more complex, the corresponding database table structure is also very complex, from which to obtain the data that needs to be displayed on the web, perhaps the data of several tables need to be combined, and some of the data are filtered, etc., which lead to more and more lengthy SQL statements, the purpose of this tool is to format and beautify the sql statements you write. Has been presented to developers in the most readable form.

Attached: Common SQL statement description

1. CREATE database database-name

2. Delete database drop database dbname

3. Backing up sql server: Creating backup data device USE master EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat' -- Start BACKUP DATABASE pubs TO testBack

create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)

A: create table tab_new like tab_old B: create table tab_new as select col1,col2... A: create table tab_new like tab_old from tab_old definition only

5. drop table tabname from a new table

6. add a column. Alter table tabname add column col type Note: Columns cannot be deleted after being added. The data type cannot be changed after columns are added in DB2, the only thing that can be changed is to increase the length of the varchar type.

7. Alter table tabname add primary key(col) Alter table tabname drop primary key(col)

8. create [unique] index idxname on tabname(col... .). drop index: drop index idxname Note: The index cannot be changed. If you want to change it, you must delete it and rebuild it.

9. create a view: create view viewname as select statement Delete a view: drop view viewname

10, a few simple basic sql statement selection: select * from table1 where range insert: insert into table1(field1,field2) values(value1,value2) Delete: delete from table1 where Range update: update table1 set field1=value1 where Range search: select * from table1 where field1 like '%value1%' --like syntax is very subtle, check the data! select * from table1 order by field1,field2 [desc] Total: select count as totalcount from table1 Sum: select * from table1 order by field1,field2 [desc] select sum(field1) as sumvalue from table1 Average: select avg(field1) as avgvalue from table1 Maximum: select max(field1) as maxvalue from table1: select min(field1) as minvalue from table1

Script home tool class small program online! Wechat applet search script home toolbox or scan the following applet code directly open applet!

Small program toolbox is still improving, welcome to put forward valuable comments!


In order to repay the attention of the majority of users to Script home, Script home carries out red envelopes, books and gifts from time to time

Follow the official wechat public platform to participate in the event!

Finally, thank you for your support of Script House Online tools!