用sql server语句创建餐饮管理系统包括员工信息表,日点单信息表,商品基础信息表,房间台号信息表,供应商信息表,房间台号类型表,部门信息表
时间: 2023-08-29 09:06:08 浏览: 71
好的,以下是创建餐饮管理系统所需的 SQL Server 语句:
1. 创建员工信息表
```
CREATE TABLE Employee (
EmployeeID INT PRIMARY KEY,
EmployeeName VARCHAR(50),
Gender VARCHAR(10),
Birthday DATE,
DepartmentID INT FOREIGN KEY REFERENCES Department(DepartmentID),
Position VARCHAR(50),
Salary FLOAT,
Phone VARCHAR(20),
Address VARCHAR(200)
)
```
2. 创建日点单信息表
```
CREATE TABLE DailyOrder (
OrderID INT PRIMARY KEY,
OrderDate DATE,
EmployeeID INT FOREIGN KEY REFERENCES Employee(EmployeeID),
RoomNo VARCHAR(10) FOREIGN KEY REFERENCES Room(RoomNo),
TotalAmount FLOAT
)
```
3. 创建商品基础信息表
```
CREATE TABLE Product (
ProductID INT PRIMARY KEY,
ProductName VARCHAR(50),
Category VARCHAR(50),
Description VARCHAR(200),
Price FLOAT,
SupplierID INT FOREIGN KEY REFERENCES Supplier(SupplierID)
)
```
4. 创建房间台号信息表
```
CREATE TABLE Room (
RoomNo VARCHAR(10) PRIMARY KEY,
RoomTypeCode VARCHAR(10) FOREIGN KEY REFERENCES RoomType(RoomTypeCode),
Capacity INT
)
```
5. 创建供应商信息表
```
CREATE TABLE Supplier (
SupplierID INT PRIMARY KEY,
SupplierName VARCHAR(50),
Address VARCHAR(200),
Phone VARCHAR(20),
Email VARCHAR(50)
)
```
6. 创建房间台号类型表
```
CREATE TABLE RoomType (
RoomTypeCode VARCHAR(10) PRIMARY KEY,
RoomType VARCHAR(50),
Price FLOAT
)
```
7. 创建部门信息表
```
CREATE TABLE Department (
DepartmentID INT PRIMARY KEY,
DepartmentName VARCHAR(50),
ManagerID INT FOREIGN KEY REFERENCES Employee(EmployeeID),
Description VARCHAR(200)
)
```
以上是基本的 SQL Server 创建表的语句,具体的表结构和字段可以根据实际需求进行调整。
阅读全文