更多"[单选题]在ASP.NET中,现有一个表dt1,它只有一个字段name"的相关试题:
[多选题]设:有一个表T1,分别由以下字段组成:col1(NUMBER),col2(DATE),col3(VACHAR2),以下insert语句合法的是哪两项?
A.insert into T1(col1,col2,col3) values(568, '2-3月-2009','HUNTER')
B.insert into T1 values(568, '2-3月-2009','HUNTER')
C.insert into T1(col1,col2,col3) values(568, 2-3月-2009,'HUNTER')
D.insert into T1(col1,col2,col3) values('568','2-3月-2009',HUNTER)
[单选题]现有表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值
[单选题]现有表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
[单选题]现有产品表Products,包含字段:UnitPrice(商品单价),ProductId(产品编号),ProductName(商品名称),ProductClass(产品类别),从产品表Products中查询单价UnitPrice最高的商品单价,正确的SQL是()。
A.SELECT MIN (UnitPrice) AS 最高单价 FROM Products
B.SELECT AVG (UnitPrice) AS 最高单价 FROM Products
C.SELECT MAX (UnitPrice) AS 最高单价 FROM Products
D.SELECT MAX UnitPrice AS 最高单价 FROM Products
[单选题]现有表book,字段:id (int),title (varchar), price (float); 其中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,其字段有:employeeid(员工编号),gender(员工性别),salary(工资),birthday(生日),name(员工姓名),department(部门),统计1985年1月1日之后出生的员工人数的SQL是()。【选两项】
A.select count(employeeid) 员工总数 from employee where birthday>'1985-01-01'
B.select count(employeeid) 员工总数 from employee where birthday<'1985-01-01'
C.select sum(employeeid) 员工总数 from employee where birthday>'1985-01-01'
D.select count(*) 员工总数 from employee where birthday>'1985-01-01'
[单选题]现有书目表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
[判断题]请求行由请求方法字段、URL字段和DNS协议版本字段3个字段组成,它们用空格分隔。
A.正确
B.错误
[单选题]现有商铺表shop,其字段有:name(商铺名称),classid(类别编号),address(位置),分别统计每个类别的商铺数量,可以使用的SQL是()。
A.select classid,count(*) as num from shop group by classid;
B.select classid,count(*) as num from shop group by name;
C.select classid,sum(*) as num from shop group by address;
D.select classid,sum(*) as num from shop group by classid;
[单选题]现有公司表Company,其字段有:id(员工id),gender(员工性别),salary(工资),age(员工年龄),name(员工姓名),department(部门),统计员工个数的SQL语句,如下正确统计正确显示结果的是()。
A.select count(*) from Company
B.select sum(id) from Company
C.select avg(age) from Company
D.select min(age) from Company
[单选题]现有员工表emp,其字段有:rankid(部门id),empid(员工编号),empname(员工姓名),empage(员工年龄),统计不同部门的员工数量,按部门员工数量升序显示,可以使用的SQL是()。
A.select rankid 部门编号,sum(*) 员工总数 from emp group by rankid order by 员工总数
B.select rankid 部门编号,count(*) 员工总数 from emp order by rankid order by 员工总数
C.select rankid 部门编号,count(*) 员工总数 from emp group by rankid order by 员工总数
D.select rankid 部门编号,count(*) 员工总数 from emp order by rankid group by 员工总数
[单选题]现有学生表student_tb,其字段有:name(学生姓名),classid(班级编号),sex(学生性别),统计 student_tb 表中男生人数的SQL是()。
A.select count(*) from student_tb where sex = '男';
B.select sum(*) from student_tb where sex = '男';
C.select max(*) from student_tb where sex = '男';
D.select avg(*) from student_tb where sex = '男';
[多选题]现有书目表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)
[单选题]现有学生表Student,其字段有:Sname(学生姓名),Sdept(学生系别),查询各系别姓张的学生的人数SQL语句是()。
A.SELECT Sdept, Count(*) AS 张姓人数
FROM Student
WHERE Sname LIKE '张_'
GROUP BY Sdept
B.SELECT Sdept, Count(*) AS 张姓人数
FROM Student
WHERE Sname = '张%'
GROUP BY Sdept
C.SELECT Sdept, Count(*) AS 张姓人数
FROM Student
WHERE Sname LIKE '张%'
GROUP BY Sname
D.SELECT Sdept, Count(*) AS 张姓人数
FROM Student
WHERE Sname LIKE '张%'
GROUP BY Sdept