1

Create a view named HighBalance using the the patient number, last name, first name, street, city and zip code for those patients with a balance greater than $1,000. Display the data in the view

Im having trouble creating this SQL command sequence, every time i try to correct it, it gives me an error message saying: Syntax error in CREATE TABLE sequence

CREATE Table HighBalance AS
SELECT PatientNum, LastName, FirstNAme, Street, City, ZipCode
FROM Patient
WHERE Balance>1000 ;

What did i do wrong?

1
  • 1
    CREATE Table --> CREATE view. Commented Sep 14, 2023 at 17:53

1 Answer 1

1

Perhaps FirstNAme should be FirstName? Perhaps CREATE TABLE should be CREATE VIEW?

CREATE VIEW HighBalance AS
SELECT PatientNum, LastName, FirstName, Street, City, ZipCode
FROM Patient
WHERE Balance > 1000;

Try this first:

SELECT * from Patient

If that works try:

SELECT * from Patient WHERE Balance > 1000

If that works try:

SELECT PatientNum, LastName, FirstName, Street, City, ZipCode
FROM Patient
WHERE Balance > 1000;

Then you will be closer to understanding the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.