Steps of Your Assignment Use SQL Server to build a database . The database name
ID: 663199 • Letter: S
Question
Steps of Your Assignment
Use SQL Server to build a database. The database name should be your Company_lastName where lastName is your last name.
Create each of the following tables:
*Call
*Customer
*Department
*Employee
*Product
Populate the tables with at least four records in each table (three for the Department table). Make-up your own data to populate the tables based on your company information. Data should be selected to demonstrate the required outputs outlined in the queries.
Use an identity column for the primary key in each table, except for the tables created from the associative entities.
Implement the referential integrity (foreign key) constraints. Remember that the data type must be the same between a foreign key and its associated primary key. It is not necessary to implement any other constraints or indexes.
Create the following queries. Name of query is given in ( ) at beginning of query.
(AllProducts) List all products in inventory. For each product, list number, name, location, and quantity on hand. Sort entries in order by location.
(SalesStaff) List name (last, first), job title, office and phone for all sales staff personnel. (Sales Department)
(CallInfo) For each call, list the description, product name, customer last name and employee last name.
(ProductSupport) For each product, list product number and number of customer support calls received. List ALL product numbers, even if the product did not have any support calls. (Outer Join)
(CustomerCredit) List all customers who have a balance greater than their credit limit. For each customer, list customer ID, last name, and amount over credit limit. (Use an alias for this field)
Queries must be saved as stored procedures. See The Database Implementation Instructions document (referenced above) for directions on how to save queries as stored procedures.
Explanation / Answer
CREATE TABLE STATION
(ID INTEGER PRIMARY KEY,
CITY CHAR(20),
STATE CHAR(2),
LAT_N REAL,
LONG_W REAL)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.