Question

SELECT * FROM purchase order = syntax error at end of input how to fix CREATE...

SELECT * FROM purchase order =

syntax error at end of input how to fix

CREATE TABLE "purchase order" (
"IBSN" INTEGER,
"Author" VARCHAR (200),
"num OF copies" INTEGER
)

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

Preferably, please don't use any white space in the table name or in the column name. Moreover, table name "purchase order" collides with the SQL keyword "order" which may lead to confusion. You should follow as below:

CREATE TABLE "purchase_order" (
"ISBN" INTEGER,
"Author" VARCHAR (200),
"num_of_copies" INTEGER
);

Also, you have misspelled ISBN as IBSN.

SELECT * FROM purchase_order; --> displays the whole database. If the db holds huge amount of data, you should not use this statement as it can cause the process to enter into a Long-running session. For that, you need to do indexing (just like putting page numbers to your 1000 pages of assignment) on your database.

INSERTING VALUE TO A TABLE:

INSERT INTO "purchase_order" (ISBN, Author, num_of_copies) VALUES ('1234455', 'Chetan Bhagat', '33');

CONDITIONAL DATA FETCHING:

SELECT * FROM purchase_order WHERE ISBN = 'YOUR_SEARCH_VALUE';

SELECT * FROM purchase_order WHERE Author= 'YOUR_SEARCH_VALUE';

Add a comment
Know the answer?
Add Answer to:
SELECT * FROM purchase order = syntax error at end of input how to fix CREATE...
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
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