SQL and Data Modeling Jeopardy

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

More Diagramming & Practice with Relationship Modeling
5th Annual Innovation Challenge Kick-Off and Overview Info Sessions 1 & 2 Fall 2014 September 9 & 22
How to make this Jeopardy game work for your topic Make sure that as soon as you start editing it to make your own game, you save it under that name.
ENTITY RELATIONSHIP MODELLING
Final Jeopardy Question Type Category 1 Here. Type Category 2 Here 100 Type Category 4 Here Type Category 5 Here Type.
How to make this Jeopardy game work for your topic Make sure that as soon as you start editing it to make your own game, you save it under that name.
1 LBSC 690: Week 9 SQL, Web Forms. 2 Discussion Points Websites that are really databases Deep vs. Surface Web.
Utility Service Database Design a database to keep track of service calls for a utility company: Customers call to report problems Call center manages.
Interpreting SQL Code. SQL (The language used to query a database) S is used to specify the you want to include. F is used to specify the the selected.
Seminar #1 – Refreshing databases concepts and SQL CM036: Advanced Databases1 Seminar 1: Revisiting Databases and SQL Purpose To refresh basic concepts.
Get to know Access 2007 Access does data Access does data. All kinds of data. From customer contacts, billing hours and inventory to diet and exercise.
Bellezza Management Salon
Steps To creating a club COLLEGE EDITION. Step 1 GATHERING MEMBER Step 1. Gathering member  The club should gathering a group of people that have common.
Introduction to Databases. Overview  What is a Database?  What is a Database Management System?  How is information organized in a database?  What.
SQL in Action Amit Bhawnani & Nimesh Shah. Basic Structure SQL is based on set and relational operations with certain modifications and enhancements A.
Microsoft ® Office Access ™ 2007 Training Get to know Access ICT Staff Development presents:
Once in a lifetime opportunity International business competition for undergraduates compete against 23 other countries worldwide Three great reasons.
1.09 Process the sale to complete the exchange. Process telephone orders.
Jeopardy A team game designed to help students achieve their educational goals.
INLS 623– S QL Instructor: Jason Carter. SQL SELECT DISTINCT SELECT DISTINCT column_name, column_name FROM table_name ;
Do you know Your HP Plus Terminology?. Rules of the Game 3 Teams 21 questions Teams take turns answering questions If the team answering is incorrect,
1 ICOM 5016 – Introduction to Database System Project # 1 Dr. Manuel Rodriguez-Martinez Department of Electrical and Computer Engineering University of.
Running a business Skills & Experiences. What is business?
Jeopardy Category 1 Category 1 Category 2 Category 3 Category 4 Category
Business Development Services 1 What’s your pricing strategy? Session 6.
Don’t know who your best customer is? Not sure which product sells the best? Piles of paper laying around and you just can’t keep your sales or jobs in.
Dictionary discovery Library Activity.
Database Implementation The Brick Tavern Inn Alonzo Harding, Eric Lukens, Tony Wu.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
BUS 630 Week 5 DQ 2 Perverse Affects of Some Performance Measures To purchase this material link
Spelling and Expansion
Власенко Юлия Сергеевна, учитель математики МОУ ООШ №5 г. Качканар
Database Design: Conceptual Model and ER Diagramming
Calculations & Parameters
Data Visualization Jeopardy
Entity-Relationship Model
MySQL Transaction.
Customer Service Manager
ER Modeling Case Studies
College application process
College application process
POS 410 Competitive Success/snaptutorial.com
MAT 510 Education for Service-- snaptutorial.com.
MAT 510 RANK Education Your Life - mat510rank.com.
POS 410 Education for Service-- snaptutorial.com.
CTO List By INFOS B4B. CTO Mailing List Take a demonstration of our CTO Mailing List and share your experience with us. we recommend you to buy.
POS 410 Teaching Effectively-- snaptutorial.com
GETTING HOLD OF TICKETS FOR THE ENGLISH PREMIER LEAGUE.
Lead Generation for the real world
Accomplishments Stories Workshop SOAR/STAR
Unit 1: Business Activity Knowledge Organiser
College application process
Introduction to Business
Bookstore DB Requirements
Instruction Assignment #1 (due May 16, 2018)
QMS Quotation Management System.
1. Dashboard 1 2 The Dashboard provides a summary of all the relevant information of your Back Market account. 1 Check your average customer rating, a.
Chapter 2: The Balance Sheet 1.
ER Modeling Case Studies
4/25/2012 Your Quarterly Project
2018 Trails-End Popcorn Training
ER Modeling Case Studies
New Employee Orientation
H2.9b Maintain Information
New Employee Orientation
Economic Understandings
New Employee Orientation
Name of Group Member, Name of Group Member
HubSpot CRM Process Map
Presentation transcript:

