Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Databases and faggotry

Name: Anonymous 2009-05-13 6:19

I have an exam in some basic IT shit in a few hours. Never had classes in it, never even touched upon some of the subjects I am to cover -- I'm just taking the exam for the sake of it.

Databases is one of these things. Easy as fuck to learn on my own, but I have no time, so I seek your help.

Say I have 10 cabins that I rent out to niggerfaggots. What's the best way to record which dates each cabin is being rented? Do I create a separate table for each cabin or is there a quick, simple and more elegant, general way of doing this?
Also, how do I implement a form on a webpage allowing the user to pick a cabin and rent it from date A to date B, given that it's not occupied already?

Using MS Access for the databases and MS Expression Web for the shitty WYSIWYG HTML-shit. Never used either program before in my life.

Halp plox.

Name: Anonymous 2009-05-13 6:22

niggerfaggots
Stopped reading there, please go back to /b/.

Besides,this is pretty basic, if you can't come up with a solution yourself there's no way for you to actually make it in that exam.

Name: Anonymous 2009-05-13 6:23

you're right, that is easy.

Name: Anonymous 2009-05-13 6:34

>>1
Your going to fail for not going to class.  No one will help you.  It's your own fault.

Name: Anonymous 2009-05-13 7:01

>>3,4
Use sage please.
>>1
Too bad.

Name: Anonymous 2009-05-13 7:09

Yes, create a separate table for each cabin with a column for the date and a column for if the cabin is booked on that date. Insert rows for every date from now up until a years time or something similarly far in the future, and every day run a process to append the next date onto the end of that table. Although, for efficiency you probably want to have a different table for each cabin and year too. When someone books a room, delete the row for that date and insert a new one with "BOOKED" in the other column. To determine if a cabin in booked for that date, use a loop to go through all the rows in the table checking for that date and if the other column says "BOOKED".

As for your web page, just use text boxes so the user can type in the cabin name and the date, and on the server side, construct your SQL statements from this data by adding strings together, e.g. SQL = "select * from cabin_"+CabinNumber+"_"+YearNumber. Though for added efficiency you might want to do this on the client in Javascript to avoid loading the server, then just pass the SQL statement in directly to the web server which passes it on neatly to the database.

Hope this helps!

Name: Anonymous 2009-05-13 9:28

1-to-n relationships are hard. Let's go shopping!

Name: Anonymous 2009-05-13 10:25

>>6
Thanks, that was just what I needed!

Name: Anonymous 2009-05-13 10:46

Easy as fuck to learn on my own
You've never heard of Oracle is seems

Name: Anonymous 2009-05-13 14:12

>>6
How about some normalization?

Name: Anonymous 2009-05-13 17:07

>>9
Would Sir care for some Sybase to with that, too?

Name: Anonymous 2009-05-13 21:37

>>6

You sir do indeed know your databases. I think that's over 9000th normalised form.

Name: Anonymous 2009-05-13 22:06

That's the kind of thing you learn on the first day of a real class in databases... maybe even the first hour. You're not going to pass the exam if you don't even know that.

Name: Anonymous 2009-05-13 22:15

Easy as fuck to learn on my own, but I have no time, so I seek your help.
Say I have 10 cabins that I rent out to niggerfaggots.
Back to /b/ please

Name: Anonymous 2009-05-13 22:17

>>13
s/in /on

Name: Anonymous 2009-05-14 0:27

<<15
What about my slin lon?

Name: Anonymous 2009-05-14 0:39

>>15
sed: 1: "s/in /on": unterminated substitute in regular expression

Name: Anonymous 2009-05-14 5:48

>>6
Excellent advice there, YOU HELPED HIM!

Name: Anonymous 2009-05-14 5:58

>>6
YOU HELPED HIM!!!

Name: Anonymous 2009-05-14 21:08

Don't take >>6's advice. He advocated the worst possible database and web development practices to make you look even more of an idiot than you already are.

Name: Anonymous 2009-05-14 21:13

>>20
ಠ_ಠ get out

Name: Anonymous 2009-05-14 22:04

Don't take >>20's advice. He advocated the worst possible database and web development practices to make you look even more of an idiot than you already are.

Name: Anonymous 2011-04-07 17:55

[sup]\[/sup]test//

Name: Anonymous 2011-04-07 17:55

[sup]\\[/sup]test//

Name: Anonymous 2011-04-07 17:57

\\test//

Don't change these.
Name: Email:
Entire Thread Thread List