Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer questions 9 and 10. thank you ..1 T-Mobile 1:24 AM 28% 62 .read Build-DB-SaleCo- ver1.sql LINE MIEH CUSTOMER ENCODE LENOVO ONLINE WR LINE

please answer questions 9 and 10. thank you
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
..1 T-Mobile 1:24 AM 28% 62 .read Build-DB-SaleCo- ver1.sql LINE MIEH CUSTOMER ENCODE LENOVO ONLINE WR LINE UN PODE GS BACODE CUS CUSCODE LEICE GUS SALE UPON OS ME # F.CODE VENDOR P_DISCOUNT OR VAME VRHOME H VOR V STAR DESCRIPTION HOME Submit Assignment Previous Next BED Dashboard Calendar To Do Notifications Inbox @ 45% T-Mobile 7:14 PM Back Assignment Details SQL 9. (5 pts) Find a listing of customers who did not make purchases during the invoicing period; sort by customer code. 10. (5 pts) Create a query to produce a summary of the value of products currently in inventory. Download two files: Build-DB-SaleCo- ver1.sg! (will create the database tables) and LoadRowsintoDBver1.sql (which will load the data into the tables). SQL Script: Run SQLite3 and at the sqlite prompt, enter the following command. Note that the Build script automatically calls the Load data script. sqlite>.read Build-DB-SaleCo- ver1.sql LINE GNOIR NUVEM LEMME IN CASADE w CH.DE LIENS COBE CUS, GLS BRACE CON H Submit Assignment Previous Next BED Dashboard Calendar To Do Notifications Inbox 30% Student .ll 1:26 AM AA dn.inst-fs-iad-prod.inscloudgate.net BEGIN TRANSACTION; CREATING TABLE STRUCTURES CREATE TABLE VENDOR ( V CODE INTEGER NOT NULL UNIQUE, V NAME VARCHAR( 35) NOT NULL, V CONTACT VARCHAR(15) NOT NULL, V_AREACODE CHAR(3) NOT NULL, V PHONE CHAR(8) NOT NULL, V STATE CHAR(2) NOT NULL, V_ORDER CHAR(1) NOT NULL, PRIMARY KEY (V_CODE)); CREATE TABLE PRODUCT ( P CODE VARCHAR(10) NOT NULL UNIQUE, P_DESCRIPT VARCHAR(35) NOT NULL, P INDATE DATETIME NOT NULL, P QOH SMALLINT NOT NULL, P MIN SMALLINT NOT NULL, P_PRICE NUMERIC(8,2) NOT NULL, P_DISCOUNT NUMERIC(4,2) NOT NULL, V CODE INTEGER, PRIMARY KEY (P_CODE), FOREIGN KEY (V_CODE) REFERENCES VENDOR (V_CODE)); === CONSTRAINTS, CHECKS and DEFAULTS CREATE TABLE CUSTOMER CUS_CODE INTEGER PRIMARY KEY, CUS LNAME VARCHAR(15) NOT NULL, CUS FNAME VARCHAR(15) NOT NULL, CUS_INITIAL CHAR(1), CUS_AREACODE CHAR(3) DEFAULT '615' NOT NULL, CUS PHONE CHAR(8) NOT NULL, CUS_BALANCE NUMERIC (9,2) DEFAULT 0.00, CONSTRAINT CUS_U11 UNIQUE (CUS_LNAME, CUS_FNAME)); CREATE TABLE INVOICE INV_NUMBER INTEGER PRIMARY KEY, CUS_CODE INTEGER NOT NULL, INV DATE DATETIME NOT NULL Student .il 1:27 AM 30% AA dn.inst-fs-iad-prod.inscloudgate.net www_covu *NADOMAN MUA NUN, INV DATE DATETIME NOT NULL, FOREIGN KEY (CUS_CODE ) REFERENCES CUSTOMER (CUS_CODE)); CREATE TABLE LINE ( INV NUMBER INTEGER NOT NULL, LINE NUMBER NUMERIC(2,0) NOT NULL, P_CODE VARCHAR(10) NOT NULL, LINE_UNITS NUMERIC(9,2) DEFAULT 0.00 NOT NULL, LINE_PRICE NUMERIC (9,2) DEFAULT 0.00 NOT NULL PRIMARY KEY (INV_NUMBER,LINE_NUMBER), FOREIGN KEY (INV_NUMBER) REFERENCES INVOICE (INV_NUMBER) ON DELETE CASCADE, FOREIGN KEY (P_CODE) REFERENCES PRODUCT (P_CODE), CONSTRAINT LINE_U11 UNIQUE (INV_NUMBER, P_CODE)); --======== INDEXES -- Q: Create index on P_INDATE CREATE INDEX P_INDATEX ON PRODUCT (P_INDATE); -- Q: Create composite index on V_CODE and P_CODE CREATE INDEX VENPRODX ON PRODUCT (V_CODE,P_CODE); --======== DATA ENTRY COMMIT; .read LoadRows IntoDBver1.sql --==== LOOK AT TABLES CREATED .print " Below are the tables that were created :" .print " ===== .tables .print " "

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago