Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE TABLE EMPLOYEE ( EMP_ID INT NOT NULL, EMP_NAME VARCHAR(50) NOT NULL, EMP_ADDRESS VARCHAR(50) NOT NULL, EMP_SALARY INT NOT NULL, EMP_GENDER VARCHAR(50) NOT NULL, PRIMARY

CREATE TABLE EMPLOYEE (

EMP_ID INT NOT NULL,

EMP_NAME VARCHAR(50) NOT NULL,

EMP_ADDRESS VARCHAR(50) NOT NULL,

EMP_SALARY INT NOT NULL,

EMP_GENDER VARCHAR(50) NOT NULL,

PRIMARY KEY (EMP_ID)

);

CREATE TABLE FOOD (

FOOD_ID INT NOT NULL,

FOOD_NAME VARCHAR(50) NOT NULL,

FOOD_PRICE INT NOT NULL,

FOOD_QUANTITY INT NOT NULL,

PRIMARY KEY (FOOD_ID)

);

CREATE TABLE SKILL (

SKILL_ID INT NOT NULL,

SKILL_NAME VARCHAR(50) NOT NULL,

SKILL_DESCRIPTION VARCHAR(50) NOT NULL,

PRIMARY KEY (SKILL_ID)

);

CREATE TABLE STOCK (

STOCK_ID INT NOT NULL,

STOCK_NAME VARCHAR(50) NOT NULL,

CONTACT_NUMBER INT NOT NULL,

PRIMARY KEY (STOCK_ID)

);

CREATE TABLE INGREDIENT (

ING_ID INT NOT NULL,

ING_ITEM VARCHAR(50) NOT NULL,

PRIMARY KEY (ING_ID)

);

CREATE TABLE CUSTOMER (

CUST_ID INT NOT NULL,

CUST_NAME VARCHAR(50) NOT NULL,

CUST_PHONE INT NOT NULL,

EMP_ID INT NOT NULL,

PRIMARY KEY (CUST_ID),

FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE(EMP_ID)

);

CREATE TABLE STORE (

STORE_ID INT NOT NULL,

STORE_TYPE VARCHAR(50) NOT NULL,

ING_ID INT NOT NULL,

PRIMARY KEY (STORE_ID),

FOREIGN KEY (ING_ID) REFERENCES INGREDIENT(ING_ID)

);

CREATE TABLE INVOICE (

INV_ID INT NOT NULL,

INV_DATE VARCHAR(50) NOT NULL,

CUST_ID INT NOT NULL,

FOOD_ID INT NOT NULL,

PRIMARY KEY (INV_ID),

FOREIGN KEY (CUST_ID) REFERENCES CUSTOMER(CUST_ID),

FOREIGN KEY (FOOD_ID) REFERENCES FOOD(FOOD_ID)

);

CREATE TABLE EMPLOYEEPRODUCE (

EMP_ID INT NOT NULL,

FOOD_ID INT NOT NULL,

PRIMARY KEY (EMP_ID, FOOD_ID),

FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE(EMP_ID),

FOREIGN KEY (FOOD_ID) REFERENCES FOOD(FOOD_ID)

);

CREATE TABLE EMPLOYEELEARN (

EMP_ID INT NOT NULL,

SKILL_ID INT NOT NULL,

PRIMARY KEY (EMP_ID, SKILL_ID),

FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE(EMP_ID),

FOREIGN KEY (SKILL_ID) REFERENCES SKILL(SKILL_ID)

);

CREATE TABLE STOREKEEP (

STOCK_ID INT NOT NULL,

STORE_ID INT NOT NULL,

PRIMARY KEY (STOCK_ID, STORE_ID),

FOREIGN KEY (STOCK_ID) REFERENCES STOCK(STOCK_ID),

FOREIGN KEY (STORE_ID) REFERENCES STORE(STORE_ID)

);

CREATE TABLE EMPLOYEECOUNT (

EMP_ID INT NOT NULL,

STOCK_ID INT NOT NULL,

PRIMARY KEY (EMP_ID, STOCK_ID),

FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE(EMP_ID),

FOREIGN KEY (STOCK_ID) REFERENCES STOCK(STOCK_ID)

);

BASED FROM CREATE TABLE ABOVE, PLEASE DO ALL OF 10.2 AND DO AS INSTRUCTION:

image text in transcribed

0.2. Section B: Data Manipulation Language (DML) The SELECT statements for ALL TABLES which displayed minimum of 10 records for appropriate tables. Describes the queries which consist of the: 1) questions, 2) MySQL SQL command languages and 3)output.. - Queries for each lab topic: Retrieving Data from Multiple Tables (Joining Database Tables) which at least 5 queries. *Simple SQL Queries (SELECT, WHERE, ORDER BY, DISTINCT) which at least 5 queries.: - Comparison Operators (=,,==,,) - Logical Operators (AND, OR NOT) - Special Operators (BETWEEN, LIKE, IS NULL, IN, DISTINCT) Column Functions and Grouping (SUM, AVG, MIN, MAX, COUNT (), COUNT (DISTINCT), GROUP BY, HAVING, ORDER BY) - at least 3 queries Using Subqueries (WHERE, HAVING, IN) - at least 3 queries

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

You have

Answered: 1 week ago