Question

MIS Corp is a mid tier company involved in the production and sales of home products....

MIS Corp is a mid tier company involved in the production and sales of home products. The

company wants to build a small database to maintain data about its customers and the products

it will sell to its customers. MIS also wants to keep information about what its customers were

buying in a Sales table.

The table definitions are as follows:

Customer [ CustID, LastName, FirstName, Address, City, State, Zip, Phone, Fax, Email]

Product [ ProdID, Description, Color, Size, Pack]

Sales [ TransID, CustID, ProdID, Price, Quantity, Amount]

Using SQL Server, create a database MIS310GRPXX. Write SQL statements and answer questions for this database as follows:

  1. Write SQL CREATE TABLE statements for each of the above tables.

  1. Write primary key - foreign key constraints for the relationships in each of these tables.
  1. Write SQL INSERT INTO statements to insert data into these tables – the sample files are provided in excel sheets
  2. Write SQL statements to list all columns for all tables. There will be 1 SQL statement for each of the 3 tables.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

This demonstration is using SQL Server.

--create database
create database MIS310GRPXX;

use MIS310GRPXX;--use database to create table

--1.Table Name :Customer
create table Customer(
CustID int primary key,
LastName varchar(50),
FirstName varchar(50),
Address varchar(50),
City varchar(50),
State varchar(50),
Zip varchar(10),
Phone varchar(10),
Fax varchar(50),
Email varchar(50));

--inserting records into customer table
insert into Customer values (1,'Fedrer','Roger','Swizerland','Paris','MH',
'456123','8899889988','7894561230','fedRoger@fg.com');

--selecting record
select * from customer;

Screen in SQL Server:

*************************************

--2.Table Name :Product
create table Product(
ProdID int primary key,
Description varchar(50),
Color varchar(50),
Size varchar(50),
Pack varchar(50));

--inserting records into Product table
insert into Product values (1,'Tennis Racket','White','4.5','10');

--selecting record
select * from Product;

Screen in SQL Server:

*************************************

--3.Table Name :Sales
Create table Sales(
TransID int primary key,
CustID int ,
ProdID int,
Price decimal(6,2),
Quantity int,
Amount decimal(6,2),
foreign key(CustID) references Customer (CustID),
foreign key(ProdID) references Product (ProdID)
);

--inserting records into Sales table
insert into Sales values (1,1,1,550.00,10,5500);

--selecting record
select * from Sales;

Screen in SQL Server:

