Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using SQL, answer these questions (write a SQL query that answers these questions): For the below schema for a company door: doorlog(eventid,doorid,tim,username,event) Where doorid represents

Using SQL, answer these questions (write a SQL query that answers these questions):

For the below schema for a company door: doorlog(eventid,doorid,tim,username,event) Where doorid represents the door for this event. e.g. Front door may be doorid=1, and bathroom may be doorid=2, etc. tim is timestamp, username is the user who is opening or closing the door. event is "E" for entry, and "X" for exit. Using SQL, answer these questions (write a SQL query that answers these questions):

1. What is the daily average (and standard deveation) occupancy of floor 42 for 2017? (single number)

2. What percentage of the people work on floor 42?

3. What's the average number of times per day that people use the bathroom? (bathroom is doorid=2).

4. What percentage of employees stayed after 5:15PM on July 3rd, 2017?

5. List all employees who left work before 1PM on July 3rd, 2017.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

Students also viewed these Databases questions

Question

Gambling by student and professional athletes

Answered: 1 week ago