SQL and Data Modeling Jeopardy MIST 4610 Summer 2017

Game Format STEP 1 GAME FORMAT Get with your group project team. You will work together when answering the jeopardy questions GAME FORMAT Each query and data model have two levels of difficulty Easy and hard 10 queries (including 2 warm-ups) Each easy query is worth 1 point (warm-ups do not count) Each hard query is worth 2 points (warm-ups do not count) 3 data models (no warm-ups) Easy data model is worth 1 point Hard data model is worth 2 points Hard-ish data model is worth 3 points

Each member of the winning team will get … Game Format GAME FORMAT SCORING 4 easy and 4 hard queries (total of 12 points) 1 easy, 1 medium, and 1 kind of hard data model (total of 6 points) WINNER Each member of the winning team will get … BRAGGING RIGHTS! RUNNER UP gets “nada,” sorry!

Game Rules RULES When you are ready to answer raise your hand. Whoever does it first gets to answer the question first. If the answer is incorrect the group loses points (e.g., -1 if you miss the first easy query) Every group will have a maximum of 10 minutes per query and 15 minutes per data model. If nobody gets the right answer nobody will receive a point

SQL and Data Modeling Jeopardy WARM-UP

SQL – Category “Warming Up” How many sales managers report to the sales VP? SELECT COUNT(*) FROM Employees boss, Employees reports WHERE boss.employeeNumber = reports.reportsTo AND boss.jobTitle REGEXP 'VP Sales' AND reports.jobTitle REGEXP 'Sales Manager';

SQL – Category “Warming Up” Report the product name and total buy price for each product shipped on November 2003. Sort results by shipped date and product name. SELECT productName, shippedDate, sum(buyPrice) FROM Products, OrderDetails, Orders WHERE Products.productCode = OrderDetails.productCode AND Orders.orderNumber = OrderDetails.orderNumber AND YEAR(shippedDate) = 2003 AND MONTH(shippedDate) = 11 GROUP BY productName ORDER BY shippedDate, productName;

SQL and Data Modeling Jeopardy STARTS NOW…

SQL 1 – Category “Easy” List the required date and order number of all orders shipped in November 2003. Sort by required date and order number. SELECT requiredDate, orderNumber FROM Orders WHERE MONTH(shippedDate) = 11 AND YEAR(shippedDate) = 2003 ORDER BY requiredDate, orderNumber

SQL 2 – Category “Easy” List the name and price of each cancelled Porsche product. Sort by highest price to lowest. Format to two decimals. SELECT productName, FORMAT(priceEach,2) AS 'Price' FROM OrderDetails, Orders, Products WHERE OrderDetails.orderNumber = Orders.orderNumber AND OrderDetails.productCode = Products.productCode AND status = 'Cancelled' AND productName REGEXP 'Porsche' ORDER BY priceEach DESC;

SQL 3 – Category “Hard” Find all orders where it took more than a year for the customer to pay for the order. SELECT orderNumber, datediff(paymentDate,orderDate) as DaysTakenToPay, amount as AmountInDollars FROM Payments,Customers,Orders WHERE Payments.customerNumber = Customers.customerNumber AND Customers.customerNumber = Orders.customerNumber AND datediff(paymentDate,orderDate) > 365;

SQL 4 – Category “Hard” Report the total revenue for each sales rep who has completed an order. Format results to show two decimal places. Sort and group results by employee's last name. SELECT lastName, ROUND(SUM(quantityOrdered*priceEach),2) AS 'Total Revenue’ FROM OrderDetails, Orders, Customers, EmployeesWHERE OrderDetails.orderNumber = Orders.orderNumberAND Orders.customerNumber = Customers.customerNumberAND Customers.salesRepEmployeeNumber = Employees.employeeNumberAND jobTitle = 'Sales Rep'GROUP BY lastNameORDER BY lastName;

SQL 5 – Category “Easy” Which country/countries has/have more than 2 offices? SELECT country, COUNT(*) FROM Offices GROUP BY country HAVING COUNT(*) > 2

SQL 6 – Category “Easy” List the e-mail and phone extension for all employees working in Australia. Sort results by e-mail. SELECT email, extension FROM Offices, Employees WHERE Offices.officeCode = Employees.officeCode AND country = 'Australia' ORDER BY email

SQL 7 – Category “Hard” Are there any products that have appeared in all orders? SELECT productCode, productName FROM products WHERE NOT EXISTS                         (SELECT * FROM orders                                WHERE NOT EXISTS                                            (SELECT * FROM orderdetails                   WHERE orderdetails.Productcode = products.productCode                   AND orderdetails.ordernumber = orders.ordernumber));

SQL 8 – Category “Hard” Find the customer name and total credit limit (only if higher than 90000) for all customer accounts that are controlled by William Patterson through the sales representative Andy Fixter. Organize the data by the customer name in alphabetical order. Finally, make sure the columns are labeled for ease of reading by the Marketing Director. SELECT customerName, SUM(creditLimit) AS 'Total Credit Limit', emp.lastName AS 'Sales Rep Last Name', emp.firstName AS 'Sales Rep First Name', boss.lastName 'Boss Last Name', boss.firstName 'Boss First Name' FROM Customers, Employees emp, Employees boss WHERE Customers.salesRepEmployeeNumber = Employees.employeeNumber AND emp.reportsTo = boss.employeeNumber AND boss.firstName = 'William' AND boss.lastName = 'Patterson' AND emp.firstName = 'Andy' AND emp.lastName = 'Fixter' GROUP BY boss.lastName, customerName HAVING SUM(creditLimit) > 90000 ORDER BY customerName;

SQL and Data Modeling Jeopardy BREAK TIME

Data Modeling – Category “Easy” A dairy farmer, who is also a part-time cartoonist, has several herds of cows. He has assigned each cow to a particular herd. In each herd, the farmer has one cow that is his favorite--often that cow is featured in a cartoon. Draw a data model to represent this scenario.

Data Modeling – Category “Medium” A consulting company has assigned each of its employees to a specialist group (e.g., database management). Each specialist group has a team leader. When employees join the company, they are assigned a mentor for the first year. One person might mentor several employees, but an employee has at most one mentor. Draw a data model to represent this scenario.

Data Modeling – Category “Hard-ish” The National Office of Academic Conferences (N. O.A.C.) wants to keep track of the conferences attended by university researchers. It gives you the following information:   A university is identified by its name and located in a particular city. A university has many researchers, each of whom can only be associated with only one university. A researcher is identified by an identification number, and has a name, phone, and email address. A researcher can attend many conferences. A conference is identified by an identification number; it also has a name, a location, and a date. For each conference, a researcher may or may not present a scientific research paper. For each conference, one university is in charge of its logistics, while another university is in charge of its marketing. A university can be involved in either role with any conference.

Data Modeling – Category “Hard-ish”