Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQl question Expand / Collapse
Author
Message
Posted Monday, November 4, 2013 7:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 14, 2013 6:44 AM
Points: 1, Visits: 1
Hello Guys,
Can you help me to solve these questions?

Employee Customer
id name age salary id name city industry type
1 ben 61 140000 4 bamsonic Cologne J
2 bob 34 44000 6 ranasung Leslieburg J
5 chris 34 40000 7 Vamony Arlington B
7 Dan 41 52000 9 grange Marina B
8 Ken 57 115000
11 Joe 38 38000

Order
Id orderdate Customer_id Employee_id Amount
10 8/2/2006 4 2 540
20 1/30/2009 4 8 1800
30 7/14/2005 9 1 460
40 1/29/2008 7 2 2400
50 2/3/2008 6 7 600
60 3/2/2008 6 7 720
70 5/6/2008 9 7 150


a. The names of all employees that have an order with Bamsonic.
b. The names of all employees that do not have any order with Bamsonic.
c.The names of employees that have 2 or more orders.
Write a SQL statement to insert rows into a table called high_value_employee(name,
age), where an employee must have a salary of 100,000 or greater to be included in
the table.
e. Write the appropriate "CREATE TABLE" statements for all base tables (employee,
customer, order) and shortly describe the choices you made.
f. Which things would you personally improve about this schema? Where do you see
potential problems
Post #1511093
Posted Monday, November 4, 2013 7:20 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, August 29, 2014 4:29 PM
Points: 588, Visits: 900
Is this a homework assignment? The people here are usually not going to do your homework for you, but if you make an attempt at doing the work yourself and get stuck then please post the specific question at that time



Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1511097
Posted Monday, November 4, 2013 7:35 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 4:10 AM
Points: 3,634, Visits: 5,283
Keith Tate (11/4/2013)
Is this a homework assignment? The people here are usually not going to do your homework for you, but if you make an attempt at doing the work yourself and get stuck then please post the specific question at that time


I agree with Keith. If you're learning then you need to put some effort towards it.

Hint: Start with e.



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1511344
Posted Monday, November 11, 2013 9:54 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 12:24 AM
Points: 718, Visits: 545
Some of us could still help you if you had posted your question properly.
Post #1513327
Posted Thursday, November 14, 2013 6:18 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
darwesh1992 (11/4/2013)
Which things would you personally improve about this schema? Where do you see potential problems
Ahh..it seems like its interview question's pool.


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1514244
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse