Database SQL Part 1 V1

Database SQL Part 1 V1

Professional Development

13 Qs

quiz-placeholder

Similar activities

Microsoft SQL Server

Microsoft SQL Server

12th Grade - Professional Development

10 Qs

SQL

SQL

Professional Development

10 Qs

tubitak-quiz-1

tubitak-quiz-1

Professional Development

12 Qs

SQL Database - Basic

SQL Database - Basic

Professional Development

10 Qs

DP MÓDULO 02 pt-br

DP MÓDULO 02 pt-br

Professional Development

11 Qs

SQL1

SQL1

Professional Development

10 Qs

PHP MySQL

PHP MySQL

7th Grade - Professional Development

17 Qs

BAnDS Tournament Round 3

BAnDS Tournament Round 3

University - Professional Development

10 Qs

Database SQL Part 1 V1

Database SQL Part 1 V1

Assessment

Quiz

Computers

Professional Development

Hard

Created by

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

Media Image

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?