Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Testing out Query on Windows

Author  Topic 

markie88
Starting Member

3 Posts

Posted - 2012-01-12 : 10:08:45
Hi guys, I am trying to complete some basic queries based on some tables in an excels heet. What I learned in school was mySQL, which I am fairly comfortable with; however, I have no way to test these queries I have written. My laptop is running windows 7.

The tables are as follows:

tblEMP:
employeeID name startDate Title
1 Bob 10/1/2009 Labor Guy
2 Tom 1/1/2010 Warehouse Assistant
3 Larry 2/25/2010 Warehouse Assistant
4 Tina 4/1/2010 Supervisor

tblHours:
employeeID date hours
1 03-May-10 8
1 04-May-10 8
1 28-May-10 4
1 01-Jun-10 8
1 02-Jun-10 8
1 03-Jun-10 8

2 18-May-10 8
2 31-May-10 8
2 01-Jun-10 0
2 07-Jun-10 8
2 17-Jun-10 8
3 28-May-10 8
3 31-May-10 8
3 04-Jun-10 8
3 07-Jun-10 8
4 03-May-10 8
4 19-May-10 0
4 02-Jun-10 8
4 03-Jun-10 8


tblRate:
employeeID rate
1 $7.50
2 $12.00
3 $12.00
4 $22.00

Here are the 5 queries:
1 How many hours and which days did Bob work in the month of June?
2 How many total hours did each employee work in the month of May?
3 What was the total labor spend on warehouse assistants in May?
4 On average, who works the longest days?
5 How many total days did each employee work in May? In June? Compare both of these numbers in 1 query.

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-12 : 10:31:25
ummmm....do you know if you have SQL Server installed somewhere




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

markie88
Starting Member

3 Posts

Posted - 2012-01-12 : 10:39:59
Yes, at work I have Microsoft SQL Server 2008, but I'm not too familiar with it (as far as setting up those tables as a local database on my machine). It keeps asking to connect; I don't want to connect to any of the work servers!
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-01-12 : 10:49:34
SQL is a server product, you need to connect to a server in order to do anything. You can install SQL Express on your home PC (not at work unless OK'd by the IT dept) and use that

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -