Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Tasks Find * in the database exam _ data _ 2 0 2 3 _ 0 5 _ 2 9 . txt: , ( 3
Tasks
Find in the database examdatatxt: points
the pair of products that generated the most revenue in the second quarter The solution is
view called'sell.
Itshouldlook'likef
Check if your data is in the seller table.
The table is in relation to the product table.
Who'sold the same products'atleast'one product with'You'in'your birthday month year and
The solution is a view 'called'sellers.
Create a tables as shown'in the picture and use write triggers for updates and for inserting data in
tables:
bank account Object: Table dboorder Script Date: ::
SET ANSINULLS ON
GO
SET QUOTEDIDENTIFIER ON
GO
CREATE TABLE dboorder
idorderint IDENTITY NOT NULL,
idproductint NULL,
ordervarchar NULL,
orderdatedate NULL,
CONSTRAINT PKorder PRIMARY KEY CLUSTERED
idorder ASC
WITH PADINDEX OFF, STATISTICSNORECOMPUTE OFF, IGNOREDUPKEY OFF, ALLOWROWLOCKS ON ALLOWPAGELOCKS ON OPTIMIZEFORSEQUENTIALKEY OFF ON PRIMARY
ON PRIMARY
GO
Object: Table dboproduct Script Date: ::
SET ANSINULLS ON
GO
SET QUOTEDIDENTIFIER ON
GO
CREATE TABLE dboproduct
idproductint IDENTITY NOT NULL,
productvarchar NULL,
pricefloat NULL,
CONSTRAINT PKproduct PRIMARY KEY CLUSTERED
idproduct ASC
WITH PADINDEX OFF, STATISTICSNORECOMPUTE OFF, IGNOREDUPKEY OFF, ALLOWROWLOCKS ON ALLOWPAGELOCKS ON OPTIMIZEFORSEQUENTIALKEY OFF ON PRIMARY
ON PRIMARY
GO
Object: Table dboproductsalesman Script Date: ::
SET ANSINULLS ON
GO
SET QUOTEDIDENTIFIER ON
GO
CREATE TABLE dboproductsalesman
idproductsalesmanint IDENTITY NOT NULL,
idsalesmanint NULL,
idproductint NULL,
CONSTRAINT PKproductsalesmannew PRIMARY KEY CLUSTERED
idproductsalesman ASC
WITH PADINDEX OFF, STATISTICSNORECOMPUTE OFF, IGNOREDUPKEY OFF, ALLOWROWLOCKS ON ALLOWPAGELOCKS ON OPTIMIZEFORSEQUENTIALKEY OFF ON PRIMARY
ON PRIMARY
GO
Object: Table dbosalesman Script Date: ::
SET ANSINULLS ON
GO
SET QUOTEDIDENTIFIER ON
GO
CREATE TABLE dbosalesman
idsalesmanint IDENTITY NOT NULL,
surnamenvarchar NULL,
namenvarchar NULL,
namenvarchar NULL,
idnvarchar NULL,
CONSTRAINT PKlist PRIMARY KEY CLUSTERED
idsalesman ASC
WITH PADINDEX OFF, STATISTICSNORECOMPUTE OFF, IGNOREDUPKEY OFF, ALLOWROWLOCKS ON ALLOWPAGELOCKS ON OPTIMIZEFORSEQUENTIALKEY OFF ON PRIMARY
ON PRIMARY
GO
SET IDENTITYINSERT dboorder ON
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO CASTN AS Date
INSERT dboorderidorderidproductorderorderdate VALUES N'SO
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started