-3
CREATE TABLE BestSinger(
     RapperID INT,
     FirstName VARCHAR(22),
     NicName VATCHAR (16),
    LastName VARCHAR(28),
     PRIMARY KEY (singer));


CREATE TABLE WorstSinges(
     Phone INT,
     ClassName VARCHAR(30),
     PRIMARY KEY (Singer));


 CREATE TABLE PriceForWinner (
     FirstPlace INT,
     SecondPlace INT,
     ThirdPlace DATE,
 );

将 NETURAL 记录添加到最差歌手
将 Marvin T. Wade、Jimie Z、Johnson 和 P Jacque 添加到 NEUTRAL 记录
将 Foday U. James、Alfred D. 同步到 Best Singer
使用 SELECT STATEMENT 显示您添加到最佳歌手表的数据

4

2 回答 2

2

a) The following script

CREATE TABLE BestSinger(
     RapperID INT,
     FirstName VARCHAR(22),
     NicName VATCHAR (16),
    LastName VARCHAR(28),
     PRIMARY KEY (singer));

Should corrected as

CREATE TABLE BestSinger(
     RapperID INT,
     FirstName VARCHAR(22),
     NicName VARCHAR (16),
    LastName VARCHAR(28),
     PRIMARY KEY (singer));

It is VARCHAR and not VATCHAR. It's a typo.

b) Column name 'singer' is use to define constraint but it does not exist in your tables columns definition.

Fixing issues described under (a) and (b), you can define script as below (assuming your constraint field is of type INT)

CREATE TABLE BestSinger(Singer INT, RapperID INT, FirstName VARCHAR(22), NicName VARCHAR (16), LastName VARCHAR(28), PRIMARY KEY (singer));
CREATE TABLE WorstSinges(Singer INT,Phone INT, ClassName VARCHAR(30), PRIMARY KEY (Singer));
CREATE TABLE PriceForWinner ( FirstPlace INT, SecondPlace INT, ThirdPlace DATE, ); 
于 2013-06-19T08:25:36.853 回答
1

将列 NicName 的数据类型从 VATCHAR(16) 更改为 VARCHAR(16)

于 2013-06-19T09:40:42.997 回答