Fe Mysql 1 Fullstack Qs en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

DEVELOPER FINAL TEST

Code: Dev-MySQL 01
Total question: 30
Allowed time: 30’

- Select one answer for each question.


- You are NOT allowed to used mobile or internet device during the exam.
1. Subqueries can be nested multiple times?

A. TRUE
B. FALSE

2. The LIKE SQL keyword is used along with?

A. WHERE clause
B. ORDER BY clause
C. JOIN clause
D. GROUP BY clause
3. With SQL, how can you insert a new record into the "Persons" table?

A. INSERT VALUES ('Jimmy', 'Jackson') INTO Persons.


B. INSERT ('Jimmy', 'Jackson') INTO Persons
C. INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

4. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons
table?

A. UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'


B. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
C. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
D. MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen'

5. How many tables may be included with a join?

A. One.
B. Two.
C. Three.
D. All of the mentioned options.

6. What key is used to link two tables in Mysql?

A. Primary key
B. Foreign key
C. Primary and foreign key

Software Developer Final Test Page 1 of 8


D. None of the above

7. MySQL is a(n) _________ database management system ?

A. Object oriented
B. Hierarchical
C. Relational
D. Network

8. The clause that filters JOIN results is called _________?

A. WHERE.
B. SORT
C. GROUP
D. GROUP BY

9. Foregin keys cannot handle deletes and updates.

A. True
B. False

10. Which SQL gain table B from table A?

A. SELECT department_code, employee_ID, name


FROM A
GROUP BY employee_ID;

B. SELECT department_code, employee_ID, name


FROM A
GROUP BY department_code;

Software Developer Final Test Page 2 of 8


C. SELECT department_code, employee_ID, name
FROM ASoftware Developer Entry Test Page 2 of 9
ORDER BY employee_ID;

D. SELECT department_code, employee_ID, name


FROM A
ORDER BY department_code.

11. The AUTO_INCREMENT column attribute is best used with which type?

A. FLOAT
B. INT
C. CHARACTER
D. DOUBLE

12. There is a table including the data items shown below. Which of the following SQL
statements can insert a new row in the “student” table?

A. INSERT INTO student (stud_id, address, graduation)


VALUES (101, ‘Dave’, ‘100 Happy Lane’, ‘2001-06-14’);

B. INSERT INTO student (stud_id, address, name, graduation)


VALUES (101, ‘100 Happy Lane’, ‘Dave’, ‘2001-06-14’);

C. INSERT INTO student


VALUES (101, ‘100 Happy Lane’, ‘2001-06-14’, ‘Dave’);

D. INSERT INTO student

VALUES (101, ‘2001-06-14’, ‘100 Happy Lane’, ‘Dave’);

13. What is abc in the following MySQL statement?

Software Developer Final Test Page 3 of 8


A. row name
B. column name
C. view
D. database

14. A view can refer to multiple tables via __________?

A. UNION
B. SELECT
C. GROUP
D. JOIN

15. How many rows are included in the table gained as as result of execution of the following
statement?

SELECT DISTINCT customer_name, merchandise_name, unit_price

FROM order_table, merchandise_table

WHERE order_table.merchandise_number = merchandise_table.mnrchandise_number;

A. 2.
B. 3.
C. 4.
D. 5.

16. Which of these return a result to the client?

A. Stored functions

Software Developer Final Test Page 4 of 8


B. Stored procedures
C. Triggers
D. Events

17. Which of these is defined to execute when the table is modified only?

A. Stored functions.
B. Stored procedures.
C. Triggers.
D. Events.

18. Which of the following SQL statements can extract employee name’s whose salary is

$10000 or higher from the table “human_resource”?

A. SELECT salary
FROM human_resourceSoftware Developer Entry Test Page 6 of 9
WHERE employee_name >=10000
GROUP BY salary
B. SELECT employee_name, COUNT(*)
FROM human_resource
WHERE salary>=10000
GROUP BY employee_name
C. SELECT employee_name, salary
FROM human_resource
GROUP BY salary
HAVING COUNT(*)>=10000.
D. SELECT employee_name
FROM human_resource
WHERE salary>=10000.

19. You have a table named Employees. You want to identify the supervisor to which

each employee reports. You write the following query.

SELECT e.EmloyeeName AS [EmployeeName], s.EmployeeName AS [SuperVisorName]

FROM Employees e

You need to ensure that the query returns a list of all employees and their respective

supervisor. Which join clause should you use to complete the query?

A. RIGHT JOIN Employees s ON e.ReportsTo = s.EmployeeId.


B. LEFT JOIN Employees s ON e.ReportsTo = s.EmployeeId.
C. INNER JOIN Employees s ON e.EmployeeId = s.EmployeeId.

Software Developer Final Test Page 5 of 8


20. How many values can be returned from a given stored function?

A. 0
B. 1
C. 2
D. 3

21. How many values can be returned from a stored procedure?

A. 0
B. 1
C. 2
D. 3

22. Which procedure parameter enables the caller to pass in a value and get back a value?

A. IN
B. OUT
C. IN OUT
D. GETINOUT

23. Your database contains two tables named DomesticSalesOrders and

InternationalSalesOrders. Both tables contain more than 100 million rows. Each table

has a Primary Key column named SalesOrderId. The data in the two tables is distinct

from one another. Business users want a report that includes aggregate information

about the total number of global sales and total sales amounts. You need to ensure that

your query executes in the minimum possible time. Which query should you use?

A. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION ALL
SELECT SalesOrderId, SalesAmount
FROM InternationalSalesOrders
) AS p;

B. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM (
SELECT SalesOrderId, SalesAmount
FROM DomesticSalesOrders
UNION

Software Developer Final Test Page 6 of 8


SELECT SalesOrderId, SalesAmountSoftware Developer Entry Test Page 7 of 9
FROM InternationalSalesOrders
) AS p;

C. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM DomesticSalesOrders
UNION
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount
FROM InternationalSalesOrders;

D. SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount


FROM DomesticSalesOrders
UNION ALL
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmount) AS TotalSalesAmount
FROM InternationalSalesOrders;

24. For which of the following are triggers not supported?

A. delete
B. update
C. insert
D. views

25. Which statement is used to remove a trigger?

A. REMOVE
B. DELETE
C. DROP
D. CLEAR

26. The datatype SMALLINT stores ___________?

A. 16 bit
B. 32 bit
C. 48 bit
D. 8 bit

27. Which Numeric Data type has the largest range?

A. Mediumint
B. Smallint
C. Int
D. Tinyint

Software Developer Final Test Page 7 of 8


28. Which is TRIGGER in Mysql?

A. All
B. After Delete
C. Before Insert
D. Before Update

29. What is the default format for “Datetime” data type?

A. YYYY-MM-DD HH:MI:SS
B. MM-YYYY-DD HH:MI:SS
C. DD-YYYY-MM MI:HH:SS
D. None of the mentioned

30. What is the data in a MySQL database?

A. Objects
B. Tables
C. Networks
D. File systems

Software Developer Final Test Page 8 of 8

You might also like