Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, first review the query requirements below, identify table ( s ) and columns needed for each query, then create another test database

In this assignment, 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.
Write a MySQL query to select all the columns from the "students" table where the "city" is "San Diego".
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.
Write a PHP script that retrieves all the rows from the "students" table where the "student_firstname" is equal to John.
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.
Write a PHP script that retrieves all the rows from the "students" table where the "state" is "CA" OR the "state" is "NY".
Write a MySQL query to update the "GPA" column of the "students" table to 3.5 where the "student_id" is equal to 12345.
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.
Write a PHP script that deletes all the rows from the "courses" table where the "course_name" is NULL.
Write a MySQL query to select all the rows from the "courses" table where the "course_status" column is NULL.
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 with AI-Powered 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

Students also viewed these Databases questions