Quiz
DDL
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (31)
1Which of the database object is used to improve the performance of queries?
- AA. Table
- BB. Synonym
- CC. View
- DD. Index
2Which of the following special characters cannot be used in table name?
- AA. #
- BB. @
- CC. $
- DD. _
3While creating a table which of the following can be used with the DEFAULT column option?
- AA. Strings
- BB. SQL functions
- CC. Expressions
- DD. All of the above
4 What command is used to view table's structure?
- AA. UPDATE
- BB. SHOW
- CC. SPOOL
- DD. DESCRIBE
5Which of the following statement refers to both table and index?
- AA. A table and an index cannot be the same name in a schemA.
- BB. A table and an index can have the same name in a schemA.
- CC. Neither A nor B
- DD. None of the above
6Which of the following query used to create a table with no rows?
- AA. CREATE TABLE stu AS SELECT 0 from students;
- BB. CREATE TABLE stu AS SELECT * from students where 1=1;
- CC. CREATE TABLE stu AS SELECT * from students where 1=0;
- DD. CREATE TABLE stu AS SELECT 0 from students;
7Which of the following query is used to add a column to an existing table?
- AA. ALTER TABLE table_name add column (place varchar2(20));
- BB. ALTER TABLE table_name add place varchar2(20);
- CC. ALTER TABLE table_name add column (place);
- DD. ALTER TABLE table_name add (place varchar2(20));
8Which of the following is valid query to delete the column from the table ?
- AA. ALTER TABLE table_name DROP (place varchar2(20));
- BB. ALTER TABLE table table_name DROP COLUMN (place);
- CC. ALTER TABLE table table_name DROP COLUMN (place varchar2(20));
- DD. ALTER TABLE table_name MODIFY (place varchar2(20));
9Let 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)?- AA. ALTER TABLE students ADD COLUMN (address varchar2(100));
- BB. ALTER TABLE students ADD (address varchar2(100));
- CC. MODIFY TABLE students ADD COLUMN (address varchar2(100));
- DD. None of the above.
10Which of the following code snippet will delete a view named marks_maths?
- AA. DELETE VIEW marks_maths;
- BB. DELETE marks_maths;
- CC. DROP VIEW ew marks_maths;
- DD. DROP marks_maths;
11How many ways to apply constraint in SQL?
- AA. 5
- BB. 6
- CC. 2
- DD. 3
12NULL refers to
- AA. -1
- BB. 1
- CC. Empty
- DD. 0
13_______ is acheived by using a foreign key?
- AA. Domain Integrity
- BB. User-defined Integrity
- CC. Entity Integrity
- DD. Referential Integrity
14Which SQL constraint must be used in order to add a value to a column that has not had one added explicitly?
- AA. DEFAULT
- BB. UNIQUE
- CC. CHECK
- DD. NOT NULL
15Where are constraints stored?
- AA. In the info table
- BB. In data dictionary
- CC. In a table
- DD. None of the above
16 Rows of a relation refers to
- AA. Entity
- BB. Tuple
- CC. Degree
- DD. None of the above
17Which of the following is used to identify the a tuple ?
- AA. Attribute
- BB. Schema
- CC. Domain
- DD. Super key
18Which of the following commands is used to delete a trigger in sql ?
- AA. Delete
- BB. Drop
- CC. Alter
- DD. None of the above.
19State True or False: SHOW TRIGGERS lists the triggers currently defined for tables in a database.
- ATrue
- BFalse
20State True or False: Candidate key can be a single column or combination of more than one column.
- ATrue
- BFalse
21Which of the following is valid SQL for an index?
- AA. CHANGE INDEX...;
- BB. CREATE INDEX...;
- CC. ADD INDEX...;
- DD. REMOVE INDEX...;
22What has to be enclosed in double quotes?
- AA. Column Alias
- BB. Dates
- CC. Strings
- DD. All of the above
23Which among the following one or more attributes taken collectively to uniquly identify a record ?
- AA. Sub key
- BB. Common key
- CC. Super key
- DD. Candidate key
24A top to bottom relationship in a database refer as
- AA. Network schema
- BB. Hierarchical schema
- CC. Relational schema
- DD. All of the above
25Which of the following constraint is not a need for uniqueness?
- AA. Primary key
- BB. Foreign key
- CC. Unique
- DD. None of the above.
26Which of the following statements are correct one.
- AA. CHECK constraints enforce domain integrity
- BB. In a UNIQUE constraint, no two rows in the table can have the same value for the columns
- CC. UNIQUE constraints enforce the uniqueness of the values in a set of columns
- DD. All of the mentioned
27TRUNCATE is the DDL statement whereas DELETE is a DML statement.
- ATrue
- BFalse
28Which one is faster to delete a table?
- AA. Truncate
- BB. Delete
- CC. Remove
- DD. None of the above
29Truncate statement locks whole Table or a single Row at a time?
- AA. Both
- BB. Only Row
- CC. Table
- DD. None of the above
30What is true about truncate with Foreign key?
- AA. It will delete the rows from both the tables (child as well as parent)
- BB. It will not delete even if CASCADE ON DELETE option is given with parent table
- CC. It will delete even if CASCADE ON DELETE option is given with parent table
- DD. All are true
31How many Primary keys that a table have in SQL?
- AA. Depends on DBA
- BB. Only 1
- CC. Only 2
- DD. Depends on no of Columns
Information
- Description
- DDL Interview Questions
- Author
- Jerry Reeves Jr
- Language
- English
- Views
- 2
- Tags
- Rating
- No ratings yet Rate this quiz