NEW
Font size
S
M
L
XL
WorksheetsJS SQL Reviewer
Total questions: 15
Worksheet time: 8mins
Name
Class
Date
1.
Where is the appropriate location to insert JavaScript code in an HTML file?
a)
Both the section and the section are correct
b)
The section only
c)
Outside the section
d)
The section only
2.
How can "Hello World" be displayed in an alert box using JavaScript?
a)
msgBox("Hello World");
b)
alert("Hello World");
c)
alertBox("Hello World");
d)
Box("Hello World");
3.
What is the proper way to create a function in JavaScript?
a)
function myFunction()
b)
function = myFunction()
c)
functions create()
d)
myFunction() function
4.
How can comments be added in a JavaScript code?
a)
//This is a comment
b)
c)
'This is a comment
d)
\\This is a comment
5.
Which JavaScript event is triggered when a user clicks on an HTML element?
a)
onchange
b)
onclick
c)
onmouseover
d)
ondbclick
6.
How can the value of the "src" attribute of an image be changed using the HTML DOM and JavaScript?


a)
document.getElementById("image").href = "pic_mountain.jpg";
b)
document.getElementById("image").link = "pic_mountain.jpg";
c)
document.getElementById("image").src = "pic_mountain.jpg";
d)
document.getElementById("image").name = "pic_mountain.jpg";
7.
Which of the following is the correct syntax for selecting only distinct values from the "Country" column in the "Employees" table?
a)
SELECT UNIQUE Country FROM Employees;
b)
SELECT DIFFERENT Country FROM Employees;
c)
SELECT DISTINCT Country FROM Employees;
d)
SELECT UNIQUE VALUES Country FROM Employees;
8.
Which of the following is the correct syntax for selecting all records from a table named "Voters" where the value of the "Age" column is greater than or equal to 18?
a)
SELECT * FROM Voters WHERE Age >= 18;
b)
SELECT * FROM Voters WHERE Age => 18;
c)
SELECT * FROM Voters WHERE Age > 18;
d)
SELECT * FROM Voters WHERE Age 18;
9.
Which of the following is the correct syntax for inserting a new record into a table named "Customers"?
a)
INSERT INTO Customers VALUES ('John Smith', 'New York', 'USA');
b)
INSERT INTO Customers ('John Smith', 'New York', 'USA') VALUES;
c)
INSERT INTO Customers (CustomerName, City, Country) VALUES ('John Smith', 'New York', 'USA');
d)
INSERT ('John Smith', 'New York', 'USA') INTO Customers;
10.
Which of the following is the correct syntax for updating the value of the "City" column to "Seattle" for all records in a table named "Employees"?
a)
UPDATE Employees SET 'Seattle' WHERE City;
b)
UPDATE Employees SET City WHERE 'Seattle';
c)
UPDATE Employees 'Seattle' WHERE City;
d)
UPDATE Employees SET City = 'Seattle';
11.
Which of the following is the correct syntax for calculating the average value of the "Salary" column in a table named "Employees"?
a)
SELECT AVERAGE(Salary) FROM Employees;
b)
SELECT AVG Salary FROM Employees;
c)
SELECT AVG(Salary) FROM Employees;
d)
SELECT AVERAGE Salary FROM Employees;
12.
Which of the following is the correct syntax for selecting all records from a table named "Employees" where the value of the "Age" column is greater than or equal to 25 and the value of the "Salary" column is less than or equal to 75000?
a)
SELECT * FROM Employees WHERE Age >= 25 AND Salary <= 75000;
b)
SELECT * FROM Employees WHERE Age < 25 OR Salary > 75000;
c)
SELECT * FROM Employees WHERE Age > 25 AND Salary < 75000;
d)
SELECT * FROM Employees WHERE Age => 25 AND Salary =< 75000;
13.
Which of the following is the correct syntax for using the AVG function to calculate the average grade of all students in a table named "Students"?
a)
SELECT AVERAGE(Grade) FROM Students;
b)
SELECT AVG Grade FROM Students;
c)
SELECT Grade FROM Students;
d)
SELECT AVG(Grade) FROM Students;
14.
Which of the following is the correct syntax for selecting the maximum value from the "Price" column in a table named "Products"?
a)
SELECT Price MAX FROM Products;
b)
SELECT MAX(Price) FROM Products;
c)
SELECT Price FROM Products WHERE Price = MAX;
d)
SELECT Price FROM Products WHERE MAX;
15.
Choose the correct JOIN clause to select all records from the two tables where there is a match in both tables.
SELECT *
FROM Orders
______________________________________.
ON Orders.CustomerID=Customers.CustomerID;
a)
LEFT JOIN Customers
b)
INNER JOIN Customer
c)
RIGHT JOIN Customers
d)
FULL JOIN Customers
Reset
