News:
desc myTable
desc table myTable
sp_columns myTable
None of the above
Using either option a or c
Useful resources, Information Schema Views
select * from Pers where joining_date from '1/1/2005' to '1/2/2005', job= 'Analyst' or 'clerk' or 'salesman'
select * from Pers where joining_date between '1/1/2005' to '1/2/2005', job= 'Analyst' or job= 'clerk' or job= 'salesman'
select * from Pers where joining_date between '1/1/2005' and '1/2/2005' and (job= 'Analyst' or 'clerk' or 'salesman')
None of the above
Employee
---------
Empno
Employeename
Salary
Deptno
Department
---------
Deptno
Departname
Select departname from department where deptno in (select deptnofrom employee group by deptno having count(*) > 100);
Select departname from department where deptno in (select count(*)from employee group by deptno where count(*) > 100);
Select departname from department where count(deptno) > 100;
Select departname from department where deptno in (select count(*)from employee where count(*) > 100);
Other option (except a) will not execute due to error in the statement. Useful resources, SQL basic queries, query fundamental, HAVING Clause, COUNT, SQL IN
ProductID ProductName CurrentStock MinimumStock
Two possible queries are: (a)select * from products where currentStock > MinimumStock + 50
(b)select * from products where currentStock - 50 > MinimumStock
(a) is correct
(b) is correct
(a) and (b) both are correct
(a) and (b) both are incorrect
Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer
Pessimistic locking is a locking scheme handled by the server, whereas optimistic locking is handled by the application developer
Read Uncommitted
Read Committed
Repeatable Read
Serializable
Useful resources, Isolation Levels
Books
------
BookId
BookName
AuthorId
SubjectId
PopularityRating (the popularity of the book on a scale of 1 to 10)
Language (such as French, English, German etc)
Subjects
---------
SubjectId
Subject (such as History, Geography, Mathematics etc)
Authors
--------
AuthorId
AuthorName
Country
What is the query to determine which Authors have written at least 1 book with a popularity rating of less than 5?
select authorname from authors
where authorid in (select authorid from books where popularityrating<5)
select authorname from authors
where authorid in (select authorid from books where popularityrating<=5)
select authorname from authors
where authorid in (select BookId from books where popularityrating<5)
select authorname from authors
where authorid in (select authorid from books where popularityrating in (0,5))
rollno int name varchar(20) course varchar(20)
What will be the query to display the courses in which the number of students enrolled is more than 5?
Select course from students where count(course) > 5;
Select course from students where count(*) > 5 group by course;
Select course from students group by course;
Select course from students group by course having count(*) > 5;
Select course from students group by course where count(*) > 5;
Select course from students where count(group(course)) > 5;
Select count(course) > 5 from students;
None of the above
Books
------
BookId
BookName
AuthorId
SubjectId
PopularityRating (the popularity of the book on a scale of 1 to 10)
Language (such as French, English, German etc)
Subjects
---------
SubjectId
Subject (such as History, Geography, Mathematics etc)
Authors
--------
AuthorId
AuthorName
Country
What is the query to determine which is the most popular book written in French?
select bookname from books
where language='French' and popularityrating = (select max(popularityrating) from books where language='French')
select bookname from books
where language='French' and popularityrating = (select max(popularityrating) from books Having language='French')
select bookname,max(popularityrating) from books
where language='French' and max(popularityrating)
select bookname,max(popularityrating) from books
where language='French' having max(popularityrating)
It returns the difference between parts of two specified dates
It takes three arguments
It returns a signed integer value equal to second date part minus first date part
It returns a signed integer value equal to first date part minus second date part
Useful resources, DATEDIFF