Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL code is below. Cannot figure out why my question 2 will not compile. Keep getting the error saying Msg 206, Level 16, State 2,

SQL code is below. Cannot figure out why my question 2 will not compile. Keep getting the error saying Msg 206, Level 16, State 2, Line 70 Operand type clash: date is incompatible with int Please assist. Thank You!

The question is Show order date, and first name and last name of customers who make the order

/* Question 1 */ Create TABLE CUSTOMERS ( CustomerID INT PRIMARY KEY, CustFirstName VARCHAR(50) NOT NULL, CustLastName VARCHAR(50) NOT NULL, CustStreetAddress VARCHAR(50) NOT NULL, CustCity VARCHAR(50) NOT NULL, CustState VARCHAR(26) NOT NULL, CustZipCode INT NOT NULL, CustAreaCode INT NOT NULL, CustPhoneNumber VARCHAR (26) NOT NULL); Create TABLE EMPLOYEES ( EmployeeID INT PRIMARY KEY, EmpFirstName VARCHAR(50) NOT NULL, EmpLastName VARCHAR(50) NOT NULL, EmpCity VARCHAR (50) NOT NULL, EmpState VARCHAR(26) NOT NULL, EmpZipCode INT NOT NULL, EmpAreaCode INT NOT NULL, EmpPhoneNumber VARCHAR(26) NOT NULL, EmpBirthDate DATE NOT NULL); CREATE TABLE ORDERS( OrderNumber Int primary key, OrderDate DATE NOT NULL, ShipDate Date not null, CustomerID INT not null, EmployeeID INT not null, FOREIGN KEY(EmployeeID) REFERENCES EMPLOYEES(EmployeeID), FOREIGN KEY(CustomerID) REFERENCES CUSTOMERS(CustomerID)); CREATE TABLE CATEGORIES( CategoryID INT PRIMARY KEY, CategoryDescription VARCHAR(255) NOT NULL); create TABLE PRODUCTS( ProductNumber INT primary key, ProductName VARCHAR(50) not null, ProductDescription varchar(255) not null, RetailPrice INT NOT NULL, QuantityOnHand INT not null, CategoryID INT not null, FOREIGN KEY(CategoryID) REFERENCES CATEGORIES (CategoryID)); CREATE TABLE ORDER_DETAILS( OrderNumber INT not null, ProductNumber INT not null, QuotedPrice INT Not null, QuantityOrdered INT not null, PRIMARY KEY (OrderNumber, ProductNumber), FOREIGN KEY (OrderNumber) REFERENCES ORDERS(OrderNumber), FOREIGN KEY(ProductNumber) REFERENCES PRODUCTS(ProductNumber)); CREATE TABLE VENDORS( VendorID INT PRIMARY KEY, VendName VARCHAR(100) NOT NULL, VendStreetAddress VARCHAR(50) NOT NULL, VendCity VARCHAR(50) NOT NULL, VendState varchar(26) NOT NULL, VendFaxNumber VARCHAR(50) NOT NULL, VendWebPage VARCHAR(100) NOT NULL, VendEmailAddress VARCHAR(100) NOT NULL); CREATE TABLE PRODUCT_VENDORS( ProductNumber INT NOT NULL, VendorID INT NOT NULL, WholeSalePrice int not null, DaysToDeliver INT NOT NULL, PRIMARY KEY(ProductNumber, VendorID), FOREIGN KEY(ProductNumber) REFERENCES PRODUCTS(ProductNumber), FOREIGN KEY(VendorID) REFERENCES Vendors(VendorID)); /* QUESTION 2 */ SELECT OrderDate, CustFirstName, CustLastName FROM CUSTOMERS C, ORDERS O WHERE C.CustomerID = O.OrderDate; 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago