0% found this document useful (0 votes)
33 views8 pages

Lab 2

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)
33 views8 pages

Lab 2

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/ 8

LAB 2

Submitted by:
M Noman Ashraf
22011519-061
BSCS IVA

Submitted to:
Ms. Rabeeha Fazal
LAB 2
Installing SQL server, creating database using queries and wizards, creating
tables using query and wizards.

Installing SQL server and walkthrough


Control Panel
Starting Apache & MySQL

Starting http://localhost/phpmyadmin

Click on this button to


open localhost.
Interface

From Here you can explore


some already created
databases and create your own
custom database by clicking on
NEW
• Creating Database Using Wizards:
1. Open XAMPP and connect to your SQL Server instance.
2. In Object Explorer, right-click on the "Databases" node.
3. Choose "New Database...".
4. In the New Database dialog:
• Enter the name of the database, e.g.,
"InventoryManagementSystem".
• Optionally, configure other settings such as file locations and file
sizes.
5. Click "OK" to create the database.

• Creating Database Using SQL Queries:

Open SQL Server Management Studio (SSMS) and connect to your SQL
Server instance.
Open a new query window.
Use the following SQL statement to create a new database for your
inventory management system.
Copy code:
CREATE DATABASE InventoryManagementSystem;
This query will create a database named "InventoryManagementSystem".
You can adjust the name as needed.
Creating Tables using queries and wizards

• Tables using wizard.


1. Access phpMyAdmin: Start your XAMPP server and navigate to
the phpMyAdmin interface. You can usually access it by going
to http://localhost/phpmyadmin in your web browser.
2. Login: If prompted, enter your MySQL username and password
to log in to phpMyAdmin.
3. Select Database: If you haven't created a database yet, you can
do so by clicking on the "Databases" tab and entering a name
for your database in the "Create database" field. Then, click
"Create".
4. Navigate to the Database: Once your database is created (or if
you already have one), click on its name in the left sidebar to
select it.
5. Create Table: With your database selected, click on the "SQL"
tab in the top menu to open the SQL query window.
• Tables using SQL

Copy the below code and paste into the console:


CREATE TABLE Products (
ProductID INT AUTO_INCREMENT PRIMARY KEY,
ProductName VARCHAR(255),
Description TEXT,
QuantityInStock INT,
Price DECIMAL(10,2),
SupplierID INT
);

You might also like