Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
100%

Need help writing SQL statements for these, I'm getting some errors for my returns.

1. Write a SELECT statement that returns these columns from the Instructors table:
a. The monthly salary (the AnnualSalary column divided by 12)
b. A column that uses the CAST function to return the monthly salary with 1 digit to the
right of the decimal point
c. A column that uses the CONVERT function to return the monthly salary as an integer
d. A column that uses the CAST function to return the monthly salary as an integer
2. Write a SELECT statement that returns these columns from the Students table:
a. The EnrollmentDate column A column that uses the CAST function to return the
EnrollmentDate column with its date only (year, month, and day)
b. A column that uses the CAST function to return the EnrollmentDate column with its full
time only (hour, minutes, seconds, and milliseconds)
c. A column that uses the CAST function to return the EnrollmentDate column with just the
year and month
3. Write a SELECT statement that returns these columns from the Instructors table:
a. The AnnualSalary column
b. A column named MonthlySalary that is the result of dividing the AnnualSalary column
by 12
c. A column named MonthlySalary Rounded that calculates the monthly salary and then
uses the ROUND function to round the result to 2 decimal places
4. Write a SELECT statement that returns these columns from the Students table:
a. The EnrollmentDate column A column that returns the four-digit year that's stored in
the EnrollmentDate column
b. A column that returns only the day of the month that's stored in the EnrollmentDate
column
c. A column that returns the result from adding four years to the EnrollmentDate column;
use the CAST function so only the year is returned
5. Write a SELECT statement that returns these columns:
a. The DepartmentName column from the Departments table
b. The CourseNumber column from the Courses table
c. The FirstName column from the Instructors table
d. The Last Name column from the Instructors table
e. Add a column that includes the first three characters from the DepartmentName
column in uppercase, concatenated with the CourseNumber column, the first character
of the FirstName column if this column isn't null or an empty string otherwise, and the
LastName column. For this to work, you will need to cast the Course Number column to
a character column.
expand button
Transcribed Image Text:1. Write a SELECT statement that returns these columns from the Instructors table: a. The monthly salary (the AnnualSalary column divided by 12) b. A column that uses the CAST function to return the monthly salary with 1 digit to the right of the decimal point c. A column that uses the CONVERT function to return the monthly salary as an integer d. A column that uses the CAST function to return the monthly salary as an integer 2. Write a SELECT statement that returns these columns from the Students table: a. The EnrollmentDate column A column that uses the CAST function to return the EnrollmentDate column with its date only (year, month, and day) b. A column that uses the CAST function to return the EnrollmentDate column with its full time only (hour, minutes, seconds, and milliseconds) c. A column that uses the CAST function to return the EnrollmentDate column with just the year and month 3. Write a SELECT statement that returns these columns from the Instructors table: a. The AnnualSalary column b. A column named MonthlySalary that is the result of dividing the AnnualSalary column by 12 c. A column named MonthlySalary Rounded that calculates the monthly salary and then uses the ROUND function to round the result to 2 decimal places 4. Write a SELECT statement that returns these columns from the Students table: a. The EnrollmentDate column A column that returns the four-digit year that's stored in the EnrollmentDate column b. A column that returns only the day of the month that's stored in the EnrollmentDate column c. A column that returns the result from adding four years to the EnrollmentDate column; use the CAST function so only the year is returned 5. Write a SELECT statement that returns these columns: a. The DepartmentName column from the Departments table b. The CourseNumber column from the Courses table c. The FirstName column from the Instructors table d. The Last Name column from the Instructors table e. Add a column that includes the first three characters from the DepartmentName column in uppercase, concatenated with the CourseNumber column, the first character of the FirstName column if this column isn't null or an empty string otherwise, and the LastName column. For this to work, you will need to cast the Course Number column to a character column.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education