SQL Test
Description: SQL Java/Oracle /C/C++ | |
Number of Questions: 15 | |
Created by: Neema Pandya | |
Tags: SQL Java/Oracle /C/C++ |
Which of the following is not a Data Control Language (DCL) statement?
What does the following query do? SELECT * from Employee WHERE SALARY LIKE '_2%3'
Which of the following is not true about aggregate functions?
Which of the following complex expressions is not allowed in SQL?
What will be the conceptual order of evaluation of the following select statements? (a) First, the Cartesian product of all tables in the 'form' clause is formed. (b) From this, rows not satisfying the 'where' condition are eliminated. (c) Groups not satisfying the having clause are then eliminated. (d) The remaining rows are grouped in accordance with 'group by' clause. (e) The UNION, INTERSECT, EXCEPT is taken after each subquery is evaluated. (f) If the keyword DISTINCT is present, duplicate rows are eliminated. (g) The expressions of the select clause target list are evaluated. (h) The set of all selected rows is sorted if an ORDER BY is present.
Alter command is used: (a) to delete a column in a table (b) to change the data type of a column in a table (c) to add a column in a table (d) to rename a table
Which of the following is not a difference between EXISTS and ANY/ALL?
Which of the following is/are correct syntax(es) for insert statement? (a) INSERT INTO TABLE_NAME (column1, column2, column3,...columnN)] VALUES (value1, value2, value3,...valueN); (b) INSERT INTO TABLE_NAME VALUES (value1,value2,value3,...valueN); (c) INSERT INTO CUSTOMER (column1,column5,columnN-1)VALUES (value1,value5,valueN-1);
What will be the output of the following query? Select sum(price) from room r where roomno not in(select roomno from booking b, hotel h where(datefrom<=current_date and dateto>=current_date)and b. hotelno=h.hotelno and hotelname='XYZ')
Hotel(hotelno, hotelname, city) Room(roomno, hotelno, type, price) Booking(hotelno, guestno, datefrom, dateto, roomno) Guest(gustno, guestname, guestadd)
Which of the following is/are the difference(s) between having and where clause? (a) Where is used to filter rows while having is used to filter groups. (b) There is no alternative for 'where'. To filter groups, we have operators other than 'having'. (c) Aggregate cannot be used in where clause. Aggregate can be used in having clause.
Which of the following explains 'correlated subquery'?
What will be the output of the following query? select count(*) from employees e1, e2, department d where e1.lname='abc , e1.fname='xyz', e1.empid=d.mgrempid and d.dptno=e2.dptno. Tables: Employee(empid,fname,lname,add,dob,position,deptno) Dpartment(deptno,deptname,mgrempid) Project(projno,projname,deptno) Workson(empid,projno,hoursworked)
What will be the result of the following query?
Select title_id,copies_sold=sum(qty) from sales where ord_date between '1/1/2010 and '12/31/2010' group by all title_id Sales(title_id,qty,ord_date)
What does the following select statement do? Select fname,lname from employees where exists (select * from dependent where ssn=essn) and exists (select * from department where ssn=mgrssn);
Consider Table: Employee(fname,minit,lname,ssn,bdate,add,salary,dno)
Department(dmname,dno,mgrssn,mgrstartdate)
Work_on(essn,pno,hours)
Project(pname,pno,plocation,dno)
Dept_locations(dno,dlocation)
What would be the query for enlisting the faculty member who does not teach any class using outer join?
Tables: Faculty(facid,facname,......) Student(stuid,stuname,.......) Class(facid,course,.......)