Question

MySQL insert questions: aStatement = 'insert into vehicle values(' + sid + ',\'' + staff_name +...

MySQL insert questions:

aStatement = 'insert into vehicle values(' + sid + ',\'' + staff_name + '\',' + Department + '\',' + salary + ');'

It returns

insert into vehicle values(1,'Matt',cash',6530);

I've noticed that there is a parentheses miss in front of cash which is department, but how can I change my astatement to fix it?

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

Please use the below statement:

statement="insert into vehicle values(" + sid + ",\'" + staff_name + "\',\'" + Department + "\'," + salary + ");";

one ' is missing before department

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
MySQL insert questions: aStatement = 'insert into vehicle values(' + sid + ',\'' + staff_name +...
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
  • 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,...

  • CREATE TABLE DEPT ( DEPTNO INTEGER NOT NULL, DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY (DEPTNO)); INSERT...

    CREATE TABLE DEPT ( DEPTNO INTEGER NOT NULL, DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY (DEPTNO)); INSERT INTO DEPT VALUES (10,'SPORTS','NEW YORK'); INSERT INTO DEPT VALUES (20,'HOME','DALLAS'); INSERT INTO DEPT VALUES (30,'OUTDOOR','CHICAGO'); INSERT INTO DEPT VALUES (40,'CLOTHING','BOSTON'); CREATE TABLE EMP ( EMPNO INTEGER NOT NULL, ENAME VARCHAR(10), JOB VARCHAR(9), MGR INTEGER, SAL FLOAT, COMM FLOAT, DEPTNO INTEGER NOT NULL, FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO), FOREIGN KEY (MGR) REFERENCES EMP(EMPNO), PRIMARY KEY (EMPNO)); INSERT INTO EMP VALUES (7839,'KING','PRESIDENT',NULL, 5000,NULL,10); INSERT INTO...

  • Answer the following questions using mysql. Please show screenshots to make sure the queries work...

    Answer the following questions using mysql. Please show screenshots to make sure the queries work. 1. Use a sub-query and the IN operator to find the number and name of each customer that placed an order on October 23, 2007. 2. Repeat step 2, but this time use the EXISTS operator in your answer. 3. Using a sub-query, find the number and name of each customer that did not place an order on October 23, 2007. 4. Using a sub-query,...

  • Karim Soltan is shopping for a new vehicle, and has noticed that many vehicle manufacturers are...

    Karim Soltan is shopping for a new vehicle, and has noticed that many vehicle manufacturers are offering special deals to sell off the current year’s vehicles before the new models arrive. Karim’s local Ford dealership is advertising 3.9% financing for a full 48 months (i.e., 3.9% compounded monthly) or up to $4000 cash back on selected vehicles. The vehicle that Karim wants to purchase costs $24 600 including taxes, delivery, licence, and dealer preparation. This vehicle qualifies for $1800 cash...

  • Q.5] Answer the following questions based on the company database (based on the homework assignment 2) y dat...

    Q.5] Answer the following questions based on the company database (based on the homework assignment 2) y database (based on the homework assignment 2) 3 IPage 1. For each department whose average employee salary is more than $30,000, write a SQL statement to retrieve the department name and the number of employees working for that department 2. Write a SQL statement to retrieve first name, last name, and address of each employee who lives in Houston, TX. 3. Write a...

  • I need help with all questions thankyou! 10. If you walk along the top of a...

    I need help with all questions thankyou! 10. If you walk along the top of a fence, why does holding I1. The front wheels located far out in front of the racing your arms out help you to balance? vehicle help to keep the vehicle from nosing upward when it accelerates. What physics concepts plays a role here? When a car drives off a cliff, why does it rotate forward as it falls. (Consider the torque it experiences as it...

  • Overview This lab provides you the opportunity to insert and update data with the use of SQL comm...

    Overview This lab provides you the opportunity to insert and update data with the use of SQL commands. The lab will utilize the FLIX2YOU problem, the current schema. In order to start this lab, you must have successfully completed Lab # 6. In Lab # 6, you executed a script that was provided to you. This script created 7 of the FLIX2YOU tables as documented in the Entity Relationship Diagram in the FLIX2YOU problem document. The second part of lab...

  • Home Insert Page Layout Formulas Data Review View Cut Copy Format Painter a Text Calibri Jaxson...

    Home Insert Page Layout Formulas Data Review View Cut Copy Format Painter a Text Calibri Jaxson Motor Co. operates an automobile sales dealership. It is that time of year again where annual raises are assessed and the company must review their salary expense as a part of their annual budget. In this assignment, you wi use Excel's Vlookup feature to make this process easier. You are given two reports: (1) 2 Jaxson Motor Co Employee Listing which shows the Employee...

  • Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it...

    Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it to create tables and populate with the supplied data. If there are any errors in the script fix them. It is your job to find the errors and correct them. This is important. You will need correct data for future exercises in this module. Then answer all questions. Write the answer below each question then take screen shot of the result. This script builds...

  • For this set of Review Questions, we will create and use a database for the Wedgewood...

    For this set of Review Questions, we will create and use a database for the Wedgewood Pacific Corporation (WPC) that is similar to the Microsoft Access database we created and used in Chapters 1 and 2. Founded in 1957 in Seattle, Washington, WPC has grown into an internationally recognized organization. The company is located in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The...

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