Question

Write a SQL statement to display either those orders which are not issued on date 2012-09-10...

Write a SQL statement to display either those orders which are not issued on date 2012-09-10 and issued by the salesman whose ID is 505 and below or those orders which purchase amount is 1000.00 and below.

orders table

ord_no      purch_amt   ord_date    customer_id  salesman_id
----------  ----------  ----------  -----------  -----------
70001       150.5       2012-10-05  3005         5002
70009       270.65      2012-09-10  3001         5005
70002       65.26       2012-10-05  3002         5001
70004       110.5       2012-08-17  3009         5003
70007       948.5       2012-09-10  3005         5002
70005       2400.6      2012-07-27  3007         5001
70008       5760        2012-09-10  3002         5001
70010       1983.43     2012-10-10  3004         5006
70003       2480.4      2012-10-10  3009         5003
70012       250.45      2012-06-27  3008         5002
70011       75.29       2012-08-17  3003         5007
70013       3045.6      2012-04-25  3002         5001
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Database:


SELECT * FROM orders WHERE (ord_date<>'2012=09-10' and salesman_id=505) OR
purch_amt<=1000.00;


CREATE TABLE orders(ord_no integer PRIMARY KEY,purch_amt float , ord_date text,customer_id int,salesman_id int);

/* Create few records in this table */
INSERT INTO orders VALUES(70001,150.5, '2012-10-05', 3005, 5002);
INSERT INTO orders VALUES (70009, 270.65 , '2012-09-10', 3001, 5005);

INSERT INTO orders VALUES (70002 , 65.26 ,'2012-10-05', 3002, 5001);

INSERT INTO orders VALUES (70004, 110.5 ,'2012-08-17', 3009, 5003);

INSERT INTO orders VALUES (70007 , 948.5 ,'2012-09-10', 3005 , 5002);
INSERT INTO orders VALUES (70005 , 2400.6 ,'2012-07-27', 3007 , 5001);
INSERT INTO orders VALUES (70008 , 5760 ,'2012-09-10', 3002, 5001);
INSERT INTO orders VALUES (70010 , 1983.43 ,'2012-10-10' ,3004 , 5006);
INSERT INTO orders VALUES (70003 , 2480.4 , '2012-10-10', 3009 , 5003);
INSERT INTO orders VALUES (70012 , 250.45 ,'2012-06-27' ,3008 , 5002);
INSERT INTO orders VALUES (70011 ,75.29, '2012-08-17', 3003 , 5007);
INSERT INTO orders VALUES (70013, 3045.6 ,'2012-04-25', 3002 , 5001);


SELECT * FROM orders WHERE (ord_date<>'2012=09-10' and salesman_id=505) OR
purch_amt<=1000.00;

Add a comment
Know the answer?
Add Answer to:
Write a SQL statement to display either those orders which are not issued on date 2012-09-10...
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
  • Complete Task 4, 5, 6 Instructions Page 3 of 3 query.sql 1 -- Write your query...

    Complete Task 4, 5, 6 Instructions Page 3 of 3 query.sql 1 -- Write your query below and then click "Run Query" to execute it. To save multiple queries, click the "+" icon above. VE Task 4: </> The InstantRide User Satisfaction team is a core team for Instant Ride, and they focus on increasing the customer satisfaction. They want to learn the travel time for each ride in the system. You need to return the USER_ID, and the TRAVEL_TIME...

  • 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...

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