Professional Documents
Culture Documents
Assignment 1 - SELECT
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.
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
SELECT 128
-- 2. question 2 text….
SELECT field
FROM table
-- etc.
Tasks:
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".
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.