224k views
0 votes
Construct a query to count the number of establishments (named NumOfEstablishments) that start with the letters 'Mc'.

User Jcuenod
by
6.9k points

1 Answer

4 votes

Answer:

SELECT COUNT(*) AS NumOfEstablishments

FROM establishment

WHERE aka_name LIKE "Mc%";

Step-by-step explanation:

The SQL or structured query language query statement uses the 'SELECT' clause to read or retrieve data from the database, the 'FROM' clause specifies the table from which data is retrieved (in this case, the establishment table) while the 'WHERE' clause uses the 'LIKE' operator to set a condition for the rows to be retrieved (in this case, NumOfEstablishments columns starting with Mc). The LIKE operator uses the '%' character to specify one or more characters.

User Droidd
by
5.7k points