dbTalk Databases Forums  

General Help on Query Writing, With Defined Schema

comp.databases.postgresql.sql comp.databases.postgresql.sql


Discuss General Help on Query Writing, With Defined Schema in the comp.databases.postgresql.sql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Nyman
 
Posts: n/a

Default General Help on Query Writing, With Defined Schema - 09-09-2008 , 10:44 AM






Greetings all.

Let's say I've got a database schema like this (with the all-capital terms
in [ ] being the table name) in a PostgresSQL DB:

= = = = = = = = = = = = = = = = = = = = = = =
[PARTY]
PartyID (primary key)
Description
Location

[PARTY_THEME]
Party_ThemeID (primary key)
ThemeID (foreign key 1)
PartyID (foregith key 2)

[PARTY_HOST]
Party_HostID (primary key)
PartyID (foreign key 1)
HostID (foreign key 2)

[THEME]
ThemeID (primary key)
Name

[HOST]
HostID (primary key)
Name
= = = = = = = = = = = = = = = = = = = = = = =

The context here is that I'm a guy with little SQL experience that has to
test this schema for various things before go-live. (Writing what will
essentially be data-integrity test cases as we go forward.) So what I did is
break up the requirement for how the data gets treated and then what I
believe my "test SQL" needs to be:

Requirement: Each party can have one or more themes.
Test SQL: Verify that each PARTY entry has one or more themes after being
entered.

Requirement: 10 parties will be added per week.
Test SQL: Verify that ten parties are in the table at the end of the week.

Requirement: Each party will be assigned one or more host names.
Test SQL: Write a query that checks this after a party is entered.

Requirement: Each party will be assigned one (and only one) location.
Test SQL: Write a query taht checks this after a party is entered.

So what I have is the basic ideas for what I think I should be testing. My
question: is there a resource that can help me figure out how to do this? (I
do know how to write a really basic SELECT statement but what I'm not so hot
at yet is going between tables or knowing how to cross-reference
information, which I think is what I mostly need to do.)

Any help (whether general or specific) is much appreciated.

- Jeff


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.