Exam #2 Review with Answers.  The entire exam will be on the computer  You can use search engines, Oracle SQL help, notes, books, and PPT’s  You can.

Slides:



Advertisements
Similar presentations
Cheryl Jelks Trainer/Applications Support Analyst Richland School District One.
Advertisements

Importing Data from a Spreadsheet that contains Phone Numbers, ZIP Codes and other similar string data that looks like a number If you came to this presentation.
DATABASE BASICS: INSERTING AND FORMATTING DATA EXCEL 07 SESSION II.
Start First step Create a new blank database Create a database using the option that will enable you to build your database using pre-set options. Save.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Need your MyMathLab card with your access code Need a Valid Address Need to know Purdue’s zip code is and your course ID for your Class You.
DATA, DATABASES, AND QUERIES Managing Data in Relational Databases CS1100Microsoft Access - Introduction1.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
DATA, DATABASES, AND QUERIES Managing Data in Relational Databases CS1100Microsoft Access - Introduction1 Created By Martin Schedlbauer
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
Access 2007 Database Application Managing Business Information Effectively BCIS 1 and 2.
1 IT420: Database Management and Organization SQL - Data Manipulation Language 27 January 2006 Adina Crăiniceanu
MyBCommLab First Day of Class Registration Walkthrough.
Lesson 1 -What is a Database? -Fields and Records
Relational Database Management Systems. A set of programs to manage one or more databases Provides means for: Accessing the data Inserting, updating and.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
SQL 101 for Web Developers 14 November What is a database and why have one? Tables, relationships, normalization SQL – What SQL is and isn’t – CRUD:
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
1 What is database 2? What is normalization? What is SQL? What is transaction?
10 Copyright © 2009, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
EXAM-2 OVERVIEW Aliya Farheen
SELECT select_list FROM table_1 [INNER] JOIN table_2 ON join_condition_1 [[INNER] JOIN table_3 ON join_condition_3] …
Presented By: Gail Rose-Innes Camps Bay High School ICT & CAT Department Microsoft Access 2010.
CS1100: Microsoft Access Managing Data in Relational Databases Created By Martin Schedlbauer CS11001Microsoft Access - Introduction.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Database Management Systems.  Database management system (DBMS)  Store large collections of data  Organize the data  Becomes a data storage system.
Copyright © 2007 Verizon Foundation. All Rights Reserved. This document may be reproduced and distributed solely for uses that are both (a) educational.
4a. Structured Query Language - SELECT Statement Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets.
Conversion Functions.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Microsoft Access is a database program to manage sort retrieve group filter for certain records.
Planning & Creating a Database By Ms. Naira Microsoft Access.
SQL-5 In-Class Exercise Answer IST 210 Organization of Data IST2101.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
SQL SELECT Getting Data from the Database. Basic Format SELECT, FROM WHERE (=, >, LIKE, IN) ORDER BY ; SELECT LastName, FirstName, Phone, City FROM Customer.
CS 111 – Nov. 8 Databases Database Management Systems (DBMS) Structured Query Language (SQL) Commitment –Please review sections 9.1 – 9.2.
FINAL EXAM OVERVIEW Aliya Farheen
WEEK# 12 Haifa Abulaiha November 02,
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
Manipulating Data Lesson 3. Objectives Queries The SELECT query to retrieve or extract data from one table, how to retrieve or extract data by using.
+, -, *, / Mathematical operators ABS(value) Returns the absolute value SIGN(value) Returns the sign of a value, such as 1, -1, 0 MOD(value,divisor) Returns.
COMP 430 Intro. to Database Systems Grouping & Aggregation Slides use ideas from Chris Ré and Chris Jermaine. Get clickers today!
Simple Queries DBS301 – Week 1. Objectives Basic SELECT statement Computed columns Aliases Concatenation operator Use of DISTINCT to eliminate duplicates.
EXAM-2 OVERVIEW Aliya Farheen
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
For more course tutorials visit CIS 336 All iLabs Week 1 to Week 7 Devry University CIS 336: All iLabs Week 1 to Week 7: Devry University.
Notes: **A Row is considered one Record. **A Column is a Field. A Database is…  an organized set of stored information usually on one topic  a collection.
Welcome to Placement Testing at Rutgers University- Newark! *Please hit enter only one time to begin the presentation* English Only Test.
Welcome to Placement Testing at Rutgers University- Newark! *Please hit enter only one time to begin the presentation* Math/English Test.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Retrieving Information Pertemuan 3 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
2b. Create an Access Database Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets 1.
Mail Merge Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter.
English Only Test Welcome to Placement Testing at Rutgers University-Newark! *Please hit enter only one time to begin the presentation*
Math/English Test Welcome to Placement Testing at Rutgers University-Newark! *Please hit enter only one time to begin the presentation*
Open Source Server Side Scripting Permissions & Users
PHP and MySQL.
Introduction To Databases GCSE Computer Science
How to create query table with computation
Lecture 3 Finishing SQL
Lesson 3 Chapter 10.
Introduction To Databases GCSE Computer Science
Akhila Kondai Exam-2 overview Akhila Kondai
PHP and MySQL.
Topic 12 Lesson 2 – Retrieving Data with Queries
Presentation transcript:

Exam #2 Review with Answers

 The entire exam will be on the computer  You can use search engines, Oracle SQL help, notes, books, and PPT’s  You can NOT use other people, , phone a friend, text a friend, etc.  When you complete all of the questions, zip up the SQL and submit through Angel  Drop Box for Exam #2  When you are finished, please verify that I have received your file BEFORE you leave class  You will have the entire 1 hour and 15 minutes to complete the exam

 Select statements  Select clause  From clause  Where clause  Group by clause  Having clause  Order by clause

 Additional topics  Equijoins  Subqueries  Row functions  Aggregate functions  And, or, not logic  Dates  Number and character functions

 Using the Student table  How many students are in this table?  List the first and last names of the students using this format: lastname, firstname ▪ Notice the space between the comma and firstname  List the area code of the phone number  List all unique registration dates  List the number of students that registered on each registration date

 Using the appropriate table(s)  How many cities per state are there currently listed in our database? ▪ List in alphabetical order  List the states that have at least 60 unique cities currently listed in our database ▪ List in alphabetical order  (1) List all sections that have a start date time of May 4, 2007  (2) List all sections that have a modified date of Jan 2, 2007  Explain the following difference between query (1) and (2) by writing the appropriate query ▪ To find the start date time of May 4, 2007 you needed to use the trunc function ▪ Why did the start date time search require the trunc function? ▪ To find the modified date of Jan 2, 2007 you did not need to use trunc ▪ Why did the modified date search not require the trunc function?

 Using the appropriate table(s)  List the first name, last name and section id for all students actually enrolled in a section  List how many classes each student is currently taking

-- How many students are in this table? SELECT count(*) FROM student.student; -- List the first and last names of the students using this format: lastname, firstname SELECT last_name || ', ' || first_name from student.student; -- List the area code of the phone number SELECT phone, substr(phone, 1, 3) as AreaCode from student.student; -- List all unique registration dates SELECT DISTINCT(registration_date) FROM student.student;

-- List the number of students that registered on each registration date SELECT registration_date, count(*) FROM student.student group by registration_date; -- How many unique cities per state are there currently listed in our database? -- List in alphabetical order. SELECT state, count(distinct city) FROM student.zipcode GROUP BY state ORDER BY state; -- List the states that have at least 60 unique cities currently listed in our database. -- List in alphabetical order. SELECT state, count(distinct city) FROM student.zipcode GROUP BY state Having count(distinct city) > 59 ORDER BY state;

-- List all sections that have a start date of May 4, Using format shows that this field contains a 09:30:00 value for time SELECT section_id, to_char(start_date_time, 'DD-MON-YYYY HH24:MI:SS') FROM student.section WHERE trunc(start_date_time) = '04-May-07'; -- List all sections that have a modified date of Jan 2, Using format shows that this field contains a 00:00:00 value for time SELECT to_char(modified_date, 'DD-MON-YYYY HH24:MI:SS') FROM student.section WHERE modified_date = '02-Jan-07';

-- Explain the following difference between query (1) and (2) by writing the appropriate query -- To find the start date time of May 4, 2007 you needed to use the trunc function -- Why did the start date time search require the trunc function? -- To find the modified date of Jan 2, 2007 you did not need to use trunc -- Why did the modified date search not require the trunc function? -- ANSWER: The start_date_time column was loaded with a time other than 00:00:00 -- The modified_date was loaded without a time, in other words, 00:00:00 -- So when you search on modified date without the trunc function it looked for a 00:00:00 -- time and found it. The start_date_time value did not have a 00:00:00 value so you -- needed to use the trunc function to eliminate the time value from the where clause -- search. -- List the first name, last name and section id for all students actually enrolled in a section SELECT s.first_name, s.last_name, e.section_id FROM student.student s, student.enrollment e where s.student_id = e.student_id;

-- List how many classes each student is currently taking SELECT e.student_id, s.first_name, s.last_name, count(e.section_id) FROM student.student s, student.enrollment e where s.student_id = e.student_id GROUP BY e.student_id, s.first_name, s.last_name order by e.student_id;

 Exam #2  If you do not attend class, You must contact me immediately ▪ This test is entirely computer-based ▪ Thus it will NOT be placed in the Test Center ▪ This is your responsibility! ▪ You will have until 12:00 p.m. (noon) on Friday, November 1 st to complete the exam ▪ If you do not complete the exam, you will earn 0 points for this exam score