1
answer
0
watching
209
views

SQL Server

TASK

Is you will need to formalize the database design and use a DBMS (SQL Server, MySQL, etc) to build the database. You will NOT be required to build all the functionality as described above as part of this initial project. You will be responsible only for specific parts of the system and implementing specific features as described below. You should complete the following steps:
1. Analyze the data requirements described in the previous section. Decide which tables are required and which fields should go in which table. Normalize your design. If you wish, you may use an entity-relationship diagram. Create a table design showing the relationships between each table.
It is now time for your instructor to check your progress. After you have finished the preliminary design for the High Spirits Imports Management System, contact your instructor for a brief review.
2. Using your DBMS, create an SQL script to create the High Spirits database. Name the database HSxxxxx, where xxxxx is your student number. Save your script as step2.sql.
3. Create the tables in the HighSpirits database. You do not need to specify relationships in this script. Save your script as step3.sql.
4. Create a default database diagram. Add primary keys and relationships where they make sense. Print your diagram. Create a script that will add the necessary primary keys and foreign keys to the appropriate tables. Save your script as step4.sql.
5. Create a script that will create the needed constraints to enforce the data rules Mr. Tipple has specified. Save your script as step5.sql.
6. Using the provided source documents (see pictures 1 - 5 or download pdf file) populate your database with test data. Minimally, you need:

---->>> url for the pdf file


 4 customers (include High Spirits as a customer so you can track purchase transactions).
 5 transactions - at least 3 are sales type, 2 of which must be paid.
 4 countries, types and sizes
 6 products, each with a quantity specified
Save your script as step6.sql
7. Create a script that will show a list of customers (first name, last name, and phone number) and the total number of sales transactions they have made. Save your script as step7.sql. After running the script, save a screen capture of the output and save it as step7-output.jpg

8. Create a script that will show a list of products (product name, type, size) that have been purchased. Note: You must use an outer join for this query; a subquery is not acceptable. Save your script as step8.sql. After running the script, save a screen capture of the output and save it as step8-output.jpg
9. Create a script that will show a list of products (product name, type, size, supplier) that are from Australia. Save your script as step9.sql. After running the script, save a screen capture of the output and save it as step9-output.jpg
10. Create a script that will show a list of products (product name, type, size, customer, retail price, quantity sold). The script should also calculate the sum of the price field and the sum of the quantity sold from all times the products were sold and display it as a calculated field. Do not include purchases (Remember the status field is set to 0 for sales and 1 for purchases). Save your script as step10.sql. After running the script, save a screen capture of the output and save it as step10-output.jpg
11. Using your DBMS Help feature, explore the use of the SHOW command to display the contents of your database. Create a script that will display a list of tables in the database. Save this script as step11a.sql. Then create a script for each of the four main tables (Customers, Transactions, Products, Transaction details that will display all of the columns in the table. Save your scripts as step11b.sql to step11e.sql.
12. Finally, you will need to create the HS_Employees database. Using the data in the HS-Employees.xls spreadsheet, create a script to populate the Employees database with the data found there. Employee ID's should be unique and start with the two employee initials and then increment by a value of 1. It should be the primary key. Social Insurance numbers are unique for each individual. However, this does not make for a good Primary Key. You must ensure that there is not the ability to incorrectly enter someone else's SI number by mistake by making this field unique. Create the employee database and populate the employees table with the data as indicated above. Save your scripts as step12.sql and step12a.sql

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Read by 1 person

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in