能不能帮我把这个mysql的语句改称sql的语句?
答案:3 悬赏:70 手机版
解决时间 2021-04-28 12:54
- 提问者网友:niaiwoma
- 2021-04-27 21:23
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for cargo
-- ----------------------------
CREATE TABLE `cargo` (
`Cargo_ID` char(6) NOT NULL,
`Cargo_Name` varchar(50) NOT NULL,
`Cargo_Type` varchar(20) NOT NULL,
PRIMARY KEY (`Cargo_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for department
-- ----------------------------
CREATE TABLE `department` (
`Dep_ID` char(4) NOT NULL,
`Dep_Name` varchar(10) NOT NULL,
PRIMARY KEY (`Dep_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for employee
-- ----------------------------
CREATE TABLE `employee` (
`Emp_ID` int(4) NOT NULL auto_increment,
`Emp_Name` varchar(20) NOT NULL,
`Emp_Sex` char(2) NOT NULL,
`Emp_Age` int(4) NOT NULL,
`Emp_Date` date NOT NULL,
`Emp_Address` varchar(100) NOT NULL,
`Emp_Tel` varchar(10) default NULL,
`Dep_ID` char(4) NOT NULL,
PRIMARY KEY (`Emp_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for manager
-- ----------------------------
CREATE TABLE `manager` (
`Mana_Name` varchar(20) NOT NULL,
`Mana_PWD` varchar(10) NOT NULL,
`Popedom` varchar(4) default NULL,
`Mana_Sex` varchar(255) default NULL,
`Mana_Age` varchar(255) default NULL,
`Mana_DepID` varchar(255) default NULL,
`Mana_Tel` varchar(255) default NULL,
`Mana_Address` varchar(255) default NULL,
PRIMARY KEY (`Mana_Name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for provider
-- ----------------------------
CREATE TABLE `provider` (
`Pro_ID` char(6) NOT NULL,
`Pro_Name` varchar(20) NOT NULL,
`Pro_Tel` varchar(8) NOT NULL,
`Pro_Address` varchar(50) NOT NULL,
`Cargo_Type` char(20) NOT NULL,
`Pro_Date` date NOT NULL,
PRIMARY KEY (`Pro_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sell
-- ----------------------------
CREATE TABLE `sell` (
`Cargo_ID` char(6) NOT NULL,
`Sell_Num` int(8) NOT NULL,
`Sell_Price` double(8,0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for stock
-- ----------------------------
CREATE TABLE `stock` (
`id` int(4) NOT NULL auto_increment,
`Cargo_ID` char(6) NOT NULL,
`Stock_Num` int(8) NOT NULL,
`Stock_Price` double(8,0) NOT NULL,
`Stock_Date` date NOT NULL,
`Pro_ID` char(6) NOT NULL,
`Mana_Name` varchar(20) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for storage
-- ----------------------------
CREATE TABLE `storage` (
`Cargo_ID` char(6) NOT NULL,
`Storage_Num` int(8) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `cargo` VALUES ('111', '111', '111');
INSERT INTO `cargo` VALUES ('123', '123', '123');
INSERT INTO `cargo` VALUES ('321', '321', '321');
INSERT INTO `department` VALUES ('123', '123');
INSERT INTO `employee` VALUES ('1', '123', '12', '123', '2007-12-03', '123', '123', '123');
INSERT INTO `employee` VALUES ('2', '123', '2', '1', '2007-01-01', '1', '1', '1');
INSERT INTO `manager` VALUES ('11', '123', '1', '男', '123', '123', '123', '123');
INSERT INTO `manager` VALUES ('123', '123', '1', '女', '123', '123', '123', '123');
INSERT INTO `manager` VALUES ('12321', '123211', '2', '男', '22', '12321', '1231', '12321');
INSERT INTO `manager` VALUES ('222', '222', '2', '女', '222', '222', '222', '222');
INSERT INTO `provider` VALUES ('fewfew', 'f23123', '3123', '312312', '12312', '2008-01-07');
INSERT INTO `provider` VALUES ('321', '321', '321', '321', '321', '2007-12-03');
INSERT INTO `provider` VALUES ('`121`2', '`121`2', '1312312', '312312', '21312', '2008-01-07');
INSERT INTO `provider` VALUES ('deddw', 'dwdw', 'dedwdwdw', 'wd', 'ddwdw', '2008-01-07');
INSERT INTO `sell` VALUES ('123', '92', '23');
INSERT INTO `sell` VALUES ('111', '23', '33');
INSERT INTO `stock` VALUES ('1', '123', '3', '123', '2007-12-03', '123', '11');
INSERT INTO `stock` VALUES ('2', '123', '123', '123', '2007-12-03', '123', '11');
INSERT INTO `stock` VALUES ('3', '123', '123', '123', '2007-12-03', '123', '11');
INSERT INTO `stock` VALUES ('4', '321', '321', '321', '2007-12-03', '321', '11');
INSERT INTO `stock` VALUES ('5', '321', '321', '321', '2007-12-03', '321', '11');
INSERT INTO `stock` VALUES ('6', '111', '111', '111', '2007-12-03', '111', '11');
INSERT INTO `storage` VALUES ('123', '154');
INSERT INTO `storage` VALUES ('321', '642');
INSERT INTO `storage` VALUES ('111', '88');
最佳答案
- 五星知识达人网友:过活
- 2021-04-27 22:39
Use master
Go
If Exists (select * from sysdataBases where name = 'supermarket')
Drop dataBase supermarket
Go
Create DataBase supermarket
On
Primary
(
Name = 'supermarket_data',
FileName = 'E:\supermarket_data.mdf',
Size = 10MB,
FileGrowth = 20%
)
Log On
(
Name = 'supermarket_log',
FileName = 'E:\supermarket_log.ldf',
Size = 3MB,
MaxSize = 20MB,
FileGrowth = 10%
)
use supermarket
go
CREATE TABLE cargo (
Cargo_ID char(6) NOT NULL primary key,
Cargo_Name varchar(50) NOT NULL,
Cargo_Type varchar(20) NOT NULL
)
drop table cargo
-- ----------------------------
-- Table structure for department
-- ----------------------------
CREATE TABLE department(
Dep_ID char(4) NOT NULL PRIMARY KEY,
Dep_Name varchar(10) NOT NULL
)
drop table employee
-- ----------------------------
-- Table structure for employee
-- ----------------------------
CREATE TABLE employee (
Emp_ID int identity(1,1) NOT NULL primary key,
Emp_Name varchar(20) NOT NULL,
Emp_Sex char(2) NOT NULL,
Emp_Age int NOT NULL,
Emp_Date datetime NOT NULL,
Emp_Address varchar(100) NOT NULL,
Emp_Tel varchar(10) default NULL,
Dep_ID char(4) NOT NULL
)
-- ----------------------------
-- Table structure for manager
-- ----------------------------
CREATE TABLE manager (
Mana_Name varchar(20) NOT NULL PRIMARY KEY,
Mana_PWD varchar(10) NOT NULL,
Popedom varchar(4) default NULL,
Mana_Sex varchar(255) default NULL,
Mana_Age varchar(255) default NULL,
Mana_DepID varchar(255) default NULL,
Mana_Tel varchar(255) default NULL,
Mana_Address varchar(255) default NULL
)
-- ----------------------------
-- Table structure for provider
-- ----------------------------
CREATE TABLE provider (
Pro_ID char(6) NOT NULL primary key,
Pro_Name varchar(20) NOT NULL,
Pro_Tel varchar(8) NOT NULL,
Pro_Address varchar(50) NOT NULL,
Cargo_Type char(20) NOT NULL,
Pro_Date datetime NOT NULL
)
-- ----------------------------
-- Table structure for sell
-- ----------------------------
CREATE TABLE sell (
Cargo_ID char(6) NOT NULL,
Sell_Num int NOT NULL,
Sell_Price numeric(8,0) NOT NULL
)
-- ----------------------------
-- Table structure for stock
-- ----------------------------
drop table stock
CREATE TABLE stock (
id int identity(1,1) NOT NULL primary key,
Cargo_ID char(6) NOT NULL,
Stock_Num int NOT NULL,
Stock_Price numeric(8,0) NOT NULL,
Stock_Date datetime NOT NULL,
Pro_ID char(6) NOT NULL,
Mana_Name varchar(20) default NULL
)
-- ----------------------------
-- Table structure for storage
-- ----------------------------
CREATE TABLE storage(
Cargo_ID char(6) NOT NULL,
Storage_Num int NOT NULL
)
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO cargo VALUES ('111', '111', '111');
INSERT INTO cargo VALUES ('123', '123', '123');
INSERT INTO cargo VALUES ('321', '321', '321');
INSERT INTO department VALUES ('123', '123');
INSERT INTO employee VALUES ( '123', '12', 123, '2007-12-03', '123', '123', '123');
INSERT INTO employee VALUES ( '123', '2', 1, '2007-01-01', '1', '1', '1');
INSERT INTO manager VALUES ( '123','123', '1', '男', '123', '123', '123', '123');
INSERT INTO manager VALUES ('124', '123', '1', '女', '123', '123', '123', '123');
INSERT INTO manager VALUES ('12321', '123211', '2', '男', '22', '12321', '1231', '12321');
INSERT INTO manager VALUES ('222', '222', '2', '女', '222', '222', '222', '222');
INSERT INTO provider VALUES ('fewfew', 'f23123', '3123', '312312', '12312', '2008-01-07');
INSERT INTO provider VALUES ('321', '321', '321', '321', '321', '2007-12-03');
INSERT INTO provider VALUES ('`121`2', '`121`2', '1312312', '312312', '21312', '2008-01-07');
INSERT INTO provider VALUES ('deddw', 'dwdw', 'dedwdwdw', 'wd', 'ddwdw', '2008-01-07');
INSERT INTO sell VALUES ('123', 92, '23');
INSERT INTO sell VALUES ('111', 23, '33');
INSERT INTO stock VALUES ( '123', 3, '123', '2007-12-03', '123', '11');
INSERT INTO stock VALUES ( '123', 123, '123', '2007-12-03', '123', '11');
INSERT INTO stock VALUES ( '123', 123, '123', '2007-12-03', '123', '11');
INSERT INTO stock VALUES ( '321', 321, '321', '2007-12-03', '321', '11');
INSERT INTO stock VALUES ('321', 21, '321', '2007-12-03', '321', '11');
INSERT INTO stock VALUES ( '111', 111, '111', '2007-12-03', '111', '11');
INSERT INTO storage VALUES ('123', 154);
INSERT INTO storage VALUES ('321', 642);
INSERT INTO storage VALUES ('111', 88);
全部回答
- 1楼网友:患得患失的劫
- 2021-04-27 23:41
--SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for cargo
-- ----------------------------
CREATE TABLE cargo (
Cargo_ID char(6) NOT NULL constraint PK_Cargo_Id primary key,
Cargo_Name varchar(50) NOT NULL,
Cargo_Type varchar(20) NOT NULL
)
-- ----------------------------
-- Table structure for department
-- ----------------------------
CREATE TABLE department (
Dep_ID char(4) NOT NULL constraint PK_Dep_ID primary key,
Dep_Name varchar(10) NOT NULL
)
-- ----------------------------
-- Table structure for employee
-- ----------------------------
CREATE TABLE employee (
Emp_ID int(4) identity(1,1) NOT NULL constraint PK_Emp_ID primary key,
Emp_Name varchar(20) NOT NULL,
Emp_Sex char(2) NOT NULL,
Emp_Age int(4) NOT NULL,
Emp_Date datetime NOT NULL,
Emp_Address varchar(100) NOT NULL,
Emp_Tel varchar(10) default NULL,
Dep_ID char(4) NOT NULL
)
-- ----------------------------
-- Table structure for manager
-- ----------------------------
CREATE TABLE manager (
Mana_Name varchar(20) NOT NULL constraint PK_Mana_Name primary key,
Mana_PWD varchar(10) NOT NULL,
Popedom varchar(4) default NULL,
Mana_Sex varchar(255) default NULL,
Mana_Age varchar(255) default NULL,
Mana_DepID varchar(255) default NULL,
Mana_Tel varchar(255) default NULL,
Mana_Address varchar(255) default NULL
)
-- ----------------------------
-- Table structure for provider
-- ----------------------------
CREATE TABLE provider (
Pro_ID char(6) NOT NULL constraint PK_Pro_ID primary key,
Pro_Name varchar(20) NOT NULL,
Pro_Tel varchar(8) NOT NULL,
Pro_Address varchar(50) NOT NULL,
Cargo_Type char(20) NOT NULL,
Pro_Date datetime NOT NULL
)
-- ----------------------------
-- Table structure for sell
-- ----------------------------
CREATE TABLE sell (
Cargo_ID char(6) NOT NULL,
Sell_Num int(8) NOT NULL,
Sell_Price double(8,0) NOT NULL
)
-- ----------------------------
-- Table structure for stock
-- ----------------------------
CREATE TABLE stock (
id int(4) identity(1,1) NOT NULL constraint PK_ID primary key,
Cargo_ID char(6) NOT NULL,
Stock_Num int(8) NOT NULL,
Stock_Price double(8,0) NOT NULL,
Stock_Date datetime NOT NULL,
Pro_ID char(6) NOT NULL,
Mana_Name varchar(20) default NULL
)
-- ----------------------------
-- Table structure for storage
-- ----------------------------
CREATE TABLE storage (
Cargo_ID char(6) NOT NULL,
Storage_Num int(8) NOT NULL
)
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO cargo VALUES ('
- 2楼网友:醉吻情书
- 2021-04-27 23:05
MySQL语句也是SQL语句呀,不同的数据库之间SQL语句存在一定的差别,不知道你想改成哪个数据库的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