*************************************

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
MIS Corp is a mid tier company involved in the production and sales of home products....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR...

    NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR FOREIGN etc Customer [ CustID, LastName, FirstName, Address, City, State, Zip, Phone, Fax, Email] Product [ ProdID, Description, Color, Size, Pack] Sales [ TransID, CustID, ProdID, Price, Quantity, Amount] Write SQL statement to produce a list of unique products and their prices from the Sales table. Please ensure that the products do not repeat. Write an SQL statement to list ProdID and Description for...

  • Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CUSTOMER (CustomerID,...

    Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CUSTOMER (CustomerID, LastName, FirstName, EmailAddress, EncyptedPassword, City, State, ZIP, Phone, ReferredBy) EMPLOYEE (EmployeeID, LastName, FirstName, Position, Supervisor, OfficePhone, EmailAddress) VENDOR (VendorID, CompanyName, ContactLastName, ContactFirstName, Address, City, State, ZIP, Phone, Fax, EmailAddress) ITEM (ItemID, ItemDescription, PurchaseDate, ItemCost, ItemPrice, VendorID) SALE (SaleID, CustomerID, EmployeeID, SaleDate, SubTotal, Tax, Total) SALE_ITEM (SaleID, SaleItemID, ItemID, ItemPrice) The referential integrity constraints are: ReferredBy in CUSTOMER must exist in CustomerID in CUSTOMER Supervisor...

  • SECTION B: SQL Data Manipulation Language 1. The following are parts of tables from customer sales...

    SECTION B: SQL Data Manipulation Language 1. The following are parts of tables from customer sales databases schema at the AWIE Sdn. Bhd. Company SALES CustID Date SaleAmount 2. Jun 2014 100.22 CUSTOMER CustID FirstName LastName DOB Phone 1 July 2014 909.95 어 1 John Smith 2/4/1968 012 222-2222 3 July 2014 522.95 2 Steven Goldfish 4/4/1974 013 455-4545 3 Dec 2014 100.00 3 Paula Brown 5/24/1978 017 323-3232 4 Smith 4 James 20/10/1980 010 323-8888 Dec 2014 555.55 a)...

  • Describe each questions: Explain why the object-oriented database model was developed. How does ...

    Describe each questions: Explain why the object-oriented database model was developed. How does the OID in the OO model differ from the primary key in the relational model? Is it possible for a superkey not to be a candidate key? Why or why not? Briefly describe the four types of binary relationships possible between an entity set A and an entity set B based on relationship cardinality. Sales Database: Customer(custId, lastName, firstName, address, phone, creditLimit) Order(orderNumber, date, total, custID) LineItem(orderNumber,...

  • Describe each questions: Explain why the object-oriented database model was developed. How does the OID in...

    Describe each questions: Explain why the object-oriented database model was developed. How does the OID in the OO model differ from the primary key in the relational model? Is it possible for a superkey not to be a candidate key? Why or why not? Briefly describe the four types of binary relationships possible between an entity set A and an entity set B based on relationship cardinality. Sales Database: Customer(custId, lastName, firstName, address, phone, creditLimit) Order(orderNumber, date, total, custID) LineItem(orderNumber, itemNumber,...

  • Tables: Create table Item(                 ItemId                 char(5) constraint itmid_unique primar

    Tables: Create table Item(                 ItemId                 char(5) constraint itmid_unique primary key,                 Decription           varchar2(30),                 Unitcost               number(7,2)); Create table Customer(                 custID                   char(5) constraint cid.unique primary key,                 custName          varchar2(20),                 address                                varchar2(50)); Create table Orderdata( orderID                char(5) constraint oid_uniq primary key,                 orderdate           date,                 shipdate              date,                 ItemId                  char(5) references Item.ItemId,                 No_of_items     number(4),                 Unitcost               number(7,2),                 Order_total        number(7,2),                 custID                   char(5) references customer.custID); Insert Into Item values(‘A123’,’Pencil’,2.5); Insert Into Item values(‘B123’,’Pen’,15); Insert Into...

  • SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT...

    SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT NULL, PRIMARY KEY (vid) ); CREATE TABLE category ( catid CHAR(2) NOT NULL, catname VARCHAR(25) NOT NULL, PRIMARY KEY (catid) ); CREATE TABLE product ( pid CHAR(3) NOT NULL, pname VARCHAR(25) NOT NULL, price NUMERIC (7,2) NOT NULL, vid CHAR(2) NOT NULL, categoryid CHAR(2) NOT NULL, PRIMARY KEY (pid)); CREATE TABLE region ( rid CHAR NOT NULL, rname VARCHAR(25) NOT NULL, PRIMARY KEY (rid)...

  • SQL: The schema name should be mxxws, where mxx is your MySQL user name. To refresh...

    SQL: The schema name should be mxxws, where mxx is your MySQL user name. To refresh your memory – here is the schema for that database: Create the rest of the contact management database by writing the statements that do each of the following items below. For each one: (1) execute them on your copy of the database, and (2) write the statements in the space: Statement to create the Contact table (one statement) Statement to create the Employee table...

  • In this hands-on project, you will create an application that allows the user to connect to...

    In this hands-on project, you will create an application that allows the user to connect to a database and query the database. Write a Java query application that allows the user to connect to the books database and query the books database. Provide the following predefined queries: Select all authors from the Authors table Select a specific author and list all books for that author. Include each book’s title, year and ISBN. Display the appropriate data for each query. Given...

  • Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys...

    Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys Exercise                                                                                In Lab 09, we will continue the practice of creating tables. You will need to write SQL statements for the tasks specified below. After you complete them, submit your SQL script (in one *.sql file) to Blackboard by 11:59pm Nov. 16 (Friday). Include your name as a comment in the SQL script submitted. The creation statement for each table is worth one point,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT