Database SQL Part 1 V1

Quiz
•
Computers
•
Professional Development
•
Hard
Md. Bhuiyan
Used 9+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Evaluate the following SQL statement:
SQL> select cust_id, cust_last_name "Last name"
FROM customers WHERE country_id = 10 UNION -
SELECT cust_id CUST_NO, cust_last_name FROM customers WHERE country_id = 30
Identify three ORDER BY clauses either one of which can complete the query.
ORDER BY "Last name"
ORDER BY 2, cust_id
ORDER BY CUST_NO
ORDER BY 2, 1
ORDER BY "CUST_NO"
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which three statements are true regarding the WHERE and HAVING clauses in a SQL statement? (Choose three.)
WHERE and HAVING clauses cannot be used together in a SQL statement.
The HAVING clause conditions can have aggregate functions.
The HAVING clause conditions can use aliases for the columns.
The WHERE clause is used to exclude rows before the grouping of data.
The HAVING clause is used to exclude one or more aggregated results after grouping data.
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which two statements are true about Data Manipulation Language (DML) statements?
An INSERT INTO...VALUES.. statement can add multiple rows per execution to a table.
An UPDATE... SET... statement can modify multiple rows based on multiple conditions on a table.
A DELETE FROM..... statement can remove rows based on only a single condition on a table.
An INSERT INTO... VALUES..... statement can add a single row based on multiple conditions on a table.
A DELETE FROM..... statement can remove multiple rows based on multiple conditions on a table.
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Examine the structure of the MEMBERS table. You want to display details of all members who reside in states starting with the letter A followed by exactly one character.
Which SQL statement must you execute?
SELECT * FROM MEMBERS WHERE state LIKE '%A_';
SELECT * FROM MEMBERS WHERE state LIKE 'A_';
SELECT * FROM MEMBERS WHERE state LIKE 'A_%';
SELECT * FROM MEMBERS WHERE state LIKE 'A%';
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
You want to display 5 percent of the rows from the SALES table for products with the lowest AMOUNT_SOLD and also want to include the rows that have the same even if this causes the output to exceed 5 percent of the rows.
AMOUNT_SOLD -
Which query will provide the required result?
SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES;
SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS ONLY WITH TIES;
SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS WITH TIES ONLY;
SELECT prod_id, cust_id, amount_sold FROM sales ORDER BY amount_sold FETCH FIRST 5 PERCENT ROWS ONLY;
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Examine the structure of the MEMBERS table:
Name Null? Type
------------------ --------------- ------------------------------
MEMBER_ID NOT NULL VARCHAR2 (6)
FIRST_NAME VARCHAR2 (50)
LAST_NAME NOT NULL VARCHAR2 (50)
ADDRESS VARCHAR2 (50)
You execute the SQL statement:
SQL > SELECT member_id, ' ' , first_name, ' ' , last_name "ID FIRSTNAME LASTNAME " FROM members;
What is the outcome?
It fails because the alias name specified after the column names is invalid.
It fails because the space specified in single quotation marks after the first two column names is invalid.
It executes successfully and displays the column details in a single column with only the alias column heading.
It executes successfully and displays the column details in three separate columns and replaces only the last column heading with the alias.
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
You execute the following commands:
SQL > DEFINE hiredate = '01-APR-2011'
SQL >SELECT employee_id, first_name, salary
FROM employees -
WHERE hire_date > '&hiredate'
AND manager_id > &mgr_id;
For which substitution variables are you prompted for the input?
none, because no input required
both the substitution variables ''hiredate' and 'mgr_id'.
only hiredate'
only 'mgr_id'
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
DDL - Create

Quiz
•
Professional Development
15 questions
DBMS Quizzz....!

Quiz
•
Professional Development
10 questions
Table relationships, SQL and Pandas joins

Quiz
•
Professional Development
15 questions
Introduction to API Quiz

Quiz
•
Professional Development
10 questions
SQL Sesi 1

Quiz
•
Professional Development
15 questions
JF UIT 2022 - Game 2

Quiz
•
Professional Development
15 questions
PHP tutorial review

Quiz
•
Professional Development
10 questions
SQL Programming

Quiz
•
4th Grade - Professio...
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade