Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ? (A) SELECT A FROM R; (B) SELECT A, COUNT(*) FROM R; (C) SELECT A, COUNT(*) FROM R GROUP BY A; (D) SELECT A, B, COUNT(*) FROM R GROUP BY A, B;

1 Answer

Answer :

(B) SELECT A, COUNT(*) FROM R;

Related questions

Description : Consider the following three SQL queries (Assume the data in the people table) : (a) Select Name from people where Age>21; (b) Select Name from people where Height>180; (c) Select Name from people where (Age>21) or (Height ... number of rows returned by the SQL query (c) ? (A) 3 (B) 7 (C) 10 (D) 21

Last Answer : (C) 10

Description : Suppose ORACLE relation R(A, B) currently has tuples {(1, 2), (1, 3), (3, 4)} and relation S(B, C) currently has {(2, 5), (4, 6), (7, 8)}. Consider the following two SQL queries SQ1 and SQ2 ... (A) 2 and 6 respectively (B) 6 and 2 respectively (C) 2 and 4 respectively (D) 4 and 2 respectively

Last Answer : (D) 4 and 2 respectively

Description : Consider a CUSTOMERS database table having a column CITY filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have GAR somewhere in its name, ... *from customers where city like %GAR%'; (D) Select *from customers where city as '%GAR';

Last Answer : Answer: C

Description : Consider the following two commands C1 and C2 on the relation R from an SQL database:  C1: drop table R; C2: delete from R; Which of the following statements is TRUE? I. Both C1 and C2 delete the schema for R. II. C2 ... R. (A) I only (B) I and II only (C) II and III only (D) I, II and III

Last Answer : (C) II and III only

Description : Consider the table Student(stuid, name, course, marks). Which one of the following two queries is correct to find the highest marks student in course 5? Q.1. Select S.stuid From student S Where not exists (select * from student ... ) Q.1 (B) Q.2 (C) Both Q.1 and Q.2 (D) Neither Q.1 nor Q.2

Last Answer : (B) Q.2 Explanation: First query gives stuid of students whose marks are greater than all students taking course 5. Second query gives stuid of students whose marks are greater than any student taking ... comparison is between maximum of marks by any student in course 5. So the answer is option D.

Description : Consider the relations R(A,B) and S(B,C) and the following four relational algebra queries over R and S: I. πA,B(R⋈S) II. R⋈πB(S) III. R∩(πA(R) Χ πB(S)) IV. πA,R.B(R Χ S) where R.B refers to ... IV are the same query. (C) I, II and IV are the same query. (D) I, III and III are the same query.

Last Answer : (D) I, III and III are the same query.

Description : Consider the following database table having A, B, C and D as its four attributes and four possible candidate keys (I, II, III and IV) for this table: I: {B} II: {B, C} III: {A, D} IV: {C, D} If ... the database table? (A) I and III only (B) III and IV only (C) II only (D) I only

Last Answer : (C) II only

Description : Consider the following table Furniture. Write SQL commands for the statements (i) to (viii) and write output for SQL queries (ix) and (x). -Technology

Last Answer : SQL commands for the given statements (i) to (viii) ;1. SELECT FCODE, NAME. PRICE FROM Furniture WHERE PRICE < 5000;2. SELECT NAME. PRICE FROM Furniture3.4. WHERE NAME LIKE %table% ;5. SELECT DISTINCT WCODE ... ;15.16. Output for SQL queries (ix) and (x)(ix)SUM(PRICE)6500(x)COUNT(DISTINCT PRICE)5

Description : …………… table store information about database or about the system. A) SQL B) Nested C) System D) None of these

Last Answer : C) System

Description : The one guideline to be followed while designing the database is A) A database design may be ambiguous. B) Unrelated data should be in the same table so that updating the data will be easy. C) It should avoid/reduce the redundancy. D) An entity should not have attributes.

Last Answer : C) It should avoid/reduce the redundancy.

Description : Which of the following is/are the Database server functions? i) Data management ii) Transaction management iii) Compile queries iv) Query optimization A) i, ii, and iv only B) i, ii and iii only C) ii, iii and iv only D) All i, ii, iii, and iv

Last Answer : A) i, ii, and iv only

Description : The statement in SQL which allows to change the definition of a table is (A) Alter. (B) Update. (C) Create. (D) select

Last Answer : (A) Alter.

Description : Queries to a database A. are written in English B. can use aggregatefunctions like SUM and COUNT C. both (a)and (b) D. All of theabove E. None of the above

Last Answer : can use aggregatefunctions like SUM and COUNT

Description : In JDBC ........................ imports all Java classes concerned with database connectivity. A) javax.sql.* B) java.mysql.* C) java.sql.* D) com.*

Last Answer : C) java.sql.*

Description : In distributed databases, location transparency allows for database users, programmers and administrators to treat the data as if it is at one location. A SQL query with location transparency needs to specify: (A) Inheritances (B) Fragments (C) Locations (D) Local formats 

Last Answer : (B) Fragments

Description : Identify the criteria for designing database from the point of view of user A) No redundancy B) No inapplicable attributes C) Uniformity in naming & definitions of the data items D) All of the above

Last Answer : D) All of the above

Description : Semi-join strategies are techniques for query processing in distributed database system. Which of the following is a semi-join technique? (A) Only the joining attributes are sent from one site to ... the attributes are sent from one site to another and then only the required rows are returned.

Last Answer : (C) Only the joining attributes are sent from one site to another and then only the required rows are returned.

Description : Consider the following database table : Create table test( one integer, two integer, primary key(one), unique(two), check(one≥1 and ≤10), check(two≥1 and ≤5) ); How many data records/tuples atmost can this table contain ?  (A) 5 (B) 10 (C) 15 (D) 50

