ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm a SQL beginner and I have a problem with design of tables and SQL queries for my school project so that they are effective. I need to design tables and SQL queries for simple car rental company. The problem is that I have a car and the car is rented for different prices according to month. Let's say:
* 100 per week in January
* 110 per week in Feruary
* etc. etc.
One can rent a car at least for a week but can rent a car for more weeks. The problem I cannot solve in some good way is how to count price of a car in the situation when car is rented for more weeks in different month where prices for week differ. Let's have an exmaple: client want to rent a car from 15.1. till 7.2., so this are two weeks in January and one week in February. The final price would be 100 + 100 + 110 = 310 (don't count weeks in this example; the point is that I have same dates and I need to get the information about prices in between these dates).
The simple algorithm is to get a price for every week and to add these prices then. But this leads to as many SQL queries as weeks I handle. Is it possible to do it in some better way? Can I design the tables and SQL queries in that way that I can get the price in one query?
PS: I use mysql 4.1 but I thnik postgresql is also installed on our school machine (but IAC I don't know the version of it).