25.7k views
5 votes
Practice the SQL queries for the following (put the SQL Code down): 1. Write a query that displays customer's names as "C_Name" and postal codes as "Zip" who are from New Jersey (NJ).

User Janen R
by
7.5k points

1 Answer

2 votes

Final answer:

The SQL code provided enables the user to retrieve a list of customers by their names and postal codes, specifically filtered for those who reside in New Jersey (NJ).

Step-by-step explanation:

To write a query that displays customer's names as "C_Name" and postal codes as "Zip" for those who are from New Jersey (NJ), you would use the following SQL code:

SELECT customer_name AS 'C_Name', postal_code AS 'Zip'

FROM customers

WHERE state = 'NJ';

This SQL query selects two columns from the 'customers' table. The 'customer_name' column is aliased as 'C_Name' and the 'postal_code' as 'Zip'. The 'WHERE' clause is used to filter the results to only include rows where the 'state' column has the value 'NJ'.

The complete question is: Practice the SQL queries for the following (put the SQL Code down): 1. Write a query that displays customer's names as "C_Name" and postal codes as "Zip" who are from New Jersey (NJ). is:

User Manoj Kumar Singh
by
7.9k points