Question: Database SQL question: Suppose you're managing a database for a school. Answer the following: Create a table named students with the following columns: student _

Database SQL question: Suppose you're managing a database for a school. Answer the following:
Create a table named students with the following columns:
student_id (integer, primary key)
first_name (text)
last_name (text)
age (integer)
grade (text)
city (text)
Add some sample data to the students table:
\table[[student_id,first_name,last_name,age,grade,city],[1,John,Doe,15,10,New York],[2,Alice,Smith,14,9,Los Angeles],[3,Bob,Johnson,16,11,Chicago],[4,Emma,Brown,15,10,Houston],[5,James,Wilson,13,8,Philadelphia]]
Write the SQL select queries:
3. Select all columns from the students table for all students.
4. Select only the first_name and last_name columns from the students table.
5. Select the first_name and age of students who are older than 14.
6. Select distinct grades from the students table.
7. Select the first_name of students who live in New York.
8. Select the first_name, last_name, and city of the oldest student.
9. Select the average age of students.
10. Select the count of students in each city.
 Database SQL question: Suppose you're managing a database for a school.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!