Question 1
Question
Which of the database object is used to improve the performance of queries?
Answer
-
A. Table
-
B. Synonym
-
C. View
-
D. Index
Question 2
Question
Which of the following special characters cannot be used in table name?
Question 3
Question
While creating a table which of the following can be used with the DEFAULT column option?
Answer
-
A. Strings
-
B. SQL functions
-
C. Expressions
-
D. All of the above
Question 4
Question
What command is used to view table's structure?
Answer
-
A. UPDATE
-
B. SHOW
-
C. SPOOL
-
D. DESCRIBE
Question 5
Question
Which of the following statement refers to both table and index?
Question 6
Question
Which of the following query used to create a table with no rows?
Answer
-
A. CREATE TABLE stu AS SELECT 0 from students;
-
B. CREATE TABLE stu AS SELECT * from students where 1=1;
-
C. CREATE TABLE stu AS SELECT * from students where 1=0;
-
D. CREATE TABLE stu AS SELECT 0 from students;
Question 7
Question
Which of the following query is used to add a column to an existing table?
Answer
-
A. ALTER TABLE table_name add column (place varchar2(20));
-
B. ALTER TABLE table_name add place varchar2(20);
-
C. ALTER TABLE table_name add column (place);
-
D. ALTER TABLE table_name add (place varchar2(20));
Question 8
Question
Which of the following is valid query to delete the column from the table ?
Answer
-
A. ALTER TABLE table_name DROP (place varchar2(20));
-
B. ALTER TABLE table table_name DROP COLUMN (place);
-
C. ALTER TABLE table table_name DROP COLUMN (place varchar2(20));
-
D. ALTER TABLE table_name MODIFY (place varchar2(20));
Question 9
Question
Let us consider the following schema below:
STUDENTS(sub_code, dep_name, location_id, city);
Which of the following code snippet will modify the STUDENTS table and add an address column with the data type VARCHAR2(100)?
Answer
-
A. ALTER TABLE students ADD COLUMN (address varchar2(100));
-
B. ALTER TABLE students ADD (address varchar2(100));
-
C. MODIFY TABLE students ADD COLUMN (address varchar2(100));
-
D. None of the above.
Question 10
Question
Which of the following code snippet will delete a view named marks_maths?
Question 11
Question
How many ways to apply constraint in SQL?
Question 12
Question 13
Question
_______ is acheived by using a foreign key?
Question 14
Question
Which SQL constraint must be used in order to add a value to a column that has not had one added explicitly?
Answer
-
A. DEFAULT
-
B. UNIQUE
-
C. CHECK
-
D. NOT NULL
Question 15
Question
Where are constraints stored?
Answer
-
A. In the info table
-
B. In data dictionary
-
C. In a table
-
D. None of the above
Question 16
Question
Rows of a relation refers to
Answer
-
A. Entity
-
B. Tuple
-
C. Degree
-
D. None of the above
Question 17
Question
Which of the following is used to identify the a tuple ?
Answer
-
A. Attribute
-
B. Schema
-
C. Domain
-
D. Super key
Question 18
Question
Which of the following commands is used to delete a trigger in sql ?
Answer
-
A. Delete
-
B. Drop
-
C. Alter
-
D. None of the above.
Question 19
Question
State True or False: SHOW TRIGGERS lists the triggers currently defined for tables in a database.
Question 20
Question
State True or False: Candidate key can be a single column or combination of more than one column.
Question 21
Question
Which of the following is valid SQL for an index?
Answer
-
A. CHANGE INDEX...;
-
B. CREATE INDEX...;
-
C. ADD INDEX...;
-
D. REMOVE INDEX...;
Question 22
Question
What has to be enclosed in double quotes?
Answer
-
A. Column Alias
-
B. Dates
-
C. Strings
-
D. All of the above
Question 23
Question
Which among the following one or more attributes taken collectively to uniquly identify a record ?
Answer
-
A. Sub key
-
B. Common key
-
C. Super key
-
D. Candidate key
Question 24
Question
A top to bottom relationship in a database refer as
Answer
-
A. Network schema
-
B. Hierarchical schema
-
C. Relational schema
-
D. All of the above
Question 25
Question
Which of the following constraint is not a need for uniqueness?
Answer
-
A. Primary key
-
B. Foreign key
-
C. Unique
-
D. None of the above.
Question 26
Question
Which of the following statements are correct one.
Answer
-
A. CHECK constraints enforce domain integrity
-
B. In a UNIQUE constraint, no two rows in the table can have the same value for the columns
-
C. UNIQUE constraints enforce the uniqueness of the values in a set of columns
-
D. All of the mentioned
Question 27
Question
TRUNCATE is the DDL statement whereas DELETE is a DML statement.
Question 28
Question
Which one is faster to delete a table?
Answer
-
A. Truncate
-
B. Delete
-
C. Remove
-
D. None of the above
Question 29
Question
Truncate statement locks whole Table or a single Row at a time?
Answer
-
A. Both
-
B. Only Row
-
C. Table
-
D. None of the above
Question 30
Question
What is true about truncate with Foreign key?
Answer
-
A. It will delete the rows from both the tables (child as well as parent)
-
B. It will not delete even if CASCADE ON DELETE option is given with parent table
-
C. It will delete even if CASCADE ON DELETE option is given with parent table
-
D. All are true
Question 31
Question
How many Primary keys that a table have in SQL?