第一题
选择题(每题2分,共20分)
1已知员工表emp(empno,ename,job,sal)其中empno 员工编号,ename 员工姓名,job员工的职位,sal员工的工资。若要查看工资大于2000的员工的信息,则正确的sql语句是 ( b )
A、 select * from emp;
B、select * from emp where sal>2000;
C 、select * emp where sal>2000 ;
D 、select * from emp sal>2000;
2已知员工表emp(empno,ename,job,sal)其中empno 员工编号,ename 员工姓名,job员工的职位,sal员工的工资。查询所有员工的姓名和工资,则正确的sql语句是( b )
A、select ename,sal on emp;
B、select ename,sal from emp;
C、select emp from ename,sal;
D、select emp(ename,job);
3已知员工表emp(empno,ename,job,sal)其中empno 员工编号,ename 员工姓名,job员工的职位,sal员工的工资。查询工资sal大于3000职位为manager的员工信息的SQL语句为(b )
A、select * from emp where sal >3000 or job=’manager’;
B、select * from emp where sal >3000 and job=’manager’;
C、select * from emp where sal >3000 ,job=’manager’;
D、select * from emp where sal >3000 or job!=’manager’;
4有一个SQL语句为select * from fruits where price=20 or price=30 or price=35; 则下列语句中与其等同的是( b)
A. select * from fruits where price = (20,30,35) ;
B. select * from fruits where price in (20,30,35);
C. select * from fruits where price!=20 or 30 or 35;
D. select * from fruits where price!=20 and price!=30 and price!=35;
5已知员工表emp(empno,ename,job,sal,comm,deptno)其中empno 员工编号,ename 员工姓名,job员工的职位,sal员工的工资,comm 奖金,deptno 员工所在部门编号。查询奖金为空的员工信息,则正确的sql语句是( a )
A、select * from emp where comm=null;
B、select * from emp where comm is not null;
C、select * from emp where comm <>null;
D、select * from emp where comm is null;