CST225Quiz4 Done

docx

School

North Carolina A&T State University *

*We aren’t endorsed by this school

Course

225

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

6

Uploaded by DeanMoon9058

Report
CST225 Quiz#4: SQL I Spring2024 Problem: Reading quiz. Note : Please read/review the lecture notes for basic SQL chapter in preparation for this quiz. XAMPP is REQUIRED!!! (See how to download Xampp in the software folder located on Blackboard. Go over the slides then write , run the SQL queries for the following questions and show the result of each query. ( SCREENSHOTS OF SYNTAXES AND RESULTS). You can either use XAMPP shell, the command prompt or php admin please see lab 4 Noah Thompson 1. Connect to mysql 2. Show all the databases. 3. Create a new database called "lastname_db".(where lastname is your last name) Page | 1
CST225 Quiz#4: SQL I Spring2024 4. Set the "lastname_db"(where lastname is your last name) database as the default database. 5. Show all the tables in the default database. 6. Create a new table called "Departments" with the columns and type indicated below. deptName VARCHAR(20) building VARCHAR(15) budget FLOAT(12,2) Biology Watson 90000.00 Comp.Sci. Taylor 100000.00 Elec.Eng. Taylor 85000.00 Finance Painter 120000.00 7. Insert the above records in the Departments Table Page | 2
CST225 Quiz#4: SQL I Spring2024 8. Create another new table called "Instructors" with the columns and type indicated below. ID CHAR(5) name VARCHAR(30) deptName VARCHAR(20) salary FLOAT(10,2) 12121 Alice Wu Finance 90000.00 15151 John Mozart Music 40000.00 22222 Frank Einstein Physics 95000.00 32343 El Said History 60000.00 33456 Chelsea Dunn Physics 90000.00 9. Insert the above records in the Instructors Table 10. Delete from the departments table the comp.Sci. Department Page | 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CST225 Quiz#4: SQL I Spring2024 11. Add a column named "chairperson" with domain type VARCHAR(40) in the department table 12. Drop the "chairperson" column you just created in the department table 13. Change the domain of the attribute named "building" in the departments table from VARCHAR(15) to VARCHAR(30) 14. Increase salaries of instructors whose salary is over $100,000 by 2%, and all others receive a 4% raise Page | 4
CST225 Quiz#4: SQL I Spring2024 15. Select the content of the attributes named “ID" and “name" from the instructors table 16. Select the content of all columns from the instructors table 17. Select only the distinct values from the column named “deptName” from the instructors table 18. Select only the instructors who works in the "Physics" with salary equal to $90000.00. 19. Select only the instructors who works in the "Physics" OR instructors who make $90000.00 20. Select the instructors whose name ends with an " n" from the instructors table 21. Select the instructors whose name includes the substring "an" from the instructors table 22. Find the names of all instructors whose name does not include the substring “an”. 23. Select all the instructors from the instructors table, however, we want to sort the salaries of all instructors in descending order 24. Select all the instructors from the instructors table, however, we want to sort the salaries of all instructors in ascending order 25. Delete the data in the Instructors table 26. Delete the departments table from the tutorials database Page | 5
CST225 Quiz#4: SQL I Spring2024 Page | 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help