Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

AIR UNIVERSITY

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

EXPERIMENT NO 1

Lab Title: SQL Server Installation & Commands Introduction


Student Name: Umar Mustafa Reg. No: 200365
Objective: Introduction to SQL. .
.
.
LAB ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes
(5) (4) (3) (2) (1)
Ability to Conduct
Experiment
Ability to assimilate the
results
Effective use of lab
equipment and follows
the lab safety rules

Total Marks: Obtained Marks:

LAB REPORT ASSESSMENT:


Excellent Good Average Satisfactory Unsatisfactory
Attributes
(5) (4) (3) (2) (1)

Data presentation

Experimental results

Conclusion

Total Marks: Obtained Marks:

Date: Signature:
AIR University Islamabad DBS LAB

LAB TASKS

Task1:
Create a database with a suitable by using the specified query.

CREATE TABLE lab1 (


Name varchar(25),
Reg_No int,
Courses varchar(255),
Course_Code int,
Offered_By varchar(255)
);

Task2:
Create a table named as lab 1 in your database. Choose any relevant fields
of your choice to define the structure of table. Display the table using select
command.

CREATE TABLE lab1 (


Name varchar(25),
Reg_No int,
Courses varchar(255),
Course_Code int,
Offered_By varchar(255)
);
INSERT INTO lab1 (Name, Reg_No, Courses, Course_Code, Offered_By)
VALUES
('Ali', '01', 'DIP', '1001', 'Mr.A'),
('Umar', '02', 'DLD', '1002', 'Mr.X'),
('Junaid', '03', 'DBS', '1003', 'Mr.Y'),
('Hamza', '04', 'DIP', '1002', 'Mr.X'),
('Ahmed', '05', 'MLI', '1001', 'Mr.A'),
('Maaz', '06', 'ENG', '1003', 'Mr.Y'),
('Usama', '07', 'MLI', '1004', 'Mr.H'),
('Imtiaz', '08', 'ENG', '1003', 'Mr.Y'),
('Hassan', '09', 'DIP', NULL, NULL),
('Mutahir', '10', NULL, NULL, NULL);

select* from lab1;

2
AIR University Islamabad DBS LAB

Output:

Task3:
Write down a query that displays the current of date and time of your PC.

Select GetDate() AS 'CurrentDATETime';

3
AIR University Islamabad DBS LAB

Learning Outcomes:
 SQL allows you to query the database in a variety of ways, using English-like statements.
It is used on websites for back-end data storage and data processing solutions (for example,
Facebook uses SQL).
 The objective of a database management system is to facilitate the creation of data
structures and relieve the programmer of the problems of setting up complicated files.
 Data base management systems have developed from a concept of the data base as
something distinct from the programs accessing it.

You might also like