Table 2: Customer
Table 3: Sales
person
Table 4: InventoryInventory-InventoryID_Number
-Description
-Completion_Date
-Unit_Cost
-Unit_Price
-Sale_Numuber
Sales-Sale_Number
-Sale_Date
-Sale_Amount
-Payment_Type
-Salesperson
_Number
-Customer-Number
Customer-Customer_Number
-Customer_First_Name
-Customer_Last_Name
-Customer_Address
-Customer_City
-Customer_State
-Customer_Zip
-Customer_Email
Salesperson-Salesperson_Number
-Salesperson_First_Name
-Salesperson_Last_Name
-Salesperson_SSN
1.
.11.
.11..*0..*
1..* 0..1
1)
In the partial data model above, identify primary key (
PK) and foreign key(s)(FK) in each table.
2)
Create tables
in the database.
3)
Input two records in the sales table, customer table, and salesperson table in your database. Please note it is better to input the records
for the customers and salesperson first (p.115, Appendix A)
To be submitted:
Please submit your assignment in
WORD
file. Put your screen shot in a WORD file, clearly label your screenshot such as “Question 1, Step 1
screenshot”. Put the homework title, your section, and your name in the Title of
the file and name the file the same way “HWTitle_01-
JamesBond”. Use your name and section number as the header in the Word file, such as “01_JamesBond”. Insert page numbers. Points will be
deducted if not following the instructions and you will receive a 0 if not submitted in a WORD file.
PC users:
Follow book example p97-104 to build a database using Access. I also assigned the Videos on Connect (Chapter 4 Access Video, not graded) that
you can watch. Or my video on Canvas.
1. Screenshot of the design view
of the tables :
Customer and Sales
. Please include both top and bottom of your screen in the screenshots.
2. Screenshot of your “
Relationships
” tab
3.
Screenshot of your “datasheet” view of the records
you put in the customer, salesperson, and sales tables. Make sure you put your
name as one of the records in “salesperson” table or “customer “ table.
Mac Users:
We will use SQL to build the database. The software we will use is
SQLite studio
. See a separate WORD file on Canvas “Instructions
for Downloading SQLite Studio_DB”.
1Important! You need to download the SQLite Studio in your computer before watching the video. The link here has some tutorials
for beginners.
https://digitalfellows.commons.gc.cuny.edu/2016/04/08/fun-times-with-sqlite-or-a-beginners-tutorial-to-data-management-and-
databases-with-sql/#:~:text=To%20create%20a%20database%2C%20click,to%20create%20a%20new%20database.
1 Thanks to Professor Rebecca Perols for sharing the instruction file.
1. Screenshot of the structure view
of ALL
tables2. Screenshot of your “data” view of the records
you put in the customer, salesperson, and sales tables. Make sure you put your name as
one of the records in “salesperson” table or “customer” table.
To do this, we will need to use “Command” in SQlite Studio.
Note: when you create a new database, you need to save it to a local folder in your desktop to make it work. Then click “view” on
the top to check “database” so that the newly created database will be shown on your screen.
CREATE TABLE
Customer(customer_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
customer_first_name,
Customer_last_name,
customer zip
);
Database HW#1
Purpose: Use Microsoft Access (for PC users) or SQlite Studio (Mac and PC users) to build a simple database for Steve’s Stylin Sunglasses (SSS).
Required:
Build a simple relational database based on the data model (p. 95, Figure 4-2).
Required tables in your database are as follows. Also You must include the attributes that you identify as primary key or foreign keys in your
table. Other attributes in each table are at your discretion to include in your database or not.
Table 1: Sales
Table 2: Customer
Table 3: Salesperson
Table 4: Inventory
Salesperson
1..1
Sales
Inventory
-InventoryID_Number
-Description
-Completion_Date
-Unit_Cost
-Unit_Price
-Sale_Numuber
-Salesperson_Number
-Salesperson_First_Name
-Salesperson_Last_Name
-Salesperson_SSN
1..*
0..1
-Sale_Number
-Sale_Date
-Sale_Amount
-Payment_Type
-Salesperson_Number
-Customer-Number
0..*
1..*
Customer
1..1
-Customer_Number
-Customer_First_Name
-Customer_Last_Name
-Customer_Address
-Customer_City
-Customer_State
-Customer_Zip
-Customer_Email
1) In the partial data model above, identify primary key (PK) and foreign key(s)(FK) in each table.
2) Create tables in the database.
3) Input two records in the sales table, customer table, and salesperson table in your database. Please note it is better to input the records
for the customers and salesperson first (p.115, Appendix A)
To be submitted:
Please submit your assignment in WORD file. Put your screen shot in a WORD file, clearly label your screenshot such as “Question 1, Step 1
screenshot”. Put the homework title, your section, and your name in the Title of the file and name the file the same way “HWTitle_01JamesBond”. Use your name and section number as the header in the Word file, such as “01_JamesBond”. Insert page numbers. Points will be
deducted if not following the instructions and you will receive a 0 if not submitted in a WORD file.
PC users:
Follow book example p97-104 to build a database using Access. I also assigned the Videos on Connect (Chapter 4 Access Video, not graded) that
you can watch. Or my video on Canvas.
1. Screenshot of the design view of the tables : Customer and Sales. Please include both top and bottom of your screen in the screenshots.
2. Screenshot of your “Relationships” tab
3. Screenshot of your “datasheet” view of the records you put in the customer, salesperson, and sales tables. Make sure you put your
name as one of the records in “salesperson” table or “customer “ table.
Mac Users:
We will use SQL to build the database. The software we will use is SQLite studio. See a separate WORD file on Canvas “Instructions
for Downloading SQLite Studio_DB”. 1
Important! You need to download the SQLite Studio in your computer before watching the video. The link here has some tutorials
for beginners.
https://digitalfellows.commons.gc.cuny.edu/2016/04/08/fun-times-with-sqlite-or-a-beginners-tutorial-to-data-management-anddatabases-with-sql/#:~:text=To%20create%20a%20database%2C%20click,to%20create%20a%20new%20database.
1
Thanks to Professor Rebecca Perols for sharing the instruction file.
1. Screenshot of the structure view of ALL tables
2. Screenshot of your “data” view of the records you put in the customer, salesperson, and sales tables. Make sure you put your name as
one of the records in “salesperson” table or “customer” table.
To do this, we will need to use “Command” in SQlite Studio.
Note: when you create a new database, you need to save it to a local folder in your desktop to make it work. Then click “view” on
the top to check “database” so that the newly created database will be shown on your screen.
CREATE TABLE Customer
(
customer_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
customer_first_name,
Customer_last_name,
customer zip
);