Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Or SQL MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

1. SQL Stands for?

a. Structured Query Language


b. Simple Query Language
c. Structured Query List
d. None of this
2. The language used application programs to request data from the DBMS is referred
to as __________
a. DML
b. DDL
c. Query language
d. All of the Mentioned
3. In SQL, which of the following is not a data Manipulation Language Commands?
a. Delete
b. Truncate
c. Update
d. Create
4. Which of the following is not a type of SQL statement?
a. Data Manipulation Language (DML)
b. Data Definition Language (DDL)
c. Data Control Language (DCL)
d. Data Communication Language (DCL)
5. Which of the following is not included in DML 
a. INSERT
b. UPDATE
c. DELETE
d. CREATE
6.  In SQL, which command is used to add new rows to a table?
a. Alter Table
b. Add row
c. Insert
d. Append
7. A type of query that is placed within a WHERE or HAVING clause of another
query is called
a. Master query
b. Sub query
c. Super query
d. Multi-query
8. Which Operation Perform Pattern Matching ?
a. BETWEEN
b. LIKE
c. EXISTS
d. None Of This
9. In SQL, which command is used to SELECT only one copy of each set of duplicable
rows
a. SELECT DISTINCT
b. SELECT UNIQUES
c. SELECT DIFFERENT
d. All Of Above
10.  A command that lets you change one or more fields in a record is
a. INSERT
b. MODIFY
c. LOOK-UP
d. All Of Above
11.  Which of the SQL statements is correct?
a. SELECT Username AND Password FROM Users
b. SELECT Username, Password FROM Users
c. SELECT Username, Password WHERE Username = ‘user1’
d. None of the Mentioned
12. The SQL Statement: SELECT SUBSTR(‘123456789’, INSTR(‘abcabcabc’, ‘b’), 4)
FROM DUAL;
a. 6789
b. 2345
c. 1234
d. 456789
13. Table Employee has 10 records. It has a non-NULL SALARY column which is also
UNIQUE.
a. 10
b. 9
c. 5
d. 0

The SQL statement


SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY
FROM EMPLOYEE);

14. Find the temperature in increasing order of all cities


a. SELECT city FROM weather ORDER BY temperature;
b. SELECT city, temperature FROM weather;
c. SELECT city, temperature FROM weather ORDER BY temperature;
d. SELECT city, temperature FROM weather ORDER BY city;
15. 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 above
16. 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 this
17. In an SQL statement, which of the following parts states the conditions for row
selection?
a. WHERE
b. ORDER BY
c. GROUP BY
d. FROM
18. In SQL, which of the following is not a data definition language commands?
a. RENAME
b. GRANT
c. REVOKE
d. UPDATE
19. What does the abbreviation DBMS stand for?
a. Digital Base Mapping System.
b. Data Borrowing and Movement Software.
c. Database Management System.
d. Database Manipulation Software.
20. Which of the following are characteristics of an RDBMS?
a. Keys may be unique or have multiple occurrences in the database.
b. It cannot use SQL.
c. Queries are possible on individual or groups of tables.
d. Tables are linked by common data known as keys.
21. Which SQL command is used to indicate how tables are linked together?
a. GROUP
b. JOIN
c. LINK
d. TABLES
22. If you want to get a list of your customers that have purchased from you in the last
year, but you only want to list each customer once, how can you prevent multiple
listings of the same customer?
a. INDEX BY
b. ORDER BY
c. SELECT BY
d. SEQUENCE
23. When creating a query, what is the purpose of including a column Alias?
a. The Real Name isn’t known
b. To control sort order
c. To give the query designer control over the column name
d. To maintain anonymity
24. What is the purpose of the SQL clause BETWEEN?
a. Impose a query constraint covering a range of values
b. Indicate that two tables have an association
c. To establish the sequence of columns for a query
d. To modify the JOIN command
25. What is the impact of not including a JOIN command when using multiple tables in
a query?
a. All records in each table are associated with all records in the other tables
b. The foreign keys in each table are linked to the primary keys in the other tables
c. he primary keys in each table are joined together
d. The query will not work – an error is generated
26. The SQL used by front-end application programs to request data from the DBMS is
called _______
a) DDL
b) DML
c) TCL
d) VCL
27. Which of the following operations requires the relations to be union compatible?
a) UNION
b) INTERSECTION
c) DIFFERENCE
d) ALL OF THESE
28. What type of join is needed when you wish to include rows that do not have
matching values?
a. Equi-join
b. Natural join
c. Outer join
d. All of the Mentioned
29. Which of the following statements is true concerning subqueries?
a. Involves the use of an inner and outer query
b. Cannot return the same result as a query that is not a subquery
c. Does not start with the word SELECT
d. All of the mentioned
30. A UNION query is which of the following?
a. a) Combines the output from no more than two queries and must include the same
number of columns
b. Combines the output from no more than two queries and does not include the
same number of columns
c. Combines the output from multiple queries and must include the same number of
columns
d. Combines the output from multiple queries and does not include the same number
of columns
31. Which of the following is a correlated subquery?
a. Uses the result of an inner query to determine the processing of an outer query
b. Uses the result of an outer query to determine the processing of an inner query
c. Uses the result of an inner query to determine the processing of an inner query
d. Uses the result of an outer query to determine the processing of an outer query

32. The following SQL is which type of join: SELECT CUSTOMER_T.


CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM
CUSTOMER_T,ORDER_T?
a. Equi-join
b. Natural join
c. Outer join
d. Cartesian join
33. Which of the following statement is true ?
a. DELETE does not free the space containing the table and TRUNCATE free the
space containing the table
b. Both DELETE and TRUNCATE free the space containing the table
c. Both DELETE and TRUNCATE does not free the space containing the table
d. DELETE free the space containing the table and TRUNCATE does not free the
space containing the table
34. Which SQL statement is used to update data in a database?
a. Modify
b. Update
c. Save as
d. Save
35. Which SQL statement is used to delete data from a database?
a. Drop
b. Delete
c. Truncate
d. Remove
36. Which of the following is not a valid SQL type?
a) Decimal
b) Numeric
c) Float
d) Character
37. Which SQL statement is used to return only different values?
a. UNIQUE
b. DISTINCT
c. DIFFERENCE
d. LIKE
38. Which SQL keyword is used to sort the result-set?
a. GROUP BY
b. ORDER BY
c. HAVING
d. None of this
39. With SQL, how can you delete the records where the "FirstName" is "Peter" in the
Persons Table?
a. DELETE FROM PERSONS
b. DELETE * FROM PERSONS
c. DELETE FROM PERSONS WHERE FRISTNAME=’PETER’
d. None of these
40. Which operator used to select between range ?
a. RANGE
b. WITHIN
c. BETWEEN
d. None of this
41. The NOT NULL constraint enforces a column to not accept null values ?
a. TRUE
b. FLASE

42. The virtual table that its created by data from the result of an SQL 'Select' statement
is called _______
a. INDEX
b. VIEW
c. SEQUENCE
d. SYNONYM
43. A database design may be based on existing data.
a. TRUE
b. FLASE
44. The following SQL is which type of join: SELECT CUSTOMER_T.
CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM
CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID =
ORDER_T. CUSTOMER_ID
a. Equi-join
b. Natrual Join
c. Outer Join
d. Cartesian Join
45. Advantages of View are
a. Security
b. Query re-usability
c. Abstraction – hiding data
d. All

You might also like