0% found this document useful (0 votes)
10 views16 pages

DBMS Assignment Kartik Dua 2023UCM2340

Uploaded by

KARTIK DUA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views16 pages

DBMS Assignment Kartik Dua 2023UCM2340

Uploaded by

KARTIK DUA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

DBMS

ASSIGNMENT
___

TANISH
2023UCM2379

DBMS ASSIGNMENT

Kartik Dua
2023UCM2340
2

INSTALLATION AND SETUP

Step 1: Download XAMPP

1. Visit the XAMPP website: Go to the official Apache Friends website at


https://www.apachefriends.org/index.html.
2. Choose the version: Select the version of XAMPP compatible with your operating
system (Windows, macOS, or Linux).
3. Download the installer: Click on the appropriate download link to download the
XAMPP installer.

Step 2: Install XAMPP

1. Run the installer: After downloading, double-click the XAMPP installer file to start the
installation process.
2. User Account Control (Windows only): If prompted by the User Account Control
(UAC), click "Yes" to allow the installer to make changes to your device.
3. Select components: In the setup wizard, you'll be asked to select the components you
want to install. For a basic setup, you can select Apache, MySQL, PHP, and
phpMyAdmin.
4. Choose installation directory: Select the directory where you want to install XAMPP.
The default is usually C:\xampp.
3

5. Start the installation: Click "Next" to begin the installation process. Wait for the
installation to complete.
6. Complete the setup: Once the installation is complete, you can choose to start the
XAMPP Control Panel immediately by checking the box and clicking "Finish."

Step 3: Start XAMPP and Configure the Server

1. Open XAMPP Control Panel: If it's not already open, launch the XAMPP Control Panel
from the Start menu or your chosen directory.
2. Start Apache and MySQL: In the XAMPP Control Panel, click the "Start" button next to
Apache and MySQL to start the web server and database server.
○ If the services start successfully, their status will change to "Running," and the
"Stop" button will become active.
○ If there are issues, check for error messages, such as port conflicts (usually with
port 80 for Apache). You may need to change the port settings in the
httpd.conf file
4

Step 4: phpMyAdmin (for Database Management)

1. Access phpMyAdmin: Go to http://localhost/phpmyadmin in your browser to


manage your MySQL databases.
2. Create a database: Use the phpMyAdmin interface to create a new database, manage
tables, or import/export data.
5

CREATION OF DATABASE

1. Access the Databases tab: Once inside phpMyAdmin, click on the "Databases" tab at
the top.
2. Enter the database name: In the "Create database" section, you'll see a field to enter
the name of your new database. Enter the name “COCS0302”.
3. Create the database: Click the "Create" button to create your new database.

CREATING TABLES IN DATABASE

1. Select your database: After the database is created, you will be taken to the database
structure page. If not, you can click on the database name listed on the left sidebar.
2. Create a table: In the "Create table" section, enter a name for your table and the
number of columns you need, then click "Go".
3. Define table structure: On the next page, you will define the structure of your table by
specifying:
○ Column Name: The name of each column .
○ Data Type: The type of data each column will hold.
6

○ Length/Values: The maximum length or size for each column.


○ Index: If needed, set a column as the primary key (usually id), or set it to be
unique, etc.
○ Auto Increment: For the id column, check the "A_I" box to set it as an
auto-incrementing primary key.
4. Save the table: After defining all columns, click "Save" to create the table.
7

INSERTING DATA INTO TABLES

METHOD 1:

1. Select the table: On the left sidebar, click on the table you just created.
2. Insert data: Click on the "Insert" tab at the top of the table page.
3. Enter data: Fill in the fields with the data you want to insert into the table.
4. Execute the insert: Click "Go" to insert the data into the table.

METHOD 2:

Step 1: Prepare Your Excel Data

1. Organize your data: Make sure your Excel sheet is well-organized, with the first row
containing the column headers that match the fields in your MySQL table.
2. Save as CSV: Save your Excel file as a CSV file:
○ Go to File > Save As.
○ Choose CSV (Comma delimited) (*.csv) from the file type dropdown.
○ Save the file.
8

SAILORS

BOATS
9

RESERVES

Step 2: Import the CSV File into phpMyAdmin

1. Access phpMyAdmin: Open phpMyAdmin by going to


http://localhost/phpmyadmin in your web browser.
2. Select your database: Choose the database where you want to import the data from the
left sidebar.
3. Select your table: Click on the table where you want to import the data. Make sure the
table structure matches the CSV file columns.
4. Go to the Import tab: Click on the "Import" tab at the top of the page.
5. Choose the file: In the "File to Import" section, click "Choose File" and select the CSV
file you saved earlier.
6. Set the format: Make sure the format is set to "CSV" and adjust the following settings
as needed:
○ Fields terminated by: Enter a comma (,).
○ Fields enclosed by: Optionally, enter a double-quote ("), if your fields are
enclosed in quotes.
○ Lines terminated by: Leave as the default (\n).
○ Column names: If your CSV file includes headers, check the box that says
"Ignore the first line."
7. Start the import: Click "Go" to begin the import process.
10
11
12

CREATED TABLES

SAILORS

BOATS
13

RESERVES
14

CREATING RELATIONSHIP BETWEEN TABLES

1) Set primary keys for respective tables.


● SID for sailors.
● BID for boats.
● SID, BID, DAY, TIME_SLOT for reserves.
15

2) Use the create relationship mode in the designers menu of the database. Add foreign key
and reference key.
16

You might also like