Question: 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

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!