Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

nees help answering questions 1-4. Using Microsoft Server SQL 2017 1. (Screen sh

ID: 3920442 • Letter: N

Question

nees help answering questions 1-4. Using Microsoft Server SQL 2017

1. (Screen shot Create the tables and appropriate constraints based on the following ER diagram. Use appropriate data types and sizes (see Chapter 8). The database is for a family-owned restaurant. 2. a. Note that the serving Temperature column should only accept the letters H, C, or W (for Hot, Cold, Warm). b. The price column should only have values greater than zero c. All columns in both tables are required d. The CID and PID columns should have the IDENTITY property. e. Show the code in two separate screen shots, one for each table. Category CID Description Product PID CID (ik) Price Temperature (H/C/w) 3. (Screen shot.) Create a non-clustered index on the foreign key of the Product table 4. (Screen shot.) Modify the Product table to add a column named Gluten Free that allows only 1 letter. Include a 5. Demonstrate that you did the following (use a SELECT statement to show the records in the table): check to make sure the value is a Y or N. Make the default value of the column N a. (Screen shot) Insert 3 rows in the Category table i. Appetizer ii. Entree ii. Dessert b. (Screen shot(s)) Insert 3 Product records for each category in the product table. i. Bananas Foster, Dessert category. $6.99, Hot, Y i. Molten Lava Cake, Dessert category, $5.99, Warm, N ili. Key Lime Pie, Dessert category, $4.50, Cold, N iv. Ribeye Steak, Entree category, $16.99, Hot, Y v. Chef Salad, Entree category, $8.99, Cold, Y vi, Fettuccini Alfredo, Entree category, $12.99, Warm, N

Explanation / Answer

If you have any doubts, please give me comment...

-- 1)

CREATE DATABASE ANUNAGA;

-- 2)

CREATE TABLE Category(

CID NUMBER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),

Description VARCHAR2(50)

);

CREATE TABLE Product(

PID NUMBER GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),

Description VARCHAR2(50),

CID NUMBER,

Price NUMBER(5,2),

Temperature CHAR(1),

FOREIGN KEY(CID) REFERENCES Category(CID)

);

-- 3)

CREATE NONCLUSTERED INDEX CID ON Product ASC;

--4)

ALTER TABLE Product ADD [Gluten Free] CHAR(1) CHECK [Gluten Free] IN('Y', 'N') DEFAULT 'N';