Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First review the query requirements below, identify table ( s ) and columns needed for each query, then create another test database and the tables,

First review the query requirements below, identify table(s) and columns needed for each query, then create another test database and the tables, and answer each question below. (Hint: there are only 2 tables)
You are encouraged to insert a few database records into each table for testing your queries and the results.
Remember to capture a screenshot of the output for each question.
1) Write a MySQL query to select all the columns from the "students" table where the "city" is "San Diego".
2) Write a MySQL query to select the "course_name" and "term" columns from the "courses" table and order them by "course_name" in descending order.
3) Write a PHP script that retrieves all the rows from the "students" table where the "student_firstname" is equal to John.
4) Write a PHP script that retrieves all the rows from the "students" table where the "GPA" is greater than or equal to 2.0 AND the "major" is ASD.
5) Write a PHP script that retrieves all the rows from the "students" table where the "state" is "CA" OR the "state" is "NY".
6) Write a MySQL query to update the "GPA" column of the "students" table to 3.5 where the "student_id" is equal to 12345.
7) Write a PHP script to insert a new row into the "students" table with the following values: "John" for the "student_firstname" column, "Doe" for the "student_lastname" column, "123 Main St" for the "address" column, "Los Angeles" for the "city" column, "CA" for the "state" column, and "90001" for the "zip" column.
8) Write a PHP script that deletes all the rows from the "courses" table where the "course_name" is NULL.
9) Write a MySQL query to select all the rows from the "courses" table where the "course_status" column is NULL.
10) Write a MySQL query that selects all rows from a table called "courses" where course_id stats with "ASD".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

Repeat Problem 4.15 for swerling IV type target.

Answered: 1 week ago