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
 database used in SQL : The Complete Reference

Author  Topic 

levis lover
Starting Member

2 Posts

Posted - 2010-09-02 : 15:11:56
Hi friends,
this is my first post and i have just started learning sql.
I bought this book SQL : The complete reference but i could not find the readymade database on which whole book is based. I dont have that much knowledge that i can re-built that database. I need that database to practice the joins and unions. Can anyone please provide me the link to that ?

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-02 : 15:22:19
which database is it? Northwind? AdventureWorks?

http://sqlserversamples.codeplex.com/

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en
Go to Top of Page

levis lover
Starting Member

2 Posts

Posted - 2010-09-02 : 15:33:49
this one

[URL=http://img340.imageshack.us/i/92075010.jpg/][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-02 : 15:46:09
This will get you started:
CREATE TABLE SALESREPS (
EMPL_NUM int NOT NULL,
NAME varchar(50) NOT NULL,
AGE int,
REP_OFFICE int,
TITLE varchar(30),
HIRE_DATE datetime,
MANAGER int,
QUOTA money,
SALES money);

CREATE TABLE PRODUCTS(
MFR_ID char(3) NOT NULL,
PRODUCT_ID varchar(5) NOT NULL,
DESCRIPTION varchar(60) NOT NULL,
PRICE money NOT NULL,
QTY_ON_HAND int);

CREATE TABLE ORDERS(
ORDER_NUM integer NOT NULL,
ORDER_DATE datetime NOT NULL,
CUST int NOT NULL,
REP int NOT NULL,
MFR char(3) NOT NULL,
PRODUCT varchar(5) NOT NULL,
QTY int NOT NULL,
AMOUNT money NOT NULL);

CREATE TABLE OFFICES(
OFFICE int NOT NULL,
CITY varchar(40) NOT NULL,
REGION varchar(20) NOT NULL,
MGR int NOT NULL,
TARGET money NOT NULL,
SALES money NOT NULL);

CREATE TABLE CUSTOMERS(
CUST_NUM int NOT NULL,
COMPANY varchar(80) NOT NULL,
CUST_REP int NOT NULL,
CREDIT_LIMIT money NOT NULL);
I didn't do primary or foreign keys, but you can probably figure them out, or they'll have them in the book. Same goes for inserting data, there should be some examples you can use.
Go to Top of Page
   

- Advertisement -