Question 1
Question
What is output by the SQL below?
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (a INT, b INT, c INT);
INSERT INTO foo VALUES (1,2,3);
INSERT INTO foo SELECT * FROM foo;
INSERT INTO foo SELECT * FROM foo;
SELECT sum(b) FROM foo;
Question 2
Question
The relationship between DEPARTMENT and EMPLOYEE is a
Question 3
Question
Which of the following terms does refer to the correctness and completeness of the data in a database?
Answer
-
Data security
-
Data constraint
-
Data independence
-
Data model
-
Data integrity
Question 4
Question
Which of these field types would be best to hold a .jpg image?
Answer
-
char binary
-
nchar binary
-
text
-
blob
Question 5
Question
The result of a SQL SELECT statement is a(n) ________ .
Question 6
Question
To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.
Answer
-
ONLY
-
UNIQUE
-
DISTINCT
-
SINGLE
Question 7
Question
What’s the default port for MySQL Server?
Question 8
Question
What is an index?
Answer
-
An index is a special way to join 2 or more tables.
-
An index is a database table attribute, which speeds-up data search within a table.
-
An index is the same as alias.
-
No such thing in MySQL
Question 9
Answer
-
A view is a virtual table which results of executing a pre-compiled query.
-
A view is a special stored procedure executed when certain event occurs.
-
A view is a database diagram.
Question 10
Question
The difference between the DELETE and TRUNCATE SQL clauses is:
Answer
-
The DELETE clause deletes all rows in a database table, while the TRUNCATE clause can have a WHERE condition and might or might not delete all rows in a table.
-
The TRUNCATE clause deletes all rows in a database table, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table.
-
The TRUNCATE clause is identical to the DELETE clause
Question 11
Question
Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?
Answer
-
SELECT ADD(Price) FROM Sales
-
SELECT SUM(Price) WHERE Sales
-
SELECT TOTAL(Price) FROM Sales
-
SELECT SUM(Price) FROM Sales
Question 12
Question
A trigger belongs to...
Answer
-
to all tables in the database
-
a single table in the database
-
more than one table in the database
Question 13
Question
A collection of related fields is called a:
Answer
-
database
-
file
-
record
-
relation
-
table
Question 14
Question
Also known as online, this type of processing occurs at the same time as the transaction occurs.
Answer
-
direct
-
immediate
-
method
-
real-time
Question 15
Question
Which of the following is correct:
Answer
-
a SQL query automatically eliminates duplicates.
-
SQL permits attribute names to be repeated in the same relation.
-
a SQL query will not work if there are no indexes on the relations
-
None of these
Question 16
Question
The language used in application programs to request data from the DBMS is referred to as the
Question 17
Question
To delete a particular column in a relation the command used is:
Answer
-
UPDATE TABLE
-
TRUNCATE COLUMN
-
ALTER, DROP
-
DELETE COLUMN
Question 18
Question
_________ is a virtual table that draws its data from the result of an SQL SELECT statement.
Answer
-
View
-
Synonym
-
Sequence
-
Transaction
Question 19
Question
A relational database contains two tables student and department.
Student table has columns (roll_no, name and dept_id )and Department table has columns (dept-id and dept-name).
Department table has 3 records and Student table has 2 records.
How many rows and columns will be retrived by the following SQL, statement?
Select * from student, department;
Answer
-
0 row and 4 columns
-
3 rows and 4 columns
-
3 rows and 5 columns
-
6 rows and 5 columns
Question 20
Question
E-R model uses this symbol to represent weak entity set ?
Question 21
Question
Relational Algebra is
Question 22
Question
Key to represent relationship between tables is called
Answer
-
Primary key
-
Secondary key
-
Foreign key
-
None of these
Question 23
Question
The conceptual model is
Question 24
Question
The RDBMS terminology for a row is
Answer
-
Tuple
-
Relation
-
Attribute
-
Degree
Question 25
Question
A set of possible data values is called
Answer
-
Attribute
-
Degree
-
Tuple
-
Domain
Question 26
Question
In E-R Diagram derived attribute are represented by
Answer
-
Ellipse
-
Dashed ellipse
-
Rectangle
-
Triangle
Question 27
Question
The default parameter type in stored procedures is
Answer
-
IN
-
OUT
-
INOUT
-
There is no default type
Question 28
Question
Consider a table OLD with few rows. The statement CREATE TABLE new AS SELECT * FROM OLD WHERE 1=2
Answer
-
copies all the rows from OLD to NEW
-
creates a dummy NEW table
-
creates an empty NEW table with column definitions same as OLD
-
creates a table NEW that acts as a synonym for OLD
Question 29
Question
Choose the correct pattern Matching sign for matching a single character
Question 30
Question
Rollback and Commit affect
Answer
-
Only DML statements
-
Only DDL statements
-
Both DML and DDL
-
All statements
Question 31
Question
What is the order of execution of SQL clauses
1. having 2. group by 3. where 4. orderby
Answer
-
1 2 3 4
-
3 2 1 4
-
2 3 4 1
-
4 3 1 2