Skeeball 1987
Skeeball 1987

Reputation: 11

Chapter 4 case project

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?

Upvotes: 1

Views: 77

Answers (1)

Pruss
Pruss

Reputation: 257

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.

Upvotes: 1

Related Questions