This is a Hotel Management Project.
My Thinking
I am at a hotel , in that hotel I have a reception, and at the reception there is a computer. Now, in this computer I am maintaining a database where I am storing the records of all my customers, all my employees, etc. I am also providing a Role Based User Access feature which determines which person can perform which tasks.
For example, the person with the Employee permissions can only change data for the customer table to make bookings , generate bills, etc. On the other hand, the admin or the owner has the permissions to update the employee tables such as incrementing their salaries, adding an employee, etc.
For running the code sample on your laptop/PC, please read the following for setup and installation requirements!
Note: I have made a video on the same for further reference. I have explained the installation, given a brief about my code sample and showed how to run the program!
We would be downloading:
Python
SQL
Pymysql module
Note: I won't be showing how to download and setup python.
-
Open a new python shell, click on file and then click on Save As.. Option
-
Once you click on the Save As.. Option , file explorer will open! Select the path at the top of the file explorer
-
Open Command prompt!
-
Enter cd + copied path(ctrl + v) in the terminal
-
Now type "pip install pymysql" in the command line( We are using the pip package manager to download pymysql from the internet)
-
After that press Enter and pymysql package would be downloaded!
- Go to MySQL Download Website
- We would be downloading the community version
- Click on "No thanks, start my download"
- After the installer opens, click on the "Developer Default Option"
- Now specify your Install directory
- Now a button will come up as "Execute", click it! Installation of the required packages will start!
- After the installation is complete, click next until you get to the page below
- This is a very important step. By default your username is kept as "root". You would also have to provide a password at this step for the set up. Please remember the Username and Password you are entering as it would be asked while running the program
- Now keep clicking "Next" and "Execute" and the installation would be done!
Type the following in the Shell:
\sql
\connect root@localhost
Enter your password: "The password you entered during the set up"
You can now use MySQL Shell to check out the tables created for the project
-
The first step is to open your IDE and open the 2 python files given in the repostitory which you can get on you local system by Cloning the repository
-
The first file is to create a database on which we would be working on
-
Just run the "Project Database" python file and a database would be created with sample data for the hotel management system
-
When you run the program , you would have to provide your SQL username and password(Note: If you didn't specify a user name then it is "root" by default), please do so!
-
Now that our database is created, we can use the other python file for managing the hotel management system database
-
Run the other file and you would get a screen asking for your SQL Username and Password. After you fill it you would get the following screen!
The following are the usernames and passwords which you could use to login as an administrator or an employee:
- Username: Saarthak Maini Password:Saarthak@123 Role: ADMIN/OWNER
- Username: Devansh Bhanga Password:Devansh@123 Role:EMPLOYEE
After that you can perform the desired operations as given in the menu