Which of the following query finds the total rating of the sailors who have reserved boat "103"?
A. SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
B. SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
C. SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
D. SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
Select an option to see the answer and solution.
The SELECT statement SELECT 'Hi' FROM DUAL WHERE NULL = NULL; Outputs
A. Hi
B. FLASE
C. TRUE
D. Nothing
Select an option to see the answer and solution.
Which of the following is illegal?
A. SELECT SYSDATE - SYSDATE FROM DUAL;
B. SELECT SYSDATE - (SYSDATE - 2) FROM DUAL;
C. SELECT SYSDATE - (SYSDATE + 2) FROM DUAL;
D. None of these
Select an option to see the answer and solution.
If a query involves NOT, AND, OR with no parenthesis
A. NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last.
B. NOT will be evaluated first; OR will be evaluated second; AND will be evaluated last.
C. AND will be evaluated first; OR will be evaluated second; NOT will be evaluated last.
D. The order of occurrence determines the order of evaluation.
Select an option to see the answer and solution.
Let the statement
SELECT column1 FROM myTable;
return 10 rows. The statement
SELECT ALL column1 FROM myTable;
will return
A. less than 10 rows
B. more than 10 rows
C. exactly 10 rows
D. None of these
Select an option to see the answer and solution.
Table employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM employee WHERE SALARY > ALL (SELECT SALARY FROM EMPLOYEE);
prints
Select an option to see the answer and solution.
Which of the following SQL commands can be used to add data to a database table?
A. ADD
B. UPDATE
C. APPEND
D. INSERT
Select an option to see the answer and solution.
Which of the following join is also called as an 'inner-join'?
A. Non-Equijoin
B. Self-Join
C. Equijoin
D. None of these
Select an option to see the answer and solution.
Which of the following is NOT a type of SQL constraint?
A. PRIMARY KEY
B. ALTERNATE KEY
C. FOREIGN KEY
D. UNIQUE
Select an option to see the answer and solution.
What is an SQL virtual table that is constructed from other tables?
A. view
B. A relation
C. Just another table
D. Query results
Select an option to see the answer and solution.
When using the SQL INSERT statement:
A. rows cannot be copied in mass from one table to another only.
B. rows can be modified according to criteria only.
C. rows can either be inserted into a table one at a time or in groups.
D. rows can be inserted into a table only one at a time only.
Select an option to see the answer and solution.
The SQL ALTER statement can be used to:
A. change the table data.
B. change the table structure.
C. delete rows from the table.
D. add rows to the table.
Select an option to see the answer and solution.
What SQL command can be used to delete columns from a table?
A. MODIFY TABLE TableName DROP ColumnName
B. MODIFY TABLE TableName DROP COLUMN ColumnName
C. ALTER TABLE TableName DROP ColumnName
D. ALTER TABLE TableName DROP COLUMN ColumnName
Select an option to see the answer and solution.
What SQL command can be used to add columns to a table?
A. ALTER TABLE TableName ADD ColumnName
B. ALTER TABLE TableName ADD COLUMN ColumnName
C. MODIFY TABLE TableName ADD ColumnName
D. MODIFY TABLE TableName ADD COLUMN ColumnName
Select an option to see the answer and solution.
The command to remove rows from a table 'CUSTOMER' is:
A. DROP FROM CUSTOMER ...
B. UPDATE FROM CUSTOMER ...
C. REMOVE FROM CUSTOMER ...
D. DELETE FROM CUSTOMER WHERE ...
Select an option to see the answer and solution.
The SQL WHERE clause:
A. limits the row data are returned.
B. limits the column data that are returned.
C. Both A and B are correct.
D. Neither A nor B are correct.
Select an option to see the answer and solution.
Which of the following is the original purpose of SQL?
A. To define the data structures
B. To specify the syntax and semantics of SQL data definition language
C. To specify the syntax and semantics of SQL manipulation language
D. All of the above.
Select an option to see the answer and solution.
The wildcard in a WHERE clause is useful when?
A. An exact match is necessary in a CREATE statement.
B. An exact match is necessary in a SELECT statement.
C. An exact match is not possible in a SELECT statement.
D. An exact match is not possible in a CREATE statement.
Select an option to see the answer and solution.
The command to eliminate a table from a database is:
A. DROP TABLE CUSTOMER;
B. DELETE TABLE CUSTOMER;
C. REMOVE TABLE CUSTOMER;
D. UPDATE TABLE CUSTOMER;
Select an option to see the answer and solution.
The SQL keyword(s) ________ is used with wildcards.
A. NOT IN only
B. LIKE only
C. IN only
D. IN and NOT IN
Select an option to see the answer and solution.