adplus-dvertising
frame-decoration

Question

For the following sample database table staff. The SQL query:

SELECT COUNT(Staff no) AS mycount, SUM(Salary) AS mysum FROM Staff WHERE Designation=’Manager’

Returns the result

a.

mycount=2, mysal=47000

b.

mycount=2, mysal=98000

c.

mycount=5, mysal=47000

d.

mycount=5, mysal=98000

Answer: (b).mycount=2, mysal=98000

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. For the following sample database table staff. The SQL query: SELECT COUNT(Staff no) AS mycount, SUM(Salary) AS mysum FROM Staff WHERE Designation=’Manager’ Returns the...

Similar Questions

Discover Related MCQs

Q. Data Scrubbing is

Q. An attribute A of datatype varchar(20) has the value ‘xyz’, and the attribute B of datatype char(20) has the value “lmnop”, then the attribute A has ............... spaces and attribute B has ............... spaces.

Q. Data warehouse contains ............... data that is never found in operational environment.

Q. .................. command is used to remove a relation from SQL database.

Q. Which of the following statement/s is/are true?

(i) Facebook has the world’s largest Hadoop Cluster.
(ii) Hadoop 2.0 allows live stream processing of Real time data.

Choose the correct answer from the code given below:

Q. Consider the relation schema R = (A,B,C,D,E,F) on which the following functional dependencies hold:

A → B
B, C → D
E → C
D → A

What are the candidate keys of R?

Q. Consider the following sequence of two transactions on a bank account (A) with initial balance 20,000 that transfers 5,000 to another account (B) and then apply 10% interest.

(i) T1 start
(ii) T1 A old = 20,000 new 15,000
(iii) T1 B old = 12,000 new = 17,000
(iv) T1 commit
(v) T2 start
(vi) T2 A old = 15,000 new = 16,500
(vii) T2 commit

Suppose the database system crashes just before log record (vii) is written. When the system is restarted, which one statement is true of the recovery process?

Q. A clustering index is defined on the fields which are of type:

Q. In RDBMS, which type of Join returns all rows that satisfy the join condition?

Q. In a Hierachical database, a hashing function is used to locate the .................

Q. Relations produced from E - R Model will always be in ..............

Q. Consider the following schedules involving two transactions.

S1 : r1(X) ; r1(Y) ; r2(X) ; r2(Y) ; w2(Y) ; w1(X)
S2 : r1(X) ; r2(X) ; r2(Y) ; w2(Y) ; r1(Y) ; w1(X)

Which one of the following statements is correct with respect to above?

Q. For a database relation R(a, b, c, d) where the domains of a, b, c and d include only atomic values, and only the following functional dependencies and those that can be inferred from them hold:

a → c
b → d

The relation is in ...............

Q. A many-to-one relationship exists between entity sets r1 and r2. How will it be represented using functional depedencies if Pk(r) denotes the primary key attribute of relation r?

Q. Database systems that store each relation in a separate operating system file may use the operating system’s authorization scheme, instead of defining a special scheme themselves. In this case, which of the following is false?

Q. Let R1(a, b, c) and R2(x, y, z) be two relations in which a is the foreign key of R1 that refers to the primary key of R2. Consider following four options.

(a) Insert into R1 (b) Insert into R2
(c) Delete from R1 (d) Delete from R2

Which of the following is correct about the referential integrity constraint with respect to above?

Q. Consider a hash table of size seven, with starting index zero, and a hash function (7x+3) mod 4. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Here “__” denotes an empty location in the table.

Q. Which of the following is/are true with reference to 'view' in DBMS?

(a) A 'view' is a special stored procedure executed when certain event occurs.
(b) A 'view' is a virtual table, which occurs after executing a pre-compiled query.

Q. In SQL, .................. is an Aggregate function.

Q. Match the following with respect to RDBMS:

List - I
(a) Entity integrity
(b) Domain integrity
(c) Referential integrity
(d) Userdefined integrity

List - II
(i) enforces some specific business rule that do not fall into entity or domain
(ii) Rows can't be deleted which are used by other records
(iii) enforces valid entries for a column
(iv) No duplicate rows in a table

Code:
(a) (b) (c) (d)