0% found this document useful (0 votes)
23 views24 pages

Fd4 SQL Testing

The document contains a series of SQL-related questions and answers aimed at assessing knowledge of SQL queries, database management, and data manipulation. It includes scenarios involving employee information, student updates, order status changes, and data retrieval from multiple tables. Each question provides multiple-choice answers for the user to select the correct SQL query or command.

Uploaded by

2087 NIRMAL S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views24 pages

Fd4 SQL Testing

The document contains a series of SQL-related questions and answers aimed at assessing knowledge of SQL queries, database management, and data manipulation. It includes scenarios involving employee information, student updates, order status changes, and data retrieval from multiple tables. Each question provides multiple-choice answers for the user to select the correct SQL query or command.

Uploaded by

2087 NIRMAL S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

deselect Foundation Test 4 - sQL (..

O 03M535
25/25 Questions attempted Help

All 1. SQL: Information

EMCQATTEMPTED

You are working with a database containing employee information. You want to find employees who are either in the Engineering department and have a salary greater than $80,000,
or employees in the Sales department with a Senior job title.
Which SQL query should you use to achieve this?

Answer
4 CLEAR
Please choose a correct answer.

SELECT * FROM employees WHERE (department 'Engineering' AND salary > 80000) OR (department Sales' AND job_title 'Senior');

8
SELECT * FROM employees WHERE (department - 'Engineering' OR department 'Sales') AND (salary > 80000 OR job_title - 'Senior');

10 SELECT FROM employees WHERE (department - 'Engineering' AND salary > 80000) AND (department - 'Sales' AND job title = 'Senior' );

12 SELECT * FROM employees WHERE (department = Engineering AND salary > 80000) XOR (department = 'Sales' AND job title = Senior');

13
deselect Foundation Test 4- SQL (.. O 03 M485 25/25 Questions attempted Help

All 2. SQL:Query Is Correct


EMCQATTEMPTED

There isa Student table that has two column IDs and names.
2
We need to update the name of the student with id = 10 as John. Which of the following query is correct?

Answer
CLEAR
Please choose a correct answer.

UPDATE STUDENT SET NAME"John" WHERE ID-10;

8 UPDATE NAME FROM STUDENT SET NAME =" John" WHERE ID-10;

10 UPDATE NAME ="John" FROM STUDENT WHERE ID=10;

None of the mentioned.


12

https//app.doselectcom/test/Dxbg8/problem/934b3p
deselect Foundation Test 4 - SQL (... O 03 M415
25/25 Questions attempted Help

All 4. SQL: Analysis


MCOATTEMPTED

Assume that you work for a company that operates an e-commerce website. You are tasked with updating the order status for a particular customer's orders. You are provided with
the given table schema:

CREATE TABLE customers (


id INT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR (50) UNIQUE

CREATE TABLE orders (


id INT PRIMARY KEY,
customer_ id INT,
status VARCHAR(20)

Which SQL statement can be used to update the status of all the orders for the customer with the email [email protected] to "shipped?
10 Answer
CLEAR
Please choose a correct answer.

11

12
UPDATE orders

SET Status shipped"


https//app.doselect.com/test/Dxbg8/problem/nr53w
deselect Foundation Test 4- SQL (.. O 03 M22 5
25/25 Questions attempted Help

All Which SQL query retrieves information about the primary key columns of the "customers table?
Answer
CLEAR
Please choose a correct answer.

SELECT cONSTRAINT NAME, cOLUMN NAME


FROM INFORMATION SCHEMA.KEY COLUMN USAGE
WHERE TABLE NAME ='Customers " AND CONSTRAINT NAME = 'PRIMARY:

6
SELECT CONSTRAINT NAME, COLUMN NAME
FROM INFORMATION SCHEMA. KEY COLUMN USAGE
WHERE REFERENCED TABLE NAME - 'customers AND CONSTRAINT TYPE - PRIMARY KEY':

SELECT cOLUMN NAME, CONSTRAINT NAME


FROM INFORMATION SCHEMA.CONSTRAINT_COLUMN USAGE
WHERE TABLE NAME = 'customers' AND CONSTRAINT TYPE = 'PRIMARY KEY';

12
SELECT cOLUMN NAME, CONSTRAINT NAME
FROM INFORMATION _SCHEMA.CONSTRAINT_COLUMN USAGE
Drrorrn TABLE NAME = 'customers AND CONSTRAINT_TYPE -PRIMARY';
https//app.doselect.com/test/Oxbg8/problem/dstwxt
deselect Foundation Test 4- SQL (... O 03 M285
25/25 Questions attempted Help
Consider a scenario where a company possesses twO tables: the first one holds customer details with columns such as customer id, customer name, and email and the second one
Al
contains order information with columns like order_id, customer_id, total_amount, and order date
Describe how you would formulate a SQL query to combine these tables and obtain the total amount spent by each customer.
Answer
CLEAR
Please choose a correct answer.

SELECT customer.customer id, SUM(total amount) AS total spent


FROM Customer
5
INNER 0IN order ON customer id = order.customer id
GROUP BY customer id;

SELECT customer_id, SUM(order_amount) AS total_spent


FROM customer

INNER JOIN order ON customer id = order.customer id


GROUP BY customer.customer_ id;
10

SELECT customer.customer_ id, SUM(order.total amount) AS total spent


FROM customer
12
INNER JOIN order ON customer.customer id = order.customer id
GROUP BY customer.customer id;

https//app.doselectcom/test/Dxbq8/problem/xnváp1
deselect Foundation Test 4- SQL (... O 03 M 08S 25/25 Questions attempted Help

All 9. SQL: Product Data


EMCQATTEMPTED

Assume you are a database administrator for a companythat is updating an existing SQL database with new product data. The new data requires a change in the data type for the
price column in the product table from decimaltoan integer.
Which SQL command should you use to change the data type?

Answer
CLEAR
Please choose a correct answer.

O MODIFY ALTER cOLUMN

ALTER COLUMN

CHANGE ALTER COLUMN

10
ALTER UPDATE COLUMN

12

13
døselect Foundation Test 4-SQL (. O 03 M11S
25/25 Questions attempted Help

All 8. SQL: Student Schema


EMCQATTEMPTED

You want to allow records to be inserted with a blank email ID field initially. However, you need to ensure that this blank field is automatically populated with a random email ID ending
in @gmail.com' after insertion.
Which combination of constraints and mechanisms should you use to achieve this?

Answer
CLEAR
Please choose a correct answer.

O CHECK

DEFAULT

NOT NULL

UNIQUE @gmail.com'

12

13
deselect Foundation Test 4-SQL (.. O 03 M165
25/25 Questions attempted Help

All
Assume thnat your company has a database that stores information about employees and their salaries. The HR department needs to update the salary of a specific employee who has
just received a raise.
Which DML command should the HR admin use to update the salary of the employee with employee_id 101?

Answer
CLEAR
Please choose a correct answer.

UPDATE employees SET salary = 75000 WHERE employee id 101;

6
DELETE FROM employees WHERE employee_id - 101;

SELECT * FROM employees WHERE employee_id - 101;

10
INSERT INTO employees (employee_id, first_name, last_name, salary) VALUES (181, 'John', 'Doe, 75000);

12 Having an issue with this question? O Report

https//app.doselect.com/test/Oxbg8/problem/dstwxt
deselect Foundation Test 4- SQL (.. O02M375 25/25 Questions attempted Help
first_name NVARCHAR(255),
All
last_name NVARCHAR(255),
job_title NVARCHAR(255),
hire_date DATETIME,
salary MONEY

CREATE TABLE employees (


emp_id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(255),
last_name VARCHAR(255),
job_title VARCHAR(255),
hire date DATE,
salary DECIMAL (10, 2)
8 );

CREATE TABLE employees (


10
emp id INTEGER PRIMARY KEY,
O first_name VARCHAR(255),
last_name VARCHAR (255) ,
12 job_title VARCHAR(255),
hire date DATE,

13 salary DECIMAL (10,2)


deselect Foundation Test 4-SQL (. O 02M 565
25/25 Questions attempted Help

Al Assume that you are working as a database administrator for a company that has recentiy implemented a new payroll system. As part of this system, you need to create a new table
named 'employees' that will store information about all the company's employees. The employees table should have the given columns:
emp_id (integer, auto-incremented, primary key)
first_name (string)
last_name (string)
job_title (string)
hire_date (date)
salary (decimal)
Which SQL statement can be used to create the "employees table with the required columns? Analyze the given choices and select the correct option.
Answer
CLEAR
Please choose a correct answer.

8 CREATE TABLE employees (


emp id SERIAL PRIMARY KEY,
9 first_name TEXT,
last_ name TEXT,
job_title TEXT,
hire_date DATE,
salary NUMERIC (10,2)

12

13
CREATE
12. MySQL: Most Active Users on Social MySQL
Media
02m 22s 1 use SocialData;
left EDatabaseACCEPTED
*Enter your query below.
Environment Specifications & Instructions *Please appenda semicolon "; " at the end of the query
5
Type of Database 6 SELECT U.USER_ID AS userId, U.USERNAME AS userName, P.NO _OF_POST as topPost
7 FROM USERS U JoIN POSTS P ON U.USER ID -P.USER ID
MySQL ORDER BY P.NO_OF_POST DESC LIMIT-4;
Help Database Name to be used
SocialData
All
Problem Statement
Write a SQL query to find the top 4 most active users on
a social media platform, where activity is defined as the
maximum number of posts created.
The query should include a column called the user_id as
userld, the username as userName and no_of_oost as
topPost that indicates the user who created the maximum
number of posts.
Ln 2. Col 3 MySQL
Return the output result based on topPost in descending
order. Test Results TEST QUERY RUN &sUBMIT > NEXT QUESTION

Column Name: userld, userName, topPost


12
Table Description: Testcase #1 Passed
13 " Users
Description
Testcase passed! The solution's output matches the expected output.
Testcase #2
0.00s Os 6MB
Eval Time CPU Memory
|Field | Type | Null | Key |
Defaut
11. MysQL: Employee Data MySQL

02m 27s DatabaseACCEPTED 1 use EmployeeData;


)left |Enter your query below.
Environment Specifications & Instructions
*Please append a semicolon ";" at the end of the query
Type of Database 5
6 selectE.EMPID, E.EMPNAME, E.SALARY AS EMPSALARY, M. SALARY-AS MANAGERSALARY
MySQL 7 from TBLEMPLOYEE E join TBLEMPLOYEE M on E.MANAGERID -M.EMPID AND E.SALARY> M.
Database Name to be used SALARY ORDER BY EMPID;
Help
EmployeeData
All Problem Statement
Write a standard SQL query that will return the value of
"EMPID" and "EMPNAME" for those employees who
earn more than their managers. Additionally, the query will
return the salary of an employee as column name
"EMPSALARY" and the salary of a manager as column
name "MANAGERSALARY".
The rows should be returned in the increasing order of
"EMPID" Ln 2. Col 3 MySQL
Column Name: EMPID EMPNAME, EMPSALARY,
Test Results TEST QUERY ºRUN &SUBMIT > NEXT QUESTION
MANAGERSALARY

Table Description:
Testcase #1 Passed
" tblemployee
Description
Testcase passed! The solution's output matches the expected output.
0.00s Os 12MB
| Field I Type | Null | Key | Eval Time CPU Memory
Default | Extra |
13. MySQL: Employee with Highest Salary MySQL

02m 03s EDatabaseACCEPTED 1 use CompanyDb;


left
Environment Specifications & Instructions *Enter your query below.
*Please appenda semicolon"; " at the end of the query
Type of Database 5
6
MySQL SELECT D.DEPARTMENT_ID,D.DEPARTMENT_ NAME, A.FIRST_NAME,A. LAST_ NAME, A.SALARY
Database Name to be used 8 FROM DEPARTMENTS D LEFT J0IN
Help (SELECT E.FIRST_ NAME,E. LAST_NAME, E.DEPARTMENT ID,S.SALARY
ComparnyDb 10 FROM EMPLOYEES E J0IN SALARIES S ON E.EMPLOYEE_ ID S.EMPLOYEE_ID) A
Problem Statement 11 ON D.DEPARTMENT_ID A.DEPARTMENT_ID
All 12 ORDER BY D.DEPARTMENT ID;
Write a SQL query to retrieve a list of department_id, 1

department_name, and the first_name & the


last_name of the employee with their salary in each
department. If a department has no employees or salary
information, it should still appear in the result with NULL
values.

The rows should be returned in the increasing order of


"department id" Ln 2. Col 3 MysQL
Column Name: department_ id, department_name, TEST QUERY RUN & sUBMIT > NEXT QUESTION
first name, last _name, salary Test Results

12 Table Description:
Testcase #1 Passed
" departments
Description
Testcase passed! The solution's output matches the expected output.
14 Testcase #2
0.00s Os OkB
| Field I Type | Null | Eval Time CPU Memory
Key | Default | Extra |
15. MySQL: Course Fees MySQL

01m 49: =DatabaseACCEPTED 1 use DB_Institute;


left
Environment Specifications & Instructions Enter your query below.
*Please append a semicolon"; " at the end of the query
5
" Type of Database: MysQL
6 SELECT E.STUDENTID AS StudentID, E.STUDENTNM AS Name, E.DTENROLL AS Date0fEnrollment,F.
" Database Name to be used: DB_Institute FEESPAID AS FeesPaid ,F.FEESDUE AS FeesDue, F.PAYMENTDATE as PaymentDate FROM
7 (SELECT.*FROM TBL STUDENTS ENROLL WHERE STUDENTID NOT IN
Help Existing Information (SELECT E.STUDENTID
FROM
" Table Descriptions: 1 TBL STUDENTS ENROLL E J0IN
All 11 TBL STUDENTS FEES F ON
TBL_Students Enroll is described below. 12 E.STUDENTID-F.STUDENTID
ID int
13 AND E.COURSENM- 'PYTHON' ) AND COURSENM-"PYTHON' )- E
14 LEFT-JoIN
StudentNm varchar(50) 15 TBL STUDENTS FEES F
StudentiD varchar(50) 16 ON E.STUDENTID-F.STUDENTID
EmaillD 17 ORDER BY E.STUDENTNM
varchar(50)
18
CourseNm varchar(50)
19
MobileNo varchar(50)
Address varchar(50)
DtEnroll datetime Ln 2. Col 3 MysQL
TBL Students Fees are described below:
Test Results TEST QUERY ºRUN &SUBMIT > NEXT QUESTION
Column Name Data Type
ID int

Studentld varchar(50) Testcase #1 Passed


FeesPaid int
13
FeesDue int
Description
PaymentDate datetime
Testcase passed! The solution's output matches the expected output.
14 Testcase #2
Problem Statement Os
0.00s OkB
Eval Time CPU Memory
15 Constructa query that displays StudentlD, Name,
DateOfEnrollment, FeesPaid, FeesDue, and
14. MySQL: Order placed by Customer MySQL

01m 56s EDatabaseACCEPTED 1 use Customerdb;


left
Environment Specifications & Instructions Enter your query below.
Please append a semicolon";" at the end of the query
Type of Database 5
6 SELECT A.CUSTOMER ID, B.TOTAL ORDERS FROM
MysQL (SELECT CUSTOMER_ID, COUNT (ORDER_ID) AS TOTAL_ORDERS
Database Customerdb 8 FROM ORDERS WHERE TOTAL AMOUNT > 500. 0e
Help GROUP BY CUSTOMER ID)A J0IN
Problem Statement:
1
Write a SQL query to find the customer who has placed 11 SELECT-CUSTOHER_ID, COUNT(ORDER_ID) AS TOTAL_ORDERS
All 12 FROM ORDERS
more than two orders with a total amount exceeding $500. 13 GROUP BY CUSTOMER_ID
Display the customer_id and the total number of orders 14 )B
15 ON A.CUSTOMER ID-B.CUSTOMER ID AND A.TOTAL ORDERS>-2
placed by that customer as total_orders. 16 ORDER BY A.CUSTOMER_ID;
The rows should be returned in the increasing order of
"customer id".
Column Name: customer_id, total_orders
Table Description :
orders Ln 2. Col 3 MysQL

Test Results TEST QUERY ºRUN &SUBMIT > NEXT QUESTION

| Field Type | Null | Key O Passed


Testcase #1
| Default | Extra |
13
Description
Testcase passed! The solution's output matches the expected output.
14 Testcase #2
| order_id | int (11) | NO | PRI 0.00s Os 10MB

15
| NULL Eval Time CPU Memory
| customer id | int (11) | YES |
NUL
deselect Foundation Test 4- SQL (.. O01M 385
25/25 Questions attempted Help

All 18. Publishing Test


EMCQATEMPTED
13

When publishing a test execution report, which key attribute(s) must the report contain? Select all that apply.
74

Answer & CLEAR


16
Please choose all correct answers.

18 Test cases

Test environment and configuration

Defects

Root cause of any failures

https//app.doselect.com/test/Oxbg8/problem/85113
deselect Foundation Test 4-SQL (.. O01M 40S 25/25 Questions attempted Help

All 17. Metrics Monitor

A EMCQATTEMPTED
13
Which of the following metrics would be most useful to monitor during test execution?
14

Answer
16 CLEAR
Please choose a correct answer.

OPercentageof test cases written

Number of test environments remaining to be configured

O Number of defects found and fixed

O Percentage of requirements for which a test has been written

https//app.doselect.com/test/Oxbg8/problem/944
doselect Foundation Test 4- SQL (.. O 01 M435 25/25 Questions attempted Help

All 16. Comparision Following


=MCQATTEMPTED
13

Which of the following comparisons of component testing and system testing are TRUE?
14

15

Answer
16 CLEAR
Please choose a correct answer.

17

18 Component testing verifies the functioning of software modules, program objects, and classes that are separately testable, whereas system testing verifies interfaces between
components and interactions with different parts of the system.

20 O Test cases for component testing are usually derived from component specifications, design specifications, or data models, whereas test cases for system testing are usually
derived from requirement specifications, functional specifications or use cases.

O Component testing focuses on functional characteristics, whereas system testing focuses on functional and non-functional characteristics.

25

24
deselect Foundation Test 4- SQL (. O 01 M345
25/25 Questions attempted Help

All 20. Employee Bonus


A EMCQATTEMPTED
13

Software is used to calculate Employee bonuses. Bonus cannot be negative, but it can be zero. The bonus is based on the duration of the employment. An employee can be employed
14
for less than or equal to 2 years, more than 2 years but less than 5 years, 5to 10 years, or longer than 10 years. Depending on this period of employment, an employee will get a baonus of
09%, 109%, 259% or 35%.
How many equivalence partitions are needed to test the calculation of the bonus?
16

Answer
4 CLEAR
Please choose a correct answer.

20
O5

O2

https//app.doselect.com/test/Oxbg8/problem/3b41
deselect Foundation Test 4- sQL (... O01 M355 25/25 Questions attempted Help

All 19. Review Formal

EMCQATTEMPTED
13
Which of the following are the main phases of a formal review?
74

15

Answer 4 CLEAR
16
Please choose a correct answer.

12

18 Initiation, status, preparation, review meeting, rework, follow up.

19
Planning, preparation, review meeting, rework, closure, follow up.
20

O Planning, kick off individual preparation, review meeting, rework, follow up.

O Preparation, review meeting, rework, closure, folow up, rocot cause analysis.

https//app.doselectcom/test/Ox6g8/problem/v489p
deselect Foundation Test 4 - SQL (... O01MO55 25/25 Questions attempted Help

All 22. Design Test

13
A EMCQATTEMPTED

In software testing, a "flaky test" s a term used to describe a test that:


14

15
Answer
CLEAR
Please choose a correct answer.

Always produces the same result under the same conditions.


18

Produces non-deterministic outcomes, sometimes passing and sometimes failing, under the same conditions.

20
O Is only applicable for performance and load testing scenarios.

ORefers to a test that is not automated but conducted manually.


22

23
Ois specifically designed to test the security features of the application.

https//app.doselect.com/test/Oxbg8/problem/deirn
deselect Foundation Test 4 - SQL (.. O01M 085 25/25 Questions attempted Help

All 21. Enough Testing

13
A
EMCQATTEMPTED

How much testing is enough?


74

15

Answer
16 & CLEAR
Please choose a correct answer.

12

O This question is impossible to answer

O This question is easy to answer


20

The answer depends on the risk for your industry, contract and special requirements
21

O This answer depends on the maturity of your developers


deselect Foundation Test 4- SQL (.. O01 M025 25/25 Questions attempted Help

All 23. Supported Quality

13
A EMCQATEMPTED

Which of the following function(s) isare) typically supported by a software quality information system?
14
(Select all that apply)

15

16
Answer
CLEAR
Please choose all correct answers.

Test Management

D System design
20

Defect Tracking

Configuration Management
23

https://app.doselect.com/test/Oxbg8/problem/9gx05
døselect Foundation Test 4- SQL(.. O00M595
25/25 Questions attempted Help

All 24. Important Thing


A EMCQATTEMPTED
13

The most important thing about early test design is that it?
74

Answer CLEAR
16

Please choose a correct answer.

12

18 makes test preparation easier

means inspections are not required


20

can prevent fault multiplication

will find all faults

23

https//app.doselect.com/test/Oxbg8/problem/n406q

You might also like