Question

SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after.

First 3 tables are after the first 2 images for reference if needed.

PROBLEM SOLVING EXERCIO Ex4A-1. Create a table kr_customer with ate a table kr_customer with the following attributes as show

EXHA-3. Create a table kr order with the following attributes as show Order Number Salesperson_Name Amount Customer_Name Jack

//1//
CREATE TABLE kr_customer (

Name VARCHAR(40) NOT NULL PRIMARY KEY,

City VARCHAR(20),

Status CHAR(1)

);

//2//

CREATE TABLE kr_salesperson (

Name VARCHAR(40) NOT NULL PRIMARY KEY,

Age INT,

Salary DECIMAL(8, 2)

);

//3//

CREATE TABLE kr_order (

Order_Number number(3) NOT NULL PRIMARY KEY,

Customer_Name VARCHAR(40),

Salesperson_Name VARCHAR(40),

Amount DECIMAL(5, 2),

FOREIGN KEY (Customer_Name) References kr_customer(Name),

FOREIGN KEY (Salesperson_Name)References kr_salesperson(Name)

);

Ex4A-4. Create a script file that inserts rows in the above tables. Ex4A-5. Create a script file that inserts the following r

Ex4A-12. Add an attribute Fee with numeric data type in the sporting clubs table. Issue SQL Update statements for individua

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following is the script which can be used to insert the values in the above-made tables.

INSERT INTO kr_customer (Name, City, Status)
VALUES ('Jackie Foods', 'Memphis', 'P');
INSERT INTO kr_customer (Name, City, Status)
VALUES ('Tom Construction', 'Kansas City', 'R');
INSERT INTO kr_customer (Name, City, Status)
VALUES ('Indie Professional', 'Memphis', 'P');

INSERT INTO kr_salesperson (Name, Age, Salary)
VALUES ('Tom Selleck', 40, 50150);
INSERT INTO kr_salesperson (Name, Age, Salary)
VALUES ('Jeremy Mack', 35, 100300);
INSERT INTO kr_salesperson (Name, Age, Salary)
VALUES ('Anita Raina', 38, 65500);
INSERT INTO kr_salesperson (Name, Age, Salary)
VALUES ('Kerry Kao', 28, 35600);
INSERT INTO kr_salesperson (Name, Age, Salary)
VALUES ('Joe Walton', 45, 110500);

INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (100, 'Jackie Foods', 'Anita Raina', 700);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (200, 'Indie Professional', 'Tom Selleck', 1200);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (300, 'Tom Construction', 'Joe Walton', 1500);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (400, 'Jackie Foods', 'Tom Selleck', 850);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (500, 'Indie Professional', 'Jeremy Mack', 455);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (600, 'Jackie Foods', 'Joe Walton', 1500);
INSERT INTO kr_order (Order_Number, Customer_Name, Salesperson_Name, Amount)
VALUES (700, 'Tom Construction', 'Anita Raina', 860);

Being a Chegg expert, I am obliged to do only one question at a time.
I hope you understand.
Thanks

Add a comment
Know the answer?
Add Answer to:
SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • NEED HELP IN INSERT STATEMENTS FOR THE TABLES CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR...

    NEED HELP IN INSERT STATEMENTS FOR THE TABLES CAN YOU PLEASE ADD SOME INSERT STATEMENTS FOR A COMPANY SCHEMA SCRIPT. PLEASE ADN THANK YOU DROP TABLE dependent; DROP TABLE works_on; DROP TABLE project; DROP TABLE dept_locations; DROP TABLE department; DROP TABLE employee; CREATE TABLE employee ( fname varchar(15) not null, minit varchar(1), lname varchar(15) not null, ssn char(9), bdate date, address varchar(50), sex char, salary numeric(10,2), superssn char(9), dno numeric, primary key (ssn), foreign key (superssn) references employee(ssn) ); CREATE...

  • Help In Database: Next comes the data entry: Make up data for your database, or find...

    Help In Database: Next comes the data entry: Make up data for your database, or find real data. You can enter the data with INSERT statements, but it is much easier to use PhpAdmin. It has a form where you can type the data directly. Alternatively, you can use PhpAdmin to import CSV data (comma-separated values), which you can export from Excel. Include at least 3 rows in each of the entity relations, and as many rows as you need...

  • I need help with the following SQL query for a company database (script given below). The...

    I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...

  • database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED...

    database and sql problme THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...

  • ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use...

    ONLY ODD NUMBERS. YOU MUST USE ORACLE OR MY SQL. THANKS Chapter 3 TAL Distributors Use SQL to complete the following exercises 1. Create a table named SALES_ REP. The table has the same structure as the REP table shown in Figure 3-11 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMBER data type. Execute the command to describe the layout and characteristics of the SALES_REP table. Add the...

  • Use MySQL Workbench for these questions. Do NOT use Lucidchart. MySQL Workbench has more capability than...

    Use MySQL Workbench for these questions. Do NOT use Lucidchart. MySQL Workbench has more capability than Lucidchart, as it allows creation of DDL SQL from the model. Turn in 1 Workbench file , 1 document with the forward-engineered sql statements, and a Word document with your inserted data. This problem mimics the one from the previous assignment. Model it in Workbench, then forward-engineer the database script and import into your database. If the import fails, fix it in the model,...

  • Step 1: Design and create the tables You must create additional tables to hold Project and...

    Step 1: Design and create the tables You must create additional tables to hold Project and Activity Data. A project represents the construction of a facility with a limited scope of work and financial funding. A Project can be composed of many activities which indicate the different phases in the construction cycle. Example Project Name: Bobba Fett’s Bounty Chase Ride An activity represents the work that must be done to complete the project. Example Activity Name: For Example activity name...

  • I need help in SQL management studio please. Question: Create the same query as query 5,...

    I need help in SQL management studio please. Question: Create the same query as query 5, but only include artists if they have 'Pop' Genre. Previous question: Create a list of all composers and artists in your database. Include two columns in your record set (the names of the returned columns are in brackets): 'Composer/Artist Name' and 'Type' (which will indicate whether your results are from the composer or artist table). Order by 'Composer/Artist Name'. This is the answer for...

  • Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys...

    Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys Exercise                                                                                In Lab 09, we will continue the practice of creating tables. You will need to write SQL statements for the tasks specified below. After you complete them, submit your SQL script (in one *.sql file) to Blackboard by 11:59pm Nov. 16 (Friday). Include your name as a comment in the SQL script submitted. The creation statement for each table is worth one point,...

  • Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and...

    Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and phones of all swimmers currently in level (of id) 3. +-------+---------+---------------------------+ | FName | LName   | EMail                     | +-------+---------+---------------------------+ | Bobby | Khan    | theBKhan1 | | Clara | Johnson | ClaraJohnson_11 | +-------+---------+---------------------------+ 2 rows in set (0.00 sec) (2) Provide the names of swimmers who have signed up to participate in the event '100M Butterfly' of Meet id 1. +-------+---------+ | FName...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT