Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Sunday, March 25, 2012

Books in Spanish for Database Design and Normalisation?

Hi,

Can anyone recommend books in Spanish for Database Design and
Normalisation?

Puede alguien recomendar libros en espaol para Diseo de Base de
datos y Normalizacin?

Thanks,
Michael Holberton
Hospedaje Los Jardines & Sacred Valley Mountain Bike Tours
Cusco Database Development and Cycling Services
http://www.machawasi.com/
http://machawasi.blogspot.com/
http://databaseservices.blogspot.comOn Oct 21, 5:17 am, mtbvfr <ServiciosDeCiclismoDelP...@.gmail.com>
wrote:

Quote:

Originally Posted by

Can anyone recommend books in Spanish for Database Design and
Normalisation?


There is a Spanish language edition of Ramez Elmasri's Fundamentals of
Database Systems. Look up the author on Amazon and it should pop up
somewhere on the list.

I have used the English version of this book on courses in database
theory. It does cover a wide range of material in a very stringent
manner. However, it never exactly became my students' favorite book -
it is somewhat dense and dry. If you make the effort, however, it does
provide a good basis.

Bo Brunsgaardsql

Bookmarks in HTMLFragment

I have a lengthly report that by business design uses the report webservice
and HTMLFragment mode. Using the report toolbar is not an option.
I would like to have a "bookmark toc" near the top of the report to jump to
bookmarks lower in the document. However, like others have found, the
bookmark functionality is not supported in HTMLFragment mode.
Is there any way to get bookmark functionality to work in HTMLFragment mode?
As a workaround, I believe I cound insert my own bookmarks in the HTML
stream returned from the Render call using regular expressions, but I would
really hate to go to all that trouble if there was a better way.
Thanks Much, DavidHi David,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you would like to use bookmarks
HTMLFragment in HTMLFragment mode. If I have misunderstood your concern,
please feel free to point it out.
Unfortunately, I am afaraid there is no better workaround now.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, March 22, 2012

booking db design help

Hey Guys,
I am trying to create a web app that uses an SQL db to handle employee
scheduling. I can design a table to hold the appointments with no problems
but I need to be able to search for free time for the employees.
all bookings are based on 30 minutes blocks.
So far I managed to create all tables and this is what I have concerning the
booking tables "after seeing this post on
http://www.webservertalk.com/archiv...-9-1206387.html due to my lack
of DB design I am having a hard time understanding the solution.
eventually I need to be able to achieve the search using similar statement
to this
select min(starttime)
from schedule
where usedflag='free'
and duration >= :desired_duration
but I am having a problem with tables structure.
would someone explain the structure posted please?
thanks in advancesammy
It ishard to suggest soemthing without seeing the actual data and some DDL
Take a look at Itzik Ben-Gan's example showing the intreval connections to
the internet and resturns the connections was made less than 5 minutes
create table tblConnection
(
StartTimeCon datetime not null,
EndTimeCon datetime not null
)
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
10:00','20000610 10:10')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
10:20','20000610 10:22')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
10:23','20000610 10:25')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
10:27','20000610 10:45')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
11:57','20000610 12:00')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
12:01','20000610 12:04')
insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
12:04','20000610 12:40')
select * from tblConnection
SELECT
StartTimeCon,
ISNULL(
(SELECT MIN(EndTimeCon)
FROM tblConnection AS S3
WHERE S3.StartTimeCon >= S1.StartTimeCon
AND ISNULL(
DATEDIFF(
minute,
S3.EndTimeCon,
(SELECT MIN(StartTimeCon)
FROM tblConnection AS S4
WHERE S4.StartTimeCon > S3.EndTimeCon)), 5) >= 5),
EndTimeCon) AS EndTimeCon
FROM tblConnection AS S1
WHERE ISNULL(
DATEDIFF(
minute,
(SELECT MAX(EndTimeCon)
FROM tblConnection AS S2
WHERE S2.EndTimeCon < S1.StartTimeCon),S1.StartTimeCon),5) >= 5
"sammy" <sammy1971@.hotmail.com> wrote in message
news:ejgXXazbGHA.4672@.TK2MSFTNGP04.phx.gbl...
> Hey Guys,
> I am trying to create a web app that uses an SQL db to handle employee
> scheduling. I can design a table to hold the appointments with no problems
> but I need to be able to search for free time for the employees.
> all bookings are based on 30 minutes blocks.
> So far I managed to create all tables and this is what I have concerning
> the booking tables "after seeing this post on
> http://www.webservertalk.com/archiv...-9-1206387.html due to my lack
> of DB design I am having a hard time understanding the solution.
> eventually I need to be able to achieve the search using similar statement
> to this
> select min(starttime)
> from schedule
> where usedflag='free'
> and duration >= :desired_duration
> but I am having a problem with tables structure.
> would someone explain the structure posted please?
> thanks in advance
>
>|||Thanks for the response Uri,
what I am thinking of best way to to describe the data is like this. I will
create a table to hold sku's refering to the services to be booked the
skutable should be something like this
SKuID --PK
Description -- char
Durration -->30 minutes blocks number field where 1 = 30 and 2=60 and so on
The employee table should be like this
EmpID -->PK
Fname
Lname
location
ScheduleID -->FK
the scheduletable should be like this
SID -->PK
sundayStart --> ie 12/06/2006 9:30 AM
SundayEnd --> 12/06/2006 6:00 PM
MondayStart
MondayEnd
TuesdayStart
TuesdayEnd
WedStart
WedEnd
ThurStart
ThursEnd
FridayStart
FridayEnd
SaturedayStart
SatureDayEnd
what I am trying to achieve can be described best as calenday with all
employees, the workdays, starttime, endtime and the times they are available
to take calls "calls are based on 30 minutes blocks incremening by 30
minutes.
I hope that explains the issue better
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uij3ouzbGHA.536@.TK2MSFTNGP02.phx.gbl...
> sammy
> It ishard to suggest soemthing without seeing the actual data and some DDL
> Take a look at Itzik Ben-Gan's example showing the intreval connections to
> the internet and resturns the connections was made less than 5 minutes
> create table tblConnection
> (
> StartTimeCon datetime not null,
> EndTimeCon datetime not null
> )
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 10:00','20000610 10:10')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 10:20','20000610 10:22')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 10:23','20000610 10:25')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 10:27','20000610 10:45')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 11:57','20000610 12:00')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 12:01','20000610 12:04')
> insert into tblConnection(StartTimeCon,EndTimeCon)va
lues ('20000610
> 12:04','20000610 12:40')
> select * from tblConnection
> SELECT
> StartTimeCon,
> ISNULL(
> (SELECT MIN(EndTimeCon)
> FROM tblConnection AS S3
> WHERE S3.StartTimeCon >= S1.StartTimeCon
> AND ISNULL(
> DATEDIFF(
> minute,
> S3.EndTimeCon,
> (SELECT MIN(StartTimeCon)
> FROM tblConnection AS S4
> WHERE S4.StartTimeCon > S3.EndTimeCon)), 5) >= 5),
> EndTimeCon) AS EndTimeCon
> FROM tblConnection AS S1
> WHERE ISNULL(
> DATEDIFF(
> minute,
> (SELECT MAX(EndTimeCon)
> FROM tblConnection AS S2
> WHERE S2.EndTimeCon < S1.StartTimeCon),S1.StartTimeCon),5) >= 5
>
>
> "sammy" <sammy1971@.hotmail.com> wrote in message
> news:ejgXXazbGHA.4672@.TK2MSFTNGP04.phx.gbl...
>|||sammy
Take a look at http://www.aspfaq.com/show.asp?id=2519
"sammy" <sammy1971@.hotmail.com> wrote in message
news:OdtVFi0bGHA.1208@.TK2MSFTNGP04.phx.gbl...
> Thanks for the response Uri,
> what I am thinking of best way to to describe the data is like this. I
> will create a table to hold sku's refering to the services to be booked
> the skutable should be something like this
> SKuID --PK
> Description -- char
> Durration -->30 minutes blocks number field where 1 = 30 and 2=60 and so
> on
> The employee table should be like this
> EmpID -->PK
> Fname
> Lname
> location
> ScheduleID -->FK
> the scheduletable should be like this
> SID -->PK
> sundayStart --> ie 12/06/2006 9:30 AM
> SundayEnd --> 12/06/2006 6:00 PM
> MondayStart
> MondayEnd
> TuesdayStart
> TuesdayEnd
> WedStart
> WedEnd
> ThurStart
> ThursEnd
> FridayStart
> FridayEnd
> SaturedayStart
> SatureDayEnd
> what I am trying to achieve can be described best as calenday with all
> employees, the workdays, starttime, endtime and the times they are
> available to take calls "calls are based on 30 minutes blocks incremening
> by 30 minutes.
> I hope that explains the issue better
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uij3ouzbGHA.536@.TK2MSFTNGP02.phx.gbl...
>

Monday, March 19, 2012

blonde to write query or design fault

Dear All,

Im wondering if its the design that needs to be changed or I simply cant put this together.

I have 3 tables.

1. people (peopId, peopFName, peopSName etc.)
2. codes (codeId, codeName)
3. codedPeople(codePeopleId, peopId, codeId)

Codes represent different skills of people, example the sort of job functions theyve held in their employment. Like:

t-CEO,
t-CFO
t-Founder
etc.

people, clearly holds data about people.

CodedPeople holds data about which people are coded. So person1 can be coded as t-CEO as well t-Founder, and person2 coded as t-CFO

What I need is a query that returns all distinct people records and takes a number of codeNames as input. So if I throw in t-CEO OR t-Founder I get person1, again if I define t-CEO AND t-Founder I get person1.

However when I add t-CEO OR t-CFO I get person1 and person2 but when the query takes t-CEO AND t-CFO I get no result.

I cant seem to come up with anything that would give me a good starting point. Is there a design fault here? All opinions are much appreciated, thanks in advance!"the query takes t-CEO AND t-CFO I get no result."

Is that wrong? No person is t-CEO AND t-CFO in your example.

Please tell us what you want the result to be.|||Thanks for getting back!

Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)

I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CFO, t-Founder)

I also coded person2 as a technology-Chief Financial Officer (t-CFO)

I want to write a query that takes codes as parameters:

t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)

t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)

t-CFO or t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)

Am I describing it correctly?

Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder

I have:

SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName

But thats useless!|||Let me correct that, I have mixed up the similar codes of t-CEO and t-CFO, the correct one is:

Thanks for getting back!

Ok, so I have 3 codes and 2 people in the database. (In reality its about 250 different codes and about 10,000 people, growth is about 5000 / year)

I coded person1 as a technology-Chief Executive Officer and also as a technology-Founder (t-CEO, t-Founder)

I also coded person2 as a technology-Chief Financial Officer (t-CFO)

I want to write a query that takes codes as parameters:

t-CEO AND t-Founder = returns person1 (as hes coded as a t-CEO and t-Founder)
t-CEO OR t-CFO = returns person1 and person2 (as person1 is coded as t-CEO and person2 is coded as t-CFO)

t-CEO AND t-CFO = returns no result ( as no person in the db is coded as both a t-CEO and also a t-CFO)

t-CFO OR t-Founder = returns person1 and person2 (as person1 is coded as a t-Founder and person2 is coded as a t-CFO)

Am I describing it correctly?

Of course the query need to be flexible as Ill using it from ASP.NET dropping in the parameters so codeName Like t-CEO OR codeName Like t-Founder

I have:

SELECT people.peopId, peopFName, peopSName, peopPhoneHome, peopPhoneMobile, peopEmail, codes.codeId, codename
FROM people INNER JOIN codedPeople ON people.peopId = codedPeople.peopId
INNER JOIN codes ON codes.codeId = codedPeople.codeId
WHERE ( ( codeName LIKE 't-CEO' ) OR ( codeName LIKE 't-CFO' ) )
ORDER BY peopSName, peopFName

But thats useless!

Sunday, March 11, 2012

Blocking updates of a table

Hi,
I've been trying to design a way for me to issue a transaction that:
    Block all inserts on a table when row X has a certain value (call it A)
    Add a row to the table with row X containing A Add rows to another table Unblock inserts Commit transaction
Is this possible? Can anyone give me some pointers as to what to do?
Thanks in advance!

For (1) and (2)
While inserting the row that has a certain value (A), you can request a TABLOCKX. This will acquire X lock on the table and there by block other inserts by other concurrent transactions.

For (3): Is it like any other insert to another table? In that case, nothing special needs to be done

Thanks
Sunil Agarwal

|||For 3 that is what I meant.
For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly? Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?
Thanks for your help!
|||For 1 and 2, it sounds like TABLOCKX locks the whole table exclusively (from what I can find in Books Online) - have I read it correctly

sunil> yes

Is there any way to block other transactions from inserting rows (while the first transaction is not yet commited) when a table key column (A in my original post) is a certain value (X in my original post) - rather than just locking the whole table?

sunila> if you only want to block inserts by other transactions under the condition you have mentioned but allow updates/selects, then there is no way.
thanks,|||I assume you only want to block Inserts but not Updates, Deletes and SELECTS.

You could try using an Insert trigger that would rollback the other transactions until a condition has been achieved.

Saturday, February 25, 2012

BLOB in T-SQL

Hi,

can anyone help ,me out here with some design consideration reguarding importing of BLOB data to a SQL server 2000 using T-SQL statements?

I want to make an import of some documents which are stored in a Access database, to an Ms SQL server 2000. The documents are stored in the access database as a OLE Object, by now I thought of using the base64String function to convert the data from the access field and write it to the T-SQL statements which will written in a text batch file. And then I apply the SQL Convert function something like:

INSERT INTO testBin VALUES(convert(image,'base64sting_encoded'))
go

Does this work? Is it correct what I am doing?

Thanks.

one rule i remember about handling blob

is that it needs to be on a separate filegroup to avoid

fragmentation

|||

Access OLE Object column data goes directly into image in SQL Server. So I am not sure why you are doing the convert and it may not really produce the correct results. See below links for more details on Access migration:

http://www.microsoft.com/technet/prodtechnol/sql/2000/Deploy/accessmigration.mspx

http://www.microsoft.com/sql/solutions/migration/default.mspx

See the link below for some great information on when to store BLOBs in the database:

http://research.microsoft.com/research/pubs/view.aspx?type=technical+report&id=1089

|||that was also what i have in mind though i hesitate to say

Sunday, February 12, 2012

Bitmask query?

I'm working on a new app with Sql CE and before I got too deep in DB design, I wanted to make sure that it can support a bitmask query.

What I want is a bit-packed field to handle support for region. So I'd like to be able to take a field (e.,g. [Support]) and do a bitwise and with the current region code and see if it is supported.

I know I could get all the data and write a method to make it work, but was hoping there would be some way to construct a query to only pull down the relevant information.

Thanks

Something like this ?

Code Snippet

CREATE TABLE test (

[id] [int] NULL,

[bitwise] [int] NULL

)

INSERT INTO Test (id, bitwise) VALUES (1, 7)

INSERT INTO Test (id, bitwise) VALUES (2, 1)

INSERT INTO Test (id, bitwise) VALUES (3, 0)

select * FROM test WHERE (bitwise & 1) = 1

(returns 2 rows)

|||That should do it. I thought it would be something similar to that. I just couldn't verify that would work with CE... maybe I need to improve my googling skills Smile Thanks