My professor is asking for me to include a query name for each and every query that is involved with this homework. I’m assuming he’s referring to an alias, so I’ve used this code successfully with some questions:
SELECT COUNT(CustomerID) AS Problem1
FROM Customers;
However, I can’t us AS when creating tables or deleting columns like this (without an error).
CREATE TABLE TestDB AS Problem6
(
SuggestionID Char(5) NOT NULL PRIMARY KEY,
Suggestion VarChar(100) NOT NULL,
SugContact Char(30) NOT NULL,
SugPhone Char(10),
SugDate Date NOT NULL,
SugPriority INT
)
OR when using INSERT INTO. So my question is this: how do I name a specific query, specifically when creating a database like the above or when deleting a column.
It is not possible to name a query as such – you could put it into a stored procedure or alternatively – and more likely, he’ll just want you to label the query with a comment like so: