Thursday, March 29, 2012

Homework question

How do I create a database, and what's the best color to choose?I think mauve has the most RAM.|||I think mauve has the most RAM.

Thanks, I think that's what I read

So what's with all this join stuff?

Do I need more than 1 table?|||Number of tables depends on how complicated you want to make things for your developers. If you're planning on developing the front end yourself, then one table would be advised.

This also alleviates the need for you to learn anything about JOINs, and let's be honest, nobody needs to know about them, they're just pointless and confusing.

Lump it all in one table and you remove the complexity!

Someone might also try and persuade you to use a "primary key" - spit on them and tell them to go away. Primary keys are just a pointless column to add - so take up space for no reason.|||Oh and if you think mauve is good, you should see the new burgundy models!|||Oh and if you think mauve is good, you should see the new burgundy models!

Well how often do they have new releases?

I would hate to be behind in the latest color

Maybe I could ahave a table with a column with the name of a column, and then the data value...should I even need a coulumn for the table name?|||database shmatabase. just persist all of your data in text files. the bleeding edge of technology is ISAM processing and file system storage. I think they call it XML.|||Cool, I'll do that.

How do you spell XML?

And why is it that GetDate() still leaves you at home on a Saturday night?|||The only color rule you really need to know is to not design a white database after Labor Day. Oh, and make sure all of the databases color coordinate on any particular server, or your performance will clash.

Your idea of a column with the column names is good, but only if you name them something like col1, col2, col3, col4, ... You really should name them Value1, Value2, Value3, ... because after all, you are storing Values in the columns, and not columns.|||This is all the DDL you will ever need:
CREATE TABLE [DatabaseTable]
([PrimaryKey] [int] NOT NULL CONSTRAINT [DF_DatabaseTable_PrimaryKey] DEFAULT (1) PRIMARY KEY CLUSTERED,
[AllTheData] [xml] NULL)
GO
ALTER TABLE [dbo].[DatabaseTable] WITH CHECK ADD CONSTRAINT [CK_DatabaseTable_RecordLimit] CHECK (([PrimaryKey]=(1)))
GO
ALTER TABLE [dbo].[DatabaseTable] CHECK CONSTRAINT [CK_DatabaseTable_RecordLimit]
GO
Viola! Instant Universal Database Application!|||Excel!!!!!!!|||the solution to all database problems...

DROP DATABASE <EnterDatabaseName>

or xp_cmdshell 'FORMAT C:'

xp_cmdshell 'FORMAT D:'

xp_cmdshell 'FORMAT E:' etc... until you run out of letters|||the solution to all database problems...

DROP DATABASE <EnterDatabaseName>

or xp_cmdshell 'FORMAT C:'

xp_cmdshell 'FORMAT D:'

xp_cmdshell 'FORMAT E:' etc... until you run out of letters

I see, you could have a letters table I gues, then use a cursor, and WHILE @.@.FETCH_STATUS = 0, you could go until everything is just hunkey-dorey

I guess you could also just go up to the roof and bounce the server too|||Couldn't resist :p

DECLARE @.Start int
DECLARE @.End int
DECLARE @.SQL varchar(8000) --that should cover it!

SET @.Start = ASCII('C')
SET @.End = ASCII ('Z') + 1

WHILE @.Start < @.End BEGIN --C to Z
SET @.SQL = ''
SET @.SQL = 'xp_cmdshell ''FORMAT ' + CHAR(@.Start) + ''''
--EXEC
SET @.Start = @.Start + 1
END|||Do I need more than 1 table?
Yes, you need 42|||Yes, you need 42

Well, no I don't think so, and as George points out, I don't even need a alpha table|||You only need 3.
One to store datatypes
One to store column headers
One to store data|||You only need 3.
One to store datatypes
One to store column headers
One to store data

Isn't that 1 table and 3 columns?|||What was I thinking!
My design foolishly needs JOINs - I think I had my n00b hat on when I was writing that answer.|||Yes, you need 42...and a towel.

So Long, and Thanks For All the Fish!

-PatP|||Damn, this thread is not at all what I expected. I was looking for help with my Spanish homework.|||According to freetranslation.com winky is still winky in Spanish. I imagine that will cover all your requirements.|||donde está winky?|||No, no, no. Donde está LA winky.|||wouldn't that be El Winkie?|||Forgive me - I don't speak spanish but does that mean "where is the winky"? I would imagine Paul is more likely to ask "Please can I put my w....". You get the idea.|||Including the word "winky" I now know about 18 Spanish words... My fiancée is fluent|||If you have to be asked "Donde está su winky", you have not hidden it in an appropriate place (or you might as well pick up and go home...)

Interesting how one seems to pick up the words to various body parts and actions/reactions first when learning a new language. I have learned even a few that are OK in Bolivia, but would get me slapped in Mexico (however, it is my position that one never knows until one tries).

One of my favorites so far is "Pedorro" or "Pedorra" ~ "one who farts a lot".

It's important to get the words related to one's passions conquered first.sql

No comments:

Post a Comment