Objective: The objective of this lab is to ensure you know how to use Data Definition
Fantastic news! We've Found the answer you've been seeking!
Question:
Objective:
The objective of this lab is to ensure you know how to use Data Definition Language and Data Manipulataion Language.
Pre-Lab Instructions:
Read Modules 6 and 7
Lab Tasks:
- Import the data (student.sql) in database.
- Using different DML commands, answer the following questions.
- Write a SQL SELECT statement to find the number of students enrolled.
- Write a SQL SELECT statement to find the number of students in the Computer Science program.
- Write two SQL SELECT statements that will display the number of students who are between the ages of 25 and 30 (inclusively). The first SQL will use the BETWEEN operator and the second will use <, > operators. Both SQL statements must produce the same output.
- Write a SQL SELECT statement with the IN operator to display all columns from the student table for students having a last name of WILSON or JAMES.
- Write a SQL INSERT statement that will add student George Smith to the student table. His cell number is 887258963, he is taking the Computer Technician course and he is 25 years old. Since StudentNo field is an AUTO_INCREMENT field, do not include it in the INSERT statement.
- Write a SQL UPDATE statement to change the course name from Computer Science to Computer Science Engineering for every student enrolled in the Computer Science program. (NOTE: If you get a Error Code: 1175 then please use SET SQL_SAFE_UPDATES = 0; before the update SQL)
- Write a SQL DELETE statement to remove students Anita Arora and Frank Tribiani.
- Jeremy Davis has decided to transfer from the Computer Technician course to the Photography course. Write a SQL UPDATE statement to change his program; use his StudentNo as the filter and not his name.
- Write a SQL SELECT statement with the LIKE operator to display students whose phone number start with 247.
Your lab should be composed of all the answers from question 2 to 9:
- Notepad Document for the questions in task #2 to #9:
Related Book For
Statistics And Data Analysis For Financial Engineering
ISBN: 9781461427490
1st Edition
Authors: David Ruppert
Posted Date: