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添加到worstSinger中 将Marvin T. Wade,Jimie Z,Johnson和P Jacque添加到中性记录中 添加Foday U. James,Alfred D. Sync为最佳歌手 使用SELECT STATEMENT显示您添加到最佳歌手表的数据
答案 0 :(得分:2)
a)以下脚本
CREATE TABLE BestSinger(
RapperID INT,
FirstName VARCHAR(22),
NicName VATCHAR (16),
LastName VARCHAR(28),
PRIMARY KEY (singer));
应更正为
CREATE TABLE BestSinger(
RapperID INT,
FirstName VARCHAR(22),
NicName VARCHAR (16),
LastName VARCHAR(28),
PRIMARY KEY (singer));
它是VARCHAR
而不是VATCHAR。这是一个错字。
b)列名“singer
”用于定义约束,但在表列定义中不存在。
修复(a)和(b)中描述的问题,您可以如下定义脚本(假设您的约束字段属于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, );
答案 1 :(得分:1)
将列NickName的数据类型从VARCHAR(16)
更改为VARCHAR(16)