DBMS MCQ Questions and Answer Set-12

1-Which statement would add a column CGPA to a table Student which is already created?

  1. ALTER TABLE Student ADD COLUMN (CGPA NUMBER(3,1));
  2. ALTER TABLE Student CGPA NUMBER(3,1);
  3. ALTER TABLE Student ADD (CGPA NUMBER(3,1));
  4. ALTER TABLE Student ADD CGPA NUMBER(3,1);

2- Which statement is TRUE regarding ALTER statement?

  1. ALTER TABLE cannot be used to remove a column
  2. ALTER table can be used to change data type of an existing column if column values are empty
  3. ALTER table can be used to change size of data type, not the data type itself
  4. ALTER table can be used to add a column but it must be NOT NULL

3-Student Table

Which of the following statements will execute successfully?

  1. INSERT INTO Student VALUES(1, ‘Alice’, ‘Female’, ’20-JAN-15′);
  2. INSERT INTO Student VALUES(1, “Alice”, ‘F’, SYSDATE);
  3. INSERT INTO Student VALUES(1, ‘Alice’, ‘F’, ‘2015-JAN-20’);
  4. INSERT INTO Student VALUES(1, ‘Alice’, ‘F’, NULL);

4- Student Table

Which of the following statements will execute successfully?

  1. INSERT INTO Student(Id, Name, Gender, DOJ) VALUES(1, ‘Alice’, ‘F’, NULL);
  2. INSERT INTO Student(Id, Gender) VALUES( 1, ‘F’);
  3. INSERT INTO Student(Id, Name) VALUES(1, ‘Alice’);
  4. INSERT INTO Student(Id, Name, Gender, DOJ) VALUES (1,NULL, ‘F’, ’20-JAN-15′);

5-Which of the following command displays distinct rows?

  1. UNION
  2. UNION ALL

6-Which of the following statement(s) is/are FALSE about UNION? [Choose any TWO]

  1. Column Names in all queries in a UNION must match position wise
  2. UNION can be used with UPDATE statement
  3. Data Types in all queries in a UNION must match position wise
  4. The number of columns must match in the query

7-Which of the following statement is TRUE about UNION?

  1. Each query in a UNION can be sorted independently in different sort orders
  2. All the queries in a UNION must be against the same table
  3. UNION clause is used to subtract rows of second query from the first query
  4. UNION and UNION ALL give same result if the participating queries are mutually exclusive

8-Which of the following statement is TRUE about Group By clause?

  1. Columns specified in GROUP BY clause must be part of the SELECT clause
  2. Columns specified in SELECT clause must be part of the GROUP BY clause
  3. GROUP BY removes NULL values from result
  4. Aggregate function cannot be used in query containing GROUP BY

9-In which of the following circumstances a GROUP BY clause is mandatory?

  1. SELECT query having only one aggregate function
  2. SELECT query having two aggregate functions
  3. SELECT query having one aggregate function along with other columns
  4. SELECT query having only two columns

10-A query that has a nested aggregate function

  1. must have a GROUP BY clause
  2. may or may not have a GROUP BY clause
  3. must not have a GROUP BY clause
  4. would not work

11-Relation R1 has 10 tuples and 5 attributes. Relation R2 has 0 tuples and 7 attributes. When a ‘CROSS JOIN’ is achieved between R1 and R2, how many tuples would the resultant set have?

  1. 28
  2. 10
  3. 0
  4. 35

Leave a Comment