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:
studentid integer primary key
firstname text
lastname text
age integer
grade text
city text
Add some sample data to the students table:
tablestudentidfirstname,lastname,age,grade,cityJohn,Doe,New YorkAlice,Smith,Los AngelesBob,Johnson,ChicagoEmma,Brown,HoustonJames,Wilson,Philadelphia
Write the SQL select queries:
Select all columns from the students table for all students.
Select only the firstname and lastname columns from the students table.
Select the firstname and age of students who are older than
Select distinct grades from the students table.
Select the firstname of students who live in New York.
Select the firstname, lastname, and city of the oldest student.
Select the average age of students.
Select the count of students in each city.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
