Sie sind auf Seite 1von 8

Question 1 (1 point)

Write a query that will retrieve the first name and last name columns from the table tblStaff. Ensure first
name is displayed first in your results.
Below is the design of tblStaff table.
tblStaff
ID_Staff
FirstName
LastName
The answer is not case sensitive
Ensure you have one space after any ',' comma's
Ensure no spaces are before any ',' comma's

Question 1 options:

Question 2 (1 point)

Write a query that will retrieve the all of the columns from the table tblStaff. You must use wild cards.
Ensure you sort your results in order of last name then first name. The last name must be in descending
order.
Below is the design of tblStaff table.
tblStaff
ID_Staff
FirstName
LastName
The answer is not case sensitive
Ensure you have one space after any ',' comma's
Ensure no spaces are before any ',' comma's

Question 2 options:

Question 3 (1 point)

Refer to the design of the table tblStaff below:


tblStaff
ID_Staff
FirstName
LastName
Complete the query below (without re-writing what is given) so you show only users with the last name of
smith and the first name of bob.
SELECT FirstName, LastName FROM tblStaff
The answer is not case sensitive
Ensure you have one space after any ',' comma's
Ensure no spaces are before any ',' comma's
Ensure you put a space before and after operators such as an '=' equil sign.

Question 3 options:

Question 4 (1 point)

Refer to the design of the table tblStaff below:


tblStaff
ID_Staff
FirstName
LastName
Complete the query below (without re-writing what is given) so you show only users with the last name of
smith and the last name of johnson.
SELECT FirstName, LastName FROM tblStaff

The answer is not case sensitive


Ensure you have one space after any ',' comma's
Ensure no spaces are before any ',' comma's
Ensure you put a space before and after operators such as an '=' equil sign.

Question 4 options:

Question 5 (1 point)

Refer to the design of the table tblInventory below:


tblInventory
ID_Inv
ProductName
UnitPrice
Quantity
Complete the query below (without re-writing what is given) so you show the results for products with a unit
price of more than $10 and less than or equil to $20.
SELECT ProductName, UnitPrice, Quantity FROM tblStaff
The answer is not case sensitive
Ensure you have one space after any ',' comma's
Ensure no spaces are before any ',' comma's
Ensure you put a space before and after operators such as an '=' equil sign, or '>='

Question 5 options:

Complete the following SQL Statement so that tblStaff and tblDepartments are Joined together using
ID_Dept which exists in both tables as the relationship.
SELECT *
FROM tblStaff

Question 7 (1 point)

Question 7 options:
Fill in the blanks to define the following aliases and complete the SQL statement.
From the table products, the unit price alias must be ProdPrice
From the table order details the unit price must be OrderPrice
You may use either of the two methods.
SELECT Products.UnitPrice

.UnitPrice

Save

Question 1 (1 point)

Question 1 options:
Fill in the blanks to complete the select statement that will return records where the first first name starts
with an "E".
SELECT * FROM tblStaff WHERE StaffName

Question 2 (1 point)

Question 2 options:
Fill in the blanks to complete the SQL statement to return staff names that contain an e or and i.
Make sure your first condition is for names that contain an e, your second condition is for names that
contain an i.
SELECT * FROM tblStaff WHERE StaffName

StaffName

Question 3 (1 point)

Question 3 options:

Write a SQL statement that will add Ryan Ginger who is CEO to the following table.
tblStaff

ID_Staff

PK int (Identity Specification Configured)

FirstName

varchar(50)

Surname

varchar(50)

Title

varchar(50)

Formatting rules:
Ensure you specify your values in order of this table. Auto grading will not catch values set in any
other order.
Leave a single space before and after any '='
Leave a single space after any ',' but not before.
Spelling counts.

Question 4 (1 point)

Write a SQL Statement that will change Bill Smith's name to Will Smith. Use good practice when doing so.
tblStaff

ID_Staff

StaffName
1

George Brown

Bill Smith

Sammy Joe

Ryan Ginger

Formatting rules:
1.

Leave a single space before and after any '='

2.

Leave a single space after any ',' but not before.

3.

Spelling counts.

Question 4 options:

Question 5 (1 point)

Your staff office have relocated, write a SQL statement that will update everyone's office from Toronto to
London.
tblLocation

ID_Location

ID_Staff

Province

City

ON

TORONTO

ON

TORONTO

ON

Edmonton

ON

TORONTO

ON

Oakville

Formatting rules:
1.

Leave a single space before and after any '='

2.

Leave a single space after any ',' but not before.

3.

Spelling counts.

Question 5 options:

Question 6 (1 point)

Write a SQL statement that will remove George Smith from the table below. Use good practice when doing
so.
tblStaff

ID_Staff

StaffName

Bob Henderson

Ryan Ginger

Sharon Stone

George Smith

Tony Tiger

Formatting rules:
1.

Leave a single space before and after any '='

2.

Leave a single space after any ',' but not before.

3.

Spelling counts.

Question 6 options:

Das könnte Ihnen auch gefallen