db final Flashcards
(212 cards)
Which of the following Oracle tools can be used to execute SQL statements against a database?
SQL Developer
SQL*Plus command line
SQL Live
The relational model consists of which of the following. Choose all that are true:
Primary and foreign keys
Collection of tables (relations)
Data integrity for accuracy and consistency
Set of operators to act on the relations, called the relational algebra
What are a primary key’s identifying characteristics? (Select all that apply.)
It uniquely identifies each row
it cannot be NULL
Consider the following rows in a table called CUSTOMERS:
CUST_ID FIRST_NAME MIDDLE LAST_NAME
1 Bianca M. Canales
2 Chua A. Nguyen
3 Bianca M. Jackson
4 Maya R. Canales
5 Bianca S. Canales
How many rows of data will be displayed as the result of executing the following statement: (one answer)
SELECT DISTINCT LAST_NAME, FIRST_NAME FROM CUSTOMERS;
4
The SHIPS table has two columns: SHIP_ID and SHIP_NAME
Which of the following SELECT statements will produce a syntax error? (Choose two.)
SELECT FROM ships;
SELECT (ship_id, ship_name) FROM ships;
Which of the following is NOT required to form a syntactically correct SELECT statement?
a valid column name
Consider the following table structure:
Name Type
——————– ———
ENGINE_ID NUMBER (PRIMARY KEY)
ENGINE_NAME VARCHAR2(30)
DISPLACEMENT NUMBER
What will be the result of executing the following SELECT statement?
SELECT ENGINE_NAME FROM ENGINES;
it will display the engine name from all of the rows in the ENGINES table, however many there may be (blank space for NULL values)
Given that the columns and table name are all correct, which of the following lines of the SELECT statement contain an error? (line numbers added)
01 SELECT name, contact,
02 “Person to Call”, phone
03 FROM publisher;
02
Which component(s) of the following query is/are a literal (select all that apply):
SELECT order_id || ‘-‘ || line_item_id || ‘ ‘ || quantity “Purchase”
FROM line_item;
‘ ‘
‘-’
You are tasked with creating a SELECT statement to retrieve data from a database table named PORTS. The PORTS table has two columns: PORT_ID, and PORT_NAME. Which of the following is a valid SELECT statement? (Choose all that apply.)
SELECT * FROM PORTS;
SELECT PORT_NAME, PORT_ID FROM PORTS;
SELECT ‘Name of the port ‘ || PORT_NAME FROM PORTS;
To become an Oracle SQL Certified Associate, one must pass one exam, 1Z0-071.
True
Which is the only type of relationship that can be directly implemented by the relational model?
1-Many
The category of SQL commands used to work with the actual data, such as INSERT, UPDATE, and DELETE, is called _____.
Data Manipulation Language (DML)
Which of the following are Oracle Development Environments?
SQL Live
SQL*Plus command line
SQL Developer
A table consists of (choose the single best answer)
Rows and columns, primary key, and possibly foreign keys
A primary key may contain NULL values.
False
The category of SQL commands used to build database objects, such as CREATE, ALTER, and DROP, is called ________.
Data Definition Language (DDL)
The relational model consists of which of the following. Choose all that are true:
Collection of tables (relations)
Set of operators to act on the relations, called the relational algebra
Primary and foreign keys
Data integrity for accuracy and consistency
What is the number one DBMS used worldwide, according to DB-Engines Ranking?
Oracle
A ______ is the intersection of a row and a column.
field
The UNIQUE keyword in the SELECT clause will eliminate duplicate values in the result set
False
What will be the result of the executing the following SELECT statement? SELECT ENGINE_NAME FROM ENGINES; SELECT
It will display engine names from all of the rows in the ENGINES table … (NULL will display as blank)
Consider the following statement:
CREATE TABLE PORTS
(port_id NUMBER,
port_name VARCHAR2(20));
Which of the following modifications to the statement is the only valid way to declare that the port_name is required (not optional)?
port_name VARCHAR2(20) NOT NULL
After executing the following SQL statements:
CREATE TABLE invoices (inv_id NUMBER, discount NUMBER));
INSERT INTO invoices VALUES (7, 5);
INSERT INTO invoices VALUES (3, 12);
Which of the following SQL statements will fail? (Choose two.)
ALTER TABLE invoices MODIFY discount VARCHAR2(3);
ALTER TABLE invoices MODIFY discount DEFAULT ‘ZERO’;