171k views
1 vote
What queries would I write to pull the following questions in my database. SELECT * is UNNACCEBTABLE Write the queries to answer the following questions. Every column MUST have a column heading. What is the ward name (name_2) and councillor for each Ward in Edmonton? You can use the EdmontonWard table to answer this question.

1 Answer

3 votes

Final answer:

To fetch ward names and councillors from the EdmontonWard table without using SELECT *, you would use a query specifying the name_2 and councillor columns with aliases for the column headings.

Step-by-step explanation:

To retrieve the ward name and councillor for each Ward in Edmonton from the EdmontonWard table without using SELECT *, you would need to specify the columns that contain this information in your query. Assuming that the column storing the ward name is name_2 and the column for the councillor's name is councillor, the query would look like this:

SELECT name_2 AS 'Ward Name', councillor AS 'Councillor' FROM EdmontonWard;

This SQL query specifies the columns to be retrieved and assigns them friendlier column headings (Ward Name and Councillor) for the output.

To retrieve the ward name (name_2) and councillor for each Ward in Edmonton from the EdmontonWard table, you can use the following SQL query:

SELECT name_2, councillor FROM EdmontonWard;

This query will select the name_2 column (ward name) and councillor column from the EdmontonWard table. The SELECT * statement is not acceptable for this task as it would return all columns, and we only need the specific columns mentioned.

User Laconbass
by
7.5k points