Data and database management with sql

 

 Data and Database Management with SQL

Module 2

Assignment 1

Purpose

For this assignment, we will simulate the creation of a variety of tables with various attributes. The key to a successful grade on this assignment is the appropriate structure and data types for each attribute. Make sure you pay attention to the information given and choose the data type that BEST meets the client requirements and provides for data validation. Please include the attributes as they appear below (do not add or remove attributes). Follow the instructions and specifications provided. Note: Constraints are not required in this assignment.

Submission

You will submit a total of 2 sql files to CodeGrade. Files should be named appropriately and be in .sql format. Each file must use the postgres standards taught in the course. Ensure your CREATE TABLE statements run together in pgAdmin prior to submission. Use of other SQL languages such as T-SQL will result in an automatic 0 for the assignment. You will have one submission attempt for this assignment.

  • File 1: You must submit a SQL document called <LastName>_Assignment1_APU.  This document must include ALL commands required to create the database and tables for the client Auto Parts Unlimited.
  • File 2: You must submit a SQL document called <LastName>_Assignment1_HG.  This document must include ALL commands required to create the database and tables for the client Holy Grounds
  • You will submit both files to the Assignment 1 link to CodeGrade. Failure to include both files will result in loss of credit for any missing information as specified in the rubric. 

Instructions

As in the practice assignment, you will be working for a company that creates and maintains databases for small business customers. The company has taken on two new clients that you will need to set up with their own databases. Note that since these are two separate databases, you ARE allowed to repeat the names of tables and attributes (for example, both companies have an inventory table. Both tables can be called inventory since they are in different databases). It is encouraged that if you have questions or difficulties with any portion of this assignment that you utilize the discussion board or GAs to gain clarity.  

PART 1 (File 1)

The first client is a local auto parts company called “Auto Parts Unlimited”. Complete the following steps for this client:

  1. Create a database called “auto_parts_unlimited”
  2. Connect to the database
  3. Create the following 3 tables based on the client’s requirements:
    1. Customers: Each customer has the following:
      1. A unique numeric ID assigned automatically when their record is created (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. First name
      3. Last name
      4. Phone number: format (xxx) xxx-xxxx
      5. Email
      6. Street Address: Includes street number and name
      7. Zip: 5 Digit zip code
      8. State: Must be a two letter abbreviation, does NOT have to be from a prepopulated list
    2. Employees:
      1. A unique numeric ID assigned automatically when an employee is hired (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. The same attributes as a customer plus:
        1. A hire date
        2. A salary amount
        3. A probationary status: Can only be one of two values. Either an employee is still probationary (less than 1 year working for the company) or not. 
    3. Parts Inventory:
      1. A unique alphanumeric part number (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. A manufacturer name
      3. A quantity in stock
      4. A price
      5. A backordered status: Only two values, either an item is backordered or not.

***************************ASSIGNMENT CONTINUED ON NEXT PAGE****************************

Part 2 (File 2)

The second client is a local coffee shop / bakery called “Holy Grounds”. Complete the following steps for this client:

  1. Create a database called “holy_grounds”
  2. Connect to the database
  3. Create the following tables:
    1. Coffee Inventory: represents all items in inventory. 
      1. Unique alphanumeric SKU (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. Name
      3. Type of roast: Dark, Medium, Light ****(see note below)
      4. Pounds on Hand: Total pounds of coffee on hand (can be fractional)
      5. Organic: Only 2 values, either organic or not
      6. Low Acid: Only 2 values, either low acid or not
      7. Price per lb
    2. Sales Transaction: represents either an online or in-store purchase
      1. Unique receipt ID: A number automatically assigned when a transaction is made. While this is a smaller company, they do have multiple locations and online sales. They complete a total of approximately 250 million transactions a year between these different revenue streams. Make sure you choose a data type that represents whole values with plenty of room to expand as this client likes to keep receipt records for multiple years. (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. Sale amount
      3. Sale type: Online or In-Store****(see note below)
      4. Transaction Date: Date and time a transaction occurs
    3. Store: represents a physical location where coffee is sold
      1. Store ID: a unique numeric identifier automatically assigned when each store is launched (for this assignment you do not need to add a constraint to enforce uniqueness)
      2. Store Manager: First and last name of store manager. Make sure this value is long enough to include both first and last name with a space in between. 
      3. Store phone number: format (xxx) xxx-xxxx
      4. Street address: Street number and name 
      5. City
      6. Zip: 5 Digit zip code
      7. State: Must be a two letter abbreviation, does NOT have to be from a prepopulated list

ALLOWED DATA TYPES

The data types accepted for this assignment are found below. To read more about each data type listed, follow the link to the postgres documentation. Ensure you only use the bullet point data types listed below in this assignment! Also be sure to read about each data type to choose the best type for each attribute. 

NUMERIC DATA TYPES:

https://www.postgresql.org/docs/current/datatype-numeric.html

  • Decimal(precision,scale)
  • Numeric(precision,scale)
  • Integer
  • Serial/Big Serial

MONETARY DATA TYPES:

https://www.postgresql.org/docs/current/datatype-money.html

CHARACTER DATA TYPES:

https://www.postgresql.org/docs/current/datatype-character.html

*Must specify length of field (n). Ensure you have enough characters to accommodate. Know difference of when to use char vs. varchar.

DATE/TIME DATA TYPES:

https://www.postgresql.org/docs/current/datatype-datetime.html

BOOLEAN DATA TYPES:

https://www.postgresql.org/docs/current/datatype-boolean.html

*******************************GRADING RUBRIC ON NEXT PAGE*********************************

This assignment will be graded on the following rubric:

Item

Points

Database Creation Statements (2)

10

Table Creation Statements (6)

Run in entirety without error

10

Below are the specific point values for attributes by tables. Note that credit is awarded for appropriate definition and data type. Failure to use a data type that does not meet the client requirements and meet data validation needs will result in loss of points for that attribute. Some attributes are weighted more than others because of their difficulty.

Auto Parts Unlimited

Customers: Customer ID

5

Employees: Employee ID

5

Employees: Probationary Status

5

Parts Inventory: Part Number

5

Parts Inventory: Quantity

5

Holy Grounds

Coffee Inventory: Organic

5

Coffee Inventory: Low Acid

5

Sales Transaction: Receipt ID

5

Store: Store ID

5

ALL OTHER ATTRIBUTES (2 points each)

35

Total

100

Bonus

5

Max

105

University Writings
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.