Database Systems Lab
Database Systems Lab
Laboratory Manual
The laboratory manual is the record of all work on your experiments. A complete, neat, and organized data
record is as important as the experiment itself. Please follow these guidelines for efficient performance in the
laboratory:
1. Attend the lab orientation to familiarize yourself with the lab setup.
3. Write clear and well-documented code, avoiding plagiarism and unauthorized collaboration.
4. Seek help from lab instructors or peers if you encounter difficulties with programming concepts.
5. Regularly back up your code and project files to prevent data loss.
7. If collaboration is allowed, work effectively with peers, ensuring each member contributes meaningfully.
8. Maintain a clean and organized workspace for better focus and efficiency.
9. Thoroughly test your code to identify and fix errors before submission.
10. Engage in lab discussions, share insights, and actively participate to enhance the learning experience.
Safety Precautions
1. Handle equipment carefully to prevent damage and avoid placing liquids near electronic devices.
3. Save work frequently and use surge protectors to prevent data loss due to power issues.
4. Keep software and antivirus programs up to date and avoid downloading from untrusted sources.
6. Establish clear communication and collaboration guidelines when working with others.
I have read all of the above, and I agree to conform to its contents.
Name: ______________________________________
Date: _______________________________________
Lab Instructor:
Grading Policy
Lab Performance 15%
Lab Report 15%
Lab Project +Viva 20%+10%
Final Lab Exam 40%
Rubrics
Lab Performance (Continuous Assessment) / Performance Test
2 Efficiency The code is fairly The code The code is huge and
efficient without is brute appears to be patched
force and
sacrificing unnecess together.
readability and arily long.
understanding.
Viva Voce
Project Viva
Responds well, Generally Non-responsive.
Responsiveness to quick and very Responsive and
1
Questions/ accurate all the accurate most of
Accuracy time. the times.
Demonstration of At ease with No grasp of
full knowledge of content and able information. Clearly no
Level of
the subject with to elaborate and knowledge of subject
2 understanding of
explanations and explain to some matter. No questions
the learned skill
elaboration. degree. are answered. No
interpretation made.
Project Presentation
Presentation is
Presentation is
clear Listener can follow
generally clear.
and logical. presentation with
A
1 Organization Listener can effort.
few minor points
easily Organization not
may be
follow line of well thought out.
confusing
reasoning
Is very confident
and explains the
details properly. Is confident to Has low confidence to
Proper eye some extent explain and deliver
contact is with quite less topic properly. Less
2 Confident
maintained all eye contact and eye contact and
the time with presentational presentational
proper gestures. gestures used.
presentational
gestures.
Responds well to
Reluctantly interacts
questions. Generally
Responsiveness to with audience.
3 Restates responsive to
Audience Responds poorly to
and summarizes questions.
questions.
when needed.
Team Work
Relays very little
Share Relays some basic
1 Relays a great deal information--some
Information information--most
of relates to the topic
information--all relates
relates to to the topic.
the topic.
Performs all duties
Performs nearly
Fulfill Team of Performs very little
2 all
duties assigned team duties.
duties
role
Lab’s Course Learning Outcomes
Course Title: Database Systems
Course Code: CSC-352
Instructor: Ms. Batool Abbas
Designation: Lecturer
E-mail: [email protected]
Students will be able to:
To provide a classroom and laboratory environment that enables students to become proficient C++
programmers.
• Students are not assumed to have a background in computer programming and therefore
introductory material on software engineering and program development will be presented.
• However, most of the course will be on the specifics of the C++ language. Students completing this
course will be able to compile various programs in text-user-interface computer language.
• Students can write the basic structure of C++ programs, perform programming experiments in C++
language, and develop techniques to solve problems.
CLO1: Formulate SQL query to access data within the relational databases.
CLO2: Use structured query language (SQL) to manage database systems and extract data efficiently.
Mapping of Course Learning Outcomes (CLO) to Program Learning Outcomes (PLO) / Graduate
Attributes
Course Code
CLOs/ PLOs PLO 1 PLO 10
PLO2 PLO3 PLO4 PLO5 PLO6 PLO7 PLO8 PLO9
CLO 1
X
CSC-351
CLO2
X
3 Select, From, Where all related Queries in SQL, Distinct, and Order by clause 1
9 Subqueries 2
PLO CLO LL
Objectives:
5 1 P2
The objectives of this first experiment are:
Activity:
SQL Server 2016 (13. x) RC1 and later require .NET Framework 4.6 for the Database Engine, Master Data
Services, or Replication. SQL Server setup automatically installs .NET Framework. You can also manually
install .NET Framework from Microsoft .NET Framework 4.6 (Web Installer) for Windows.
• x64 Processor: AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support,
Intel Pentium IV with EM64T support
1.6. Monitor
Important Note:
2.1. connect your system with the internet and download the developer
edition using this given link: https://www.microsoft.com/en-us/sql-
server/sql-server-downloads
2.2. Login on window as Administrator
1:
2.3. Once downloaded then click on the .exe file and run.
2.4. Then click on Basic version to install.
Figure5:
2.8.Click on the highlighted link. It will download the. file of SSMS. After downloading run the .exe file.
Figure6: Version of SSMS for installation
2.9. Click on Install and wait until installation is done successfully.
Figure 7: Installation of SS
3. Generate Scripts of a schema
• Step 1
Right click on your database and select Task -> generate script.
Figure 8: Database_Scripts_With_Data_Select_Option
Database system Lab
Department of Computer Science
• Step 2
Figure 9: Database_Scripts_With_Data_Introduction
• Step 3
Select the database object which you are all you need and then click next.
• Step 4
Now you will be shown a window which asks you about how your script should be published.
• Step 5
Select ‘Schema and data’ from the type of data to the script option and then click OK.
P a g e 23 | 33
Database system Lab
Department of Computer Science
• Step 6
Click finish, now check the script file, it must have the insert queries too.
Lab Tasks
1. Create a new database named TestDB_2022_CS
P a g e 24 | 33
Database system Lab
Department of Computer Science
CONCLUSION:
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
RUBRICS:
P a g e 25 | 33
Database system Lab
Department of Computer Science
PRACTICAL NO.02
DML, DDL, and DCL commands
PLO CLO LL
5 1 P2
Objectives:
This lab provides an:
1. To create a database and table using SQL, Briefing various commands
and their use.
2. DDL command description and practice.
Example:
CREATE TABLE Persons ( PersonID int, LastName varchar(255),
FirstName varchar(255), Address varchar(255), City varchar(255)
);
4) DROP TABLE:
DROP TABLE table_name; Example:
DROP TABLE Shippers;
5) TRUNCATE TABLE:
P a g e 26 | 33
Database system Lab
Department of Computer Science
The TRUNCATE TABLE statement is used to delete the data inside a table,
but not the table itself.
6) ALTER TABLE:
The ALTER TABLE statement is also used to add and drop various
constraints on an existing table.
P a g e 27 | 33
Database system Lab
Department of Computer Science
What is Constraints?
To maintain the data integrity, we use the constraints. Constraints are the rules
which we applied on the
table’s column to ensure the data integrity.
We can add constraints on column while creating the table and can also add
after creating the table. Constraints are used to specify rules for data in a table.
The following constraints are commonly used in Sql:
P a g e 29 | 33
Database system Lab
Department of Computer Science
CONCLUSION:
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
RUBRICS:
Instructor Signature
P a g e 30 | 33
Database system Lab
Department of Computer Science
PRACTICAL NO.03
Basic queries of SQL (select, where, distinct, order by)
PLO CLO LL
5 1 P2
Objectives:
Understand use of basic queries in SQL Select, From, Where , Distint , Order By all related
Queries in SQL
The SQL SELECT Statement
Here, column1, column2, are the field names of the table you want to select data from. If
you want to select all the fields available in the table, use the following syntax:
The following SQL statement selects the "CustomerName" and "City" columns from the
"Customers" table:
Example
Example
The following SQL statement selects all the columns from the "Customers" table:
Example
P a g e 31 | 33
Database system Lab
Department of Computer Science
The WHERE clause is used to extract only those records that fulfill a specified condition.
SELECT column1, column2, ...
FROM table_name
WHERE condition;
The following SQL statement selects all the customers from the country "Mexico", in the
"Customers" table:
Example
SELECT * FROM
Customers WHERE
Country='Mexico';
Example
SQL requires single quotes around text values (most database systems will also allow
Example
SELECT *
FROM Customers
WHERE CustomerID=1;
The SELECT DISTINCT statement is used to return only distinct (different) values.
Inside a table, a column often contains many duplicate values; and sometimes you
only want to list the different (distinct) values.
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the
P a g e 32 | 33
Database system Lab
Department of Computer Science
records in descending order, use the DESC keyword.
ORDER BY Syntax
SELECT column1, column2, ... FROM table_name
ORDER BY column1, column2, ... ASC|DESC;
ORDER BY Example
The following SQL statement selects all customers from the "Customers" table, sorted by
the "Country" column:
Example
Lab Task
Task 01: Perform various queries on the inserted and saved data.
Task 02: Check output and practice by changing data.
Task 03: Perform various queries on the inserted and saved data.
CONCLUSION:
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
RUBRICS:
Instructor Signature
P a g e 33 | 33