Exam Opt1
Exam Opt1
For the following requests, print out respectively the screenshots to show test data (the table
data that you create to test each query), the query results, and pack them into the zip file
BasicTech_SQL_FinalTest_AccountName.zip along with your answers, then handle to the
evaluator via email ([email protected])
Barem: Q1: 4. Q2-5: 1.5
You work as a Database Developer for a Global mart. The mart is going to design their own
database. ERD for the future database as below:
Vendor has:
- VendorName: Name of vendor. It should be a string in any language. It cannot be NULL.
- Phone: Cannot be NULL.
- Website.
Product has:
- ProductName: Name of the product. It should be a string in any language. It cannot be
NULL.
- Description: It should be a string in any language
- RetailPrice:
- WholeSalePrice
Q1. Create a database called BasicTech_SQL_FinalTest, then
- Create the tables with the most appropriate column constraints & types. Primary Key of
each table must be INT and auto incremental.
- Add at least 4 records for Department, and at least 10 records for Employee, Vendor,
Product, Timesheet table.
Q2. Writes a query to list out all employee who has HourlyWage less than Hourlywage
average, showing FirstName, LastName, SSN and HourlyWage.
Q3. Specify the departments which have >=3 employees.
Q4. Print out total working hours for each month of 2006. Sort the result descending base on
month.
Q5. Delete managers who has HourlyWage more than 100.