Last Answer : (A) 5 

Description : Which of the following is a legal expression in SQL? (A) SELECT NULL FROM EMPLOYEE; (B) SELECT NAME FROM EMPLOYEE; (C) SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL; (D) None of the above

Last Answer : B) SELECT NAME FROM EMPLOYEE;

Description : Select operator is not a unary operator. ii) Project operator chooses subset of attributes or columns of a relation. A) i-True, ii-False B) i-True, ii-True C) i-False, ii-True D) i-False, ii-False

Last Answer : C) i-False, ii-True

Description : Select the ‘False’ statement from the following statements about Normal Forms: (A) Lossless preserving decomposition into 3NF is always possible (B) Lossless preserving decomposition into BCNF is always possible (C) Any relation with two attributes is in BCNF (D) BCNF is stronger than 3NF

Last Answer : (B) Lossless preserving decomposition into BCNF is always possible

Description : SQL server stores index information in the ………… system table A) systindexes B) systemindexes C) sysind D) sysindexes

Last Answer : D) sysindexes

Description : Which of the following is true ? I. Implementation of self-join is possible in SQL with table alias. II. Outer-join operation is basic operation in relational algebra. III. Natural join and outer join operations are ... (B) II and III are correct. (C) Only III is correct. (D) Only I is correct.

Last Answer : (D) Only I is correct.

Description : In RDBMS, Data is presented as a collection of ............ A) Table B) Attributes C) Relations D) Entities

Last Answer : C) Relations

Description : Let E1 and E2 be two entities in E-R diagram with simple single valued attributes. R1 and R2 are two relationships between E1 and E2 where R1 is one-many and R2 is many-many. R1 and R2 do not have any ... are required to represent this situation in the Relational Model? (A) 4 (B) 3 (C) 2 (D) 1

Last Answer : (B) 3 

Description : Let M and N be two entities in an E-R diagram with simple single vale attributes. R1 and R2 are two relationship between M and N, whereas R1 is one-to-many and R2 is many-to-many. The minimum number of tables required to ... and R2 in the relational model are .......... (1) 4 (2) 6 (3) 7 (4) 3

Last Answer : Answer: 4

Description : What command is used to remove a table or index from a SQL database ?

Last Answer : DROP TABLE is used to remove a table or index from a SQL database .

Description : Quantitative attributes are A. A reference to the speed of an algorithm, which is quadratically dependent on the size of the data B. Attributes of a database table that can take only numerical values C. Tools designed to query a database D. None of these

Last Answer : B. Attributes of a database table that can take only numerical values

Description : extendible architecture is A. Modular design of a software application that facilitates the integration of new modules B. Showing a universal law or rule to be invalid by providing a counter example C. ... of attributes in a database table that refers to data in another table D. None of these

Last Answer : A. Modular design of a software application that facilitates the integration of new modules

Description : Falsification is A. Modular design of a software application that facilitates the integration of new modules B. Showing a universal law or rule to be invalid by providing a counter example C. A set of attributes in a database table that refers to data in another table D. None of these

Last Answer : B. Showing a universal law or rule to be invalid by providing a counter example

Description : Preparedstatement Object in JDBC is used to execute ........................... queries. A) executable B) simple C) high level D) parameterized

Last Answer : D) parameterized

Description : Prepared Statement object in JDBC used to execute........... queries. A) Executable B) Simple C) High level D) Parameterized

Last Answer : D) Parameterized

Description : Which of the following is not the function of client? A) Compile queries B) Query optimization C) Receive queries D) Result formatting and presentation

Last Answer : B) Query optimization

Description : In a relational schema, each tuple is divided into fields called A) Relations B) Domains C) Queries D) All of the above

Last Answer : B) Domains

Description : Division operation is ideally suited to handle queries of the type : (A) customers who have no account in any of the branches in Delhi. (B) customers who have an account at all branches in Delhi. ( ... atleast one branch in Delhi. (D) customers who have only joint account in any one branch in Delhi

Last Answer : (B) customers who have an account at all branches in Delhi. 

Description : Which command is used to count just the number of characters in a file? A. wc - 1 B. wc -c C. wc -w D. wc -r E. None of the above

Last Answer : B. wc -c

Description : An Assertion is a predicate expressing a condition we wish database to always satisfy. The correct syntax for Assertion is : (A) CREATE ASSERTION ‘ASSERTION Name’ CHECK ‘Predicate’ (B) CREATE ASSERTION ‘ASSERTION NAME’ (C) CREATE ASSERTION, CHECK Predicate (D) SELECT ASSERTION

Last Answer : (A) CREATE ASSERTION ‘ASSERTION Name’ CHECK ‘Predicate’ 

Description : In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

Description : Group of attributes/field in a database is known as a: a) Data Entry b) Record c) File d) None of These

Last Answer : b) Record

Description : For a database relation R(a, b, c, d) where the domains of a, b, c, d include only the atomic values. The functional dependency a → c, b → d holds in the following relation (A) In 1NF not in 2NF (B) In 2NF not in 3NF (C) In 3NF (D) In 1NF

Last Answer : (A) In 1NF not in 2NF 

Description : For a database relation R(A,B,C,D) where the domains of A,B,C and D include only atomic values, only the following functional dependencies and those that can be inferred from them are: A→C B→D The ... form but not in third normal form (4) Both in second normal form as well as in third normal form

Last Answer : First normal form but not in second normal form

Description : Database is made up of all the following components except (a) tables (b) queries -Technology

Last Answer : (d) A database is made up of tables, queries, and forms.

Description : Which of the following is included in the database collection: a) Schemes, Tables, Queries b) Queries, Report, Views and other Objects c) Both of Above d) None of These

Last Answer : c) Both of Above