0% found this document useful (0 votes)
33 views

The National Teachers College

This document contains a midterm examination for a business computer class at the National Teachers College. It includes a cover page with instructions, 15 multiple choice questions, and 5 short answer/query questions related to SQL functions and the employees database table. Students are asked to identify SQL concepts like literals, concatenation, aliases and functions. They are also tasked with writing queries to describe the employee table structure, display unique job titles, concatenate employee names and titles, output all employee data separated by commas, and order employee names by birthday.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

The National Teachers College

This document contains a midterm examination for a business computer class at the National Teachers College. It includes a cover page with instructions, 15 multiple choice questions, and 5 short answer/query questions related to SQL functions and the employees database table. Students are asked to identify SQL concepts like literals, concatenation, aliases and functions. They are also tasked with writing queries to describe the employee table structure, display unique job titles, concatenate employee names and titles, output all employee data separated by commas, and order employee names by birthday.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

THE NATIONAL TEACHERS COLLEGE 629 J.Nepomuceno St.

, Quiapo, Manila Business Computer MIDTERM EXAMINATION 1st Semester, SY 2011 2012 General Directions: Read and follow instructions carefully All questions and clarifications must be addressed to your professor only Anybody caught in any act of cheating will receive 0 in this exam Write all answers on the space provided. Score:________ Date: ________

Name: __________________________ Section: __________________________

________1. Is a character, a number, or a date that is included in the SELECT statement. a. Literal b. b. Concatenation c. c. Alias d. d. none of the above. _________2. It is represented by two vertical bars (||). a. Literal b. Concatenation c. Alias d. none of the above. _________3. A Logical Operator returns TRUE if either components condition is TRUE a. AND b. OR c. NOT d. none of the above _________4. A keywords used to eliminate duplicate row in the result-set. a. DISTINCT b. DUPLICATE c. DESCRIBE d. none of the above _________5. A command used to display the structure of the table. a. DISTINCT b. DUPLICATE c. DESCRIBE d. none of the above _________6. A Logical Operator that returns TRUE if both component conditions are true. a. AND b. OR c. NOT d. none of the above _________7. Used to rename column heading.

a. Literal b. Concatenation c. Alias d. none of the above. _________8.A Logical Operator that returns TRUE if the following condition is false. a. AND b. OR c. NOT d. none of the above _________9.A type of clause that can be used to sort rows. a. FROM clause b. WHERE clause c. ORDER BY clause d. none of the above _________10. It can manipulate output for groups of rows a. SQL function b. Single-Row Function c. Character Functions d. none _________11. A function that accepts character input and can return both character and number values. a. SQL function b. Character Function c. Number Function d. none _________12.It converts alpha character values to lowercase a. LOWER b. UPPER c. INITCAP d. none of the above _________13.Concatenates the first character value to the second character value. a. CONCAT b. LOWER c. UPPER d. none of the above _________14.Converts alpha character values to uppercase for the first letter of each word. a. LOWER b. UPPER c. SUBSTR d. none of the above _________15. Shows the length of a string as a numeric value a. LPAD b. RPAD c. LENGTH d. none of the above

II. ENUMERATION Types of Function 1. 2. Types of Single-Row Function 1. 2. 3. Types of Character Function 1. 2. 3. 4. 5.

II. Write the query that meets the problem. Display the result-set.(5pts each) Emp no. 1 2 3 4 5 6 7 8 9 Name Davolio Fullet Leverling Deacock Buchanan Suyama King Callahan Dodsworth Title Sales Rep VP, Sales Sales Rep Sales Rep Sales man Sales Rep Sales Rep Inside Sales Coordinator Sales Rep Title of Courtesy Ms. Dr. Ms. Mrs. Mr. Mr. Mr. Ms. Ms. Birthday 01-May-92 14-Aug-92 01-Apr-92 03-May-93 17-Oct-93 15-Jun-94 02-Jan-94 05-Mar-94 15-Nov-94 City Seatle Tahoma Kirkland Redmond London London London Seatle london

1. Your first task is to determine the structure of employees table.

2. The Hr department needs a query to display all unique job title from employees table

3. The Hr department has requested a report of all employees and their job titles. Display the Name concatenated with the Job id. (Separated by comma and space) and name the column Employee and Title.

4. To familiarize yourself with the data in employees table. Create a query that will display all

the data from the table, separate each column output by comma. Name the column title as The Output.

5. Create a report that displays the name of all employees. Arrange the query in ascending order by birthday.

You might also like