Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started