201k views
4 votes
Construct a SQL query that displays a list of colleges, their sity/state, the accrediting agency, and whether or not the school is distance only. Only show the first 10 records.

1 Answer

4 votes

Answer:

SELECT college, city_state, accre_agency, distance LIMIT 10

Step-by-step explanation:

Given

Table name: College

See attachment for table

Required

Retrieve top 10 college, state, agency and school distance from the table

To retrieve from a table, we make use of the SELECT query

The select statement is then followed by the columns to be selected (separated by comma (,))

So, we have:

SELECT college, city_state, accre_agency, distance

From the question, we are to select only first 10 records.

This is achieved using the LIMIT clause

i.e. LIMIT 10 for first 10

So, the complete query is:

SELECT college, city_state, accre_agency, distance LIMIT 10

Construct a SQL query that displays a list of colleges, their sity/state, the accrediting-example-1
User Jalpesh Vadgama
by
4.8k points