更多"[单选题]现有表book,字段:id (int),title (var"的相关试题:
[单选题]现有表book,字段:id (int),title (varchar), price (decimal); 其中id字段设为标识, 使用insert语句向book表中插入数据,以下语句错误的是()。
A.insert into book (id,title,price) values(1,'java',100)
B.insert into book (title,price) values('java',100)
C.insert into book values ('java',100)
D.insert book values('java',100)
[单选题]现有表Employee,字段id(int),firstname(varchar),lastname(varchar);以下sql语句错误的是()。
A.select firstname+'.'+lastname as 'name' from employee
B.select firstname+'.'+lastname = 'name' from employee
C.select 'name'= firstname+'.'+lastname from employee
D.select firstname,lastname from employee
[多选题]现有表Employee,字段:id (int),firstname(varchar), lastname(varchar); 以下sql语句正确是哪三项?
A.select firstname+'.'+lastname as 'name' from employee
B.select firstname+'.'+lastname='name' from employee
C.select 'name'=firstname+'.'+lastname from employee
D.select firstname,lastname from employee
[单选题]表book中包含三个字段:title(varchar), author(varchar), price(decimal(6,2))。Author的默认值是’UNKNOW’,执行SQL语句:insert book (title,price) values ('jsp', 50)。以下结果正确的是
A.插入失败,SQL语句有错
B.插入成功,author列的数据是UNKNOW
C.插入成功,author列的数据是NULL
D.插入成功,author列的数据是50
[单选题]现有表user,字段:userid,username, salary, deptid,email; 表department,字段:deptid, deptname;下面()应采用检查约束来实现。
A.若department中不存在deptid为2的纪录,则不允许在user表中插入deptid为2的数据行
B.若user表中已经存在userid为10的记录,则不允许在user表中再次插入userid为10的数据行
C.User表中的salary(薪水)值必须在1000元以上
D.若User表的email列允许为空,则向user表中插入数据时, 可以不输入email值
[单选题]现有书目表book,包含字段:价格price ,类别名称typeName; 现在查询各个类别的平均价格、类别名称,以下语句正确的是()。
A.select avg(price),type from book group by typeName
B.select count(price),type from book group by typeName
C.select avg(price),type from book group by typeName
D.select count (price),type from book group by typeName
[单选题]现有书目表book,包含字段:价格price (float),类别type(char); 现在查询各个类别的平均价格、类别名称,以下语句正确的是()
A.select avg(price),type from book group by type
B.select count(price),type from book group by price
C.select avg(price),type from book group by price
D.select count (price),type from book group by type
[多选题]现有书目表book,包含字段:price (float); 现在查询一条书价最高的书目的详细信息,以下语句正确的是哪两项?
A.select top 1 * from book order by price asc
B.select top 1 * from book order by price desc
C.select top 1 * from book where price= (select max (price)from book)
D.select top 1 * from book where price= max(price)
[多选题]现有图书表book,包含字段:price(decimal(6,2));现查询书价最高的图书信息,正确语句是()。【选两项】
A.select top 1 * from book order by price asc
B.select top 1 * from book order by price desc
C.select top 1 * from book where price=max(price)
D.select top 1 * from book where price=(select max(price) from book)
[多选题]现有表book,主键bookid设为标识列。若执行语句:select * into book2 from book 以下说法正确的是(选两项)
A.若数据库中已存在表book2, 则会提示错误
B.若数据库中已存在表book2, 则语句执行成功,并且表book2中的bookid自动设为标识。
C.若数据库中不存在表book2, 则语句执行成功,并且表book2中的bookid自动设为主键。
D.若数据库中不存在表book2, 则语句执行成功,并且表book2中的bookid自动设为标识