USE SQL CODES to answer. What I have so far..... CREATE TABLE Customer_T (CustomerID int NOT NULL, CustomerName nVARCHAR

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

USE SQL CODES to answer. What I have so far..... CREATE TABLE Customer_T (CustomerID int NOT NULL, CustomerName nVARCHAR

Post by answerhappygod »

USE SQL CODES to answer.
Use Sql Codes To Answer What I Have So Far Create Table Customer T Customerid Int Not Null Customername Nvarchar 1
Use Sql Codes To Answer What I Have So Far Create Table Customer T Customerid Int Not Null Customername Nvarchar 1 (33.35 KiB) Viewed 26 times
What I have so far.....
CREATE TABLE Customer_T
(CustomerID int NOT NULL,
CustomerName nVARCHAR(25) NOT NULL,
CustomerAddress nVARCHAR(30),
CustomerCity nVARCHAR(20),
CustomerState CHAR(2),
CustomerPostalCode nVARCHAR(30),
CONSTRAINT Customer_PK PRIMARY KEY (CustomerID));
CREATE TABLE Order_T
(OrderID int NOT NULL,
OrderDate DATE DEFAULT GETDATE(),
CustomerID int,
CONSTRAINT Order_PK PRIMARY KEY (OrderID),
CONSTRAINT Order_FK FOREIGN KEY (CustomerID) REFERENCES
Customer_T(CustomerID));
CREATE TABLE Product_T
(ProductID int NOT NULL,
ProductDescription nVARCHAR(100),
ProductFinish nVARCHAR(20),
/*CHECK (ProductFinish IN ('Cherry', 'Natural Ash', 'White
Ash',
'Red Oak', 'Natural Oak', 'Walnut')), */
ProductStandardPrice DECIMAL(6,2),
ProductLineID INTEGER,
CONSTRAINT Product_PK PRIMARY KEY (ProductID));
CREATE TABLE OrderLine_T
(OrderID INTEGER NOT NULL,
ProductID INTEGER NOT NULL,
OrderedQuantity INTEGER,
CONSTRAINT OrderLine_PK PRIMARY KEY (OrderID, ProductID),
CONSTRAINT OrderLine_FK1 FOREIGN KEY (OrderID) REFERENCES
Order_T(OrderID),
CONSTRAINT OrderLine_FK2 FOREIGN KEY (ProductID) REFERENCES
Product_T(ProductID));
PLEASE ANSWER
3.1. For each product in an order, what is the order ID, order
date, product ID and product Description?
Code:
3.2. List all orders (orderID and orderDate) and product
information (productid, ProductDescription) related to these
orders.
Code:
3.3. List all products (productid, ProductDescription) and order
information (orderID and orderDate) these products belong to.
Code:
CUSTOMER Customer CustomerName Customer Address Customer ay CustomerState CustomerPostal Code ORDER Order Order Date Customer ORDER LINE Order Product Ordered Quantity PRODUCT Product Product Description ProducFrith Product Standard Price ProductLineID
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply