I would like to create DB.
I have a script file .sql like this :
CREATE TABLE [AlleleFreqBySsPop]
(
[subsnp_id] [int] NOT NULL ,
[pop_id] [int] NOT NULL ,
[allele_id] [int] NOT NULL ,
[source] [varchar](2) NOT NULL ,
[cnt] [real] NULL ,
[freq] [real] NULL ,
[last_updated_time] [datetime] NOT NULL
)
GO
It seems to be different from mysql or postgresql.
What type of languige is this? How can I use it?
Judging by the square brackets and the
GOkeyword, I would say that this is T-SQL (MS SQL Server). To use it in MySQL, you could probably just remove the square brackets and solve incompatibilities (ie. types or missing escaping) from there on.I just tested this in SQL Fiddle, and simply removing the square brackets is enough in this case. For other DDL statements however, you may have to substitute types (ie.
datetime2from T-SQL is not supported in MySQL), and you may run into other problems – like the need to escape column names that are reserved keywords in one dialect but not the other, etc. The usual SQL databases do not use 100% standards compliant SQL.