You are on page 1of 2

MIS 315 – Management of Database Systems

Assignment 1 - SELECT

Due Date: Sept 6th, 2020 at 11:59 pm

Instruction:

All turned-in assignments should be submitted via Canvas. The online submission needs to have
your name and homework number as the file name. For example, Assignment 1 file for Minoo
Modares would be named as MinooModaresAssignment1.sql.

90 points: 10 SELECT statements worth 9 points each

 is it runnable SQL that will not throw an error? 3 points


 does it produce the right results? 3 points
 does it have the right/reasonable column headings? 3 points

10 points: formatting and readability

 You can add comments to your SQL by putting "--" (hyphen hyphen) at the beginning of
the line (you can also use the shortcut ctl+/ to comment out a block of code or
uncomment)
 To make grading easier, format the file like this. Points will be taken off if the SQL is hard
to read.

-- Minoo Modares

-- Assignment 1

-- 1. Show the number 128 in a one-row, one-column table using SELECT.

SELECT 128

-- 2. question 2 text….

SELECT field

FROM table

-- etc.
Tasks:

1. Show the number 12859 in a one-row, one-column table using SELECT.

2. Show the word "empathy" in a one-row, one-column table using SELECT. The column
should be named "A Word".

3. Show the SQRT (square root) of the number 8574 in a one-column, one-row table. The
column name should be "Square Root".

4. Show the result of this calculation in a one-row, one-column table: ((54.0*76.0)+7.0)/2.0.


Name the column "Calculation Result".

5. Find the SQRT of 7852416, and multiple it by the SQRT of 98756. Show the result in a one-
row, one-column table where the column is called "Calculation Result". Use a single SELECT
statement.

6. Combine the strings "James", “P.", and “Sullivan" with a space between them in a single-
row, single-column table using a single SELECT statement and + operators. This should be a
concatenation of five strings: "James", " ", "P.", " ", and “Sullivan". Name the column
"MonsterName".

7. Show a 3-column, 1 row table that has 875, "Boo", 857/25 in the columns. The columns
should be named "Number", "Name", and "Calculation Result".

8. Select the SupplierID and the CompanyName from the Suppliers table. Supplier ID should
be in the first column, company name in the second.

9. Select the OrderID, and 85% of the Freight from the Orders table. OrderID should be the
first column, and the second column should be named "Freight Charge for the Order".

10. Show all products' ProductID, ProductName, and the total value of units on order for each
product. The total value is the UnitsOnOrder multiplied by the UnitPrice. Rename the
columns appropriately.

You might also like