Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL QUESTION CREATE DATABASE DAVEINC; USE DAVEINC; CREATE TABLE EMPLOYEES (EMP_NUM DECIMAL(2,0), EMP_LAST CHAR(12), EMP_FIRST CHAR(10), ADDRESS VARCHAR (20), CITY CHAR (20), STATE CHAR (2),

SQL QUESTION

image text in transcribed

CREATE DATABASE DAVEINC;

USE DAVEINC;

CREATE TABLE EMPLOYEES (EMP_NUM DECIMAL(2,0), EMP_LAST CHAR(12), EMP_FIRST CHAR(10), ADDRESS VARCHAR (20), CITY CHAR (20), STATE CHAR (2), ZIP CHAR(5) );

CREATE TABLE VENDORS (VEN_CODE CHAR(4), VEN_NAME CHAR(40), CREDIT FLOAT(7,2) );

CREATE TABLE PRODUCTS (PRODUCT_NAME VARCHAR(30), PRICE FLOAT(5,2) );

INSERT INTO EMPLOYEES VALUES (1,'MorriS','Tony','123 Main','Allen','NY','23412'); INSERT INTO EMPLOYEES VALUES (2,'Smith','Paula','23 South Lane','Allen','SD','08262'); INSERT INTO EMPLOYEES VALUES (3,'Clark','Jenny','Route 12','Humming','OH','23576'); INSERT INTO EMPLOYEES VALUES (4,'Frank','Dave','12 Mocking Ln','Hastings','TN','83723'); INSERT INTO EMPLOYEES VALUES (5,'Stevens','April','78 West Ave','Humming','OH','23577'); INSERT INTO EMPLOYEES VALUES (6,'Kennedy','Lawance','78 West Street','Humming','OH','23578');

INSERT INTO EMPLOYEES VALUES (7,'Peters','Perry','83 West Street','Humming','OH','23578'); INSERT INTO EMPLOYEES VALUES (8,'Chenny','Terry','12 West Road','Allen','SD','08932'); INSERT INTO EMPLOYEES VALUES (9,'Clark','Hellen','57th Street','Corneth','NY','98756'); INSERT INTO EMPLOYEES VALUES (10,'Stevens','Jack','83rd Street','Westbridge','TN','83498'); INSERT INTO EMPLOYEES VALUES (11,'Williams','John','23rd Front Street','Lane','KY','45234'); INSERT INTO EMPLOYEES VALUES (12,'Hall','Colleen','34 West Road','Lane','KY','45234'); INSERT INTO EMPLOYEES VALUES (13,'Smith','Dorra','102 North Road','South','KY','42142'); INSERT INTO EMPLOYEES VALUES (14,'Bennet','June','12 South Road','Kidd','SD','08332' ); INSERT INTO EMPLOYEES VALUES (15,'Quinn','Laura','12 Main Street','Foto','NY','90832'); INSERT INTO EMPLOYEES VALUES (16,'Rain','Murry','PO BOX 282','Cake','KY','49872'); INSERT INTO EMPLOYEES VALUES (17,'Holmes','Cora','17 West Street','Allen','SD','19836'); INSERT INTO EMPLOYEES VALUES (18,'Tate','Remus','293 West Ave','South','KY','42142'); INSERT INTO EMPLOYEES VALUES (19,'Tate','Romus','34 Chicken Street','Egg','FL','78764'); INSERT INTO EMPLOYEES VALUES (20,'Moore','Misha','22 LG Drive','Kow','TX','67654'); INSERT INTO EMPLOYEES VALUES (21,'Cook','Anne','87 Glory Road','Tempus','FL','79832'); INSERT INTO EMPLOYEES VALUES (22,'Franks','Tim','23 Western Lane','Gadzooks','KY','41832'); INSERT INTO EMPLOYEES VALUES (23,'Dylan','Jane','11 East Street','Town','KY','44323'); INSERT INTO EMPLOYEES VALUES (24,'Crane','lee','1st Lane','Henry','MI','55343'); INSERT INTO EMPLOYEES VALUES (25,'Green','Lenny','23 Green Valley','Sunny','KY','43233'); INSERT INTO EMPLOYEES VALUES (26,'Ellis','Steve','Route 12','Logan','WV','62323'); INSERT INTO EMPLOYEES VALUES (27,'Lance','Tim','Route 234','Town','KY','44323'); INSERT INTO EMPLOYEES VALUES (28,'Jackson','Dylan','12 Glass Road','Sol','KY','49873'); INSERT INTO EMPLOYEES VALUES (29,'South','Mora','Route 23','Little John','WV','62345'); INSERT INTO EMPLOYEES VALUES (30,'Prince','Paul','39 South Bend','Bruce','VA','12938');

INSERT INTO PRODUCTS VALUES ('Hammer',12.99); INSERT INTO PRODUCTS VALUES('Stove',399.99); INSERT INTO PRODUCTS VALUES('Nails',1.99); INSERT INTO PRODUCTS VALUES('Mirror',300.99); INSERT INTO PRODUCTS VALUES('Lights',10.99); INSERT INTO PRODUCTS VALUES('Shelves',59.99); INSERT INTO PRODUCTS VALUES('Gas Range',599.99); INSERT INTO PRODUCTS VALUES('Electric Heater',29.99); INSERT INTO PRODUCTS VALUES('Repair Manual',15.99); INSERT INTO PRODUCTS VALUES('Floor Tiles',39.98); INSERT INTO PRODUCTS VALUES('Washer',199.95); INSERT INTO PRODUCTS VALUES('Dryer',299.95); INSERT INTO PRODUCTS VALUES('Sink',87.99); INSERT INTO PRODUCTS VALUES('2X4',10.50); INSERT INTO PRODUCTS VALUES('Sofa',234.95); INSERT INTO PRODUCTS VALUES('Couch',495.99); INSERT INTO PRODUCTS VALUES('Sofa Cover',49.95); INSERT INTO PRODUCTS VALUES('Wood Glue',8.75); INSERT INTO PRODUCTS VALUES('Tomato Plans',2.99); INSERT INTO PRODUCTS VALUES('Red Roses',24.95); INSERT INTO PRODUCTS VALUES('1 GB RAM',59.95); INSERT INTO PRODUCTS VALUES('WD 1TB Hard Drive',100.99); INSERT INTO PRODUCTS VALUES('CD ROM',34.99);

INSERT INTO VENDORS VALUES('01','GN FOODS', 1000.00); INSERT INTO VENDORS VALUES('02','Easy Out Inc', 2500.00); INSERT INTO VENDORS VALUES('03','OK Clothes', 550.00); INSERT INTO VENDORS VALUES('04','Spring Cleaners', 750.00); INSERT INTO VENDORS VALUES('05','Jason James Foods', 1500.00); INSERT INTO VENDORS VALUES('06','EK Support Inc', 1800.00); INSERT INTO VENDORS VALUES('07','George Tate Gym', 1800.00); INSERT INTO VENDORS VALUES('08','Up All Night Cleaners', 1600.00); INSERT INTO VENDORS VALUES('09','Junky Kars', 125.00); INSERT INTO VENDORS VALUES('10','Rosy Market', 1200.00);

Write an SQL command that will only show the following from the employees table 1. Employees with the last name: Smith 2. Employees with the last name: Morris 3. Employees with the first name: Jack 4. Employees who live in the city: Allen 5. Employees who live in the city: Humming 6. Employees who live in the city: Foto 7. Employees who live in the state: KY 8. Employees who live in the state: TN 9. Employees who live in the zip: 42142 10. Employees who live in the zip: 23578 Write an SQL command that will only show the following from the vendors table 1. Show only those vendors named: Junky Kars 2. Show only those vendors with a credit of: 1800 3. Show only those vendors with a ven code of: 05 4. Show only those vendors with a credit equal to 1000 5. Show only those vendors with a credit greater then 1000 6. Show only those vendors with a credit less than 1000 7. Show only those vendors with a credit greater then and equal to 1000 8. Show only those vendors with a credit lesser then and equal to 1000 9. Show only those vendors with a credit greater then and equal to 1000 10. Show only those vendors with a credit not equal to 1000 Write an SQL command that will only show the following from the products table 1. Show only those products named: Red Roses 2. Show only those products named: Sink 3. Show only those products with a price equal to 100.99 4. Show only those products with a price equal to 39.98 5. Show only those products with a price greater then 50.00 6. Show only those products with a price less then 100 7. Show only those products with a price greater then and equal to 100.99 8. Show only those products with a price lesser then and equal to 100 9. Show only those products with a price greater then and equal to 100 10. Show only those products with a price not equal to 1.99

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

What is black and white box testing?

Answered: 1 week ago