Home > database >  Near the ') 'error and the database called' readers' existing objects
Near the ') 'error and the database called' readers' existing objects

Time:09-16

USE library _ lending
The CREATE TABLE readers (
PRIMARY KEY number CHAR (8),
Name a VARCHAR (8) NOT NULL,
Unit VARCHAR (30),
Gender CHAR (2) the CHECK (gender IN (' male ', 'woman')),
Telephone VARCHAR (11))

The CREATE TABLE books (
Book number CHAR (1) PRIMARY KEY,
Category VARCHAR (12) NOT NULL,
Press VARCHAR (30),
The author VARCHAR (20),
The title VARCHAR (50) NOT NULL,
Pricing MONEY)
GO
The CREATE TABLE borrowing (
Book number CHAR (1) NOT NULL,
Readers number CHAR (8) NOT NULL,
Date borrowed a DATETIME NOT NULL,
The CONSTRAINT C1 PRIMARY KEY number (isbn, readers),
The CONSTRAINT C2 FOREIGN KEY number (the reader)
The REFERENCES the reader (number),
The CONSTRAINT C3 FOREIGN KEY (isbn)
The REFERENCES books (isbn))

CodePudding user response:

CREATE TABLE borrowing (


The parentheses, is half Angle, you change to half Angle of the line,

CodePudding user response:

the CONSTRAINT C2 FOREIGN KEY number (the reader)


The), is the whole Angle
  • Related