Q. SQL is the most popular query language because it
has relatively simple statements.
Q. Write an SQL statement to display SKU and SKU_Description.
SELECT sku, sku_description FROM inventory
Q. The GROUP BY clause sorts the data in a particular order.
Q. Which of the following is a valid table name in Oracle 12c? jimm8Y%c _5_H76ang S_c#oT#2t_321sM#_i_T6h 2LaN_n23_es#M#m mAU$reE78_&_n1
Q. Which of the following SQL statements is a correctly stated correlated subquery? A) SELECT C1.CustName, C1.SalesRepNo FROM CUSTOMER C1 WHERE C1.SalesRepNo IN (SELECT S1.SalesRepNo FROM SALESREP S1 WHERE S1.RepName = ‘Smith‘); B) SELECT C1.CustName, C1.SalesRepNo FROM CUSTOMER C1 WHERE C1.SalesRepNo IN (SELECT S1.SaleRepNo FROM SALESREP S1 WHERE S1.RepName = ‘Smith‘) AND C1.SalesRepNo=S1.SalesRepNo); C) SELECT C1.CustName, C1.SalesRepNo FROM CUSTOMER C1 WHERE C1.SalesRepNo IN (SELECT S1.SaleRepNo FROM SALESREP S1 WHERE S1.RepName = ‘Smith‘) AND C1.SalesRepNo<>S1.SalesRepNo); D) SELECT C1.CustName, C1.SalesRepNo FROM CUSTOMER C1 WHERE C1.SalesRepNo IN (SELECT C2.SaleRepNo FROM CUSTOMER C2 WHERE C1.SalesRepNo=C2.SalesRepNo); AND C1.OrderNo<>C2.OrderNo);
Q. Which SQL database object represents a single entity or item?
Q. Which best defines the function of SQL in a database?
It is the language relational databases use to create database objects and to manipulate and retrieve data
Q. Which SQL statement is used to insert new data in a database? ADD RECORD ADD NEW INSERT NEW INSERT INTO
Q. A(n) ____ is used to indicate how data should relate to a given search condition. A) comparison operator B) logical operator C) search pattern D) criteria
A) comparison operator
Q. Which SQL statement is used to return only different values?
Q. Which of the following statements about performing DML operations on complex views is correct?
DML operations cannot be performed on a non key-preserved table.
Q. The serializable isolation level is the least restrictive level defined by the ANSI SQL standard.
Q. TAL Distributors sells appliances, toys, and kitchen gadgets.
Q. What does WHERE identify in a basic SQL SELECT statement?
The rows to be included
Q. Which of the following search patterns could be used to find the word HELLO in Oracle12c?
Q. When running an SQL query that uses EXISTS, the EXISTS keyword will be true if ________.
any row in the subquery meets the condition
Q. In Python, what is a database “cursor“ most like?
A file handle
Q. Which type of SQL statement returns a result set?
Q. _____________ SQL statement identifies the columns to be displayed.
Q. Find the country that has all the vowels and no spaces in its name.
SELECT name FROM world WHERE name NOT LIKE ‘% %‘ AND name LIKE ‘%a%‘ AND name LIKE ‘%e%‘ AND name LIKE ‘%i%‘ AND name LIKE ‘%o%‘ AND name LIKE ‘%u%‘;
Q. Write the code for a DELETE statement that deletes every row in the Vendors table:
DELETE FROM Vendors
Q. Oracle 12c, MS SQL Server, and Tamino are examples of _____ data models.
Q. The NOT NULL constraint enforces a column to not accept null values. A. False B. True
Q. A script file containing SQL statements can be executed from SQL*Plus.
Q. Which of the following refers to a predefined block of code?
Q. The SQL SELECT statement is capable of:
Selection and projection
Q. What is the second stage of the SQL processing?
Q. Each of the following is a valid reason to use a transaction except for one. Which one is it?
The results of a SELECT query will be used as a subquery.
Q. What do you typically use to relate two tables that have a one-to-one relationship? a. indexes b. composite keys c. foreign keys d. primary keys
Q. List the trip name of each trip that has Miles Abrams as a guide
Select Trip_Name From Trip, Guide, Trip_Guide Where Trip.Trip_ID = Trip_Guides.Trip_ID And Guide.Guide_Num = Trip_Guides.Guide_Num and last_name = ‘Abrams‘
Q. The SQL command used to create a virtual table is . a.) CREATE VTABLE b.) CREATE VIEW c.) VTABLE d.) VIEW e.) NEWLOOK
b.) CREATE VIEW
Q. SQL ________ statements may change the contents of a database.
UPDATE DELETE INSERT
Q. The _____ command defines a default value for a column when no value is given. a. CHECK b. UNIQUE c. NOT NULL d. DEFAULT
Q. Query all columns (attributes) for every row in the CITY table.
SELECT * FROM CITY
Q. The name of a table can be changed with the ____________________ command.
RENAME RENAME TO RENAME TO
Q. Microsoft SQL Server is an example of a:
database management system
Q. Given the following data in the employees table (employee_id, salary, commission_pct) DATA: (143, 2600, null 144, 2500, null 149, 10500, .2 174, 11000, .3 176, 8600, .2 178, 7000, .15) What is the result of the following statement: SELECT SUM(commission_pct), COUNT(commission_pct) FROM employees WHERE employee_id IN( 143,144,149,174,176,178);
SUM = .85 and COUNT = 4
Q. How many error modes are available when using PDO to execute SQL statements?