SQL Server下建库和建表
建立pyqt5数据库
打开SQL Server,在对象资源管理器的数据库上点右键,选择新建数据库,创建pyqt5数据库
添加描述
添加描述
在pyqt5数据库下建表和插入数据
CREATE TABLE employee(
EmpNo INT PRIMARY KEY,
Name VARCHAR(20) NOT NULL,
Gender VARCHAR(4) DEFAULT '男',
Birthday VARCHAR(20),
Province VARCHAR(20),
Department VARCHAR(30),
Salary FLOAT DEFAULT 3500,
Memo VARCHAR(200)
)
INSERT INTO employee(EmpNo, Name, Gender, Birthday, Province, Department, Salary, Memo)
VALUES(1001, '黄蓉', '女', '2002-04-30', '浙江', '销售部', 9500, '丐帮帮主')
INSERT INTO employee(EmpNo, Name, Gender, Birthday, Province, Department, Salary, Memo)
VALUES(1002, '郭靖', '男', '2000-05-21', '蒙古', '技术部', 14000, '侠之大者,为国为民')
INSERT INTO employee(EmpNo, Name, Gender, Birthday, Province, Department, Salary, Memo)
VALUES(1003, '杨康', '男', '2000-06-12', '陕西', '销售部', 6000, '认贼作父')
INSERT INTO employee(EmpNo, Name, Gender, Birthday, Province, Department, Salary, Memo)
VALUES(1004, '穆念慈', '女', '2001-10-10', '吉林', '财务部', 6000, '气质若如兰')
INSERT INTO employee(EmpNo, Name, Gender, Birthday, Province, Department, Salary, Memo)
VALUES(1005, '华筝', '女', '2001-12-8', '蒙古', '行政部', 6000, '英姿飒爽')
我正在参与2023腾讯技术创作特训营第三期有奖征文,组队打卡瓜分大奖!