0% found this document useful (0 votes)
4 views5 pages

Graded

The document outlines the instructions and requirements for Graded Lab Assignment 2 for the CSN205 Database Management System course, including submission guidelines and a grading scheme. It consists of two questions: the first requires writing MySQL queries to create and manipulate an employee table, while the second explains integrity constraints in SQL. The assignment is due on March 21, 2025, and emphasizes the importance of originality in submissions.

Uploaded by

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

Graded

The document outlines the instructions and requirements for Graded Lab Assignment 2 for the CSN205 Database Management System course, including submission guidelines and a grading scheme. It consists of two questions: the first requires writing MySQL queries to create and manipulate an employee table, while the second explains integrity constraints in SQL. The assignment is due on March 21, 2025, and emphasizes the importance of originality in submissions.

Uploaded by

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

Graded Lab Assignment 2 – CSN205 Database Management System, Even Sem, 2024-2025

Student Name: Sejal chhabra ID: 1000020301


Major:B.Tech “CSE

 Instructions

 There are Two questions in this assignment.


 Email/paper/other modes of submissions will not be accepted.
 Upload a word version of this document.
 Assignment submitted after due date will not be evaluated and a score of zero will
be awarded.
 Plagiarism may lead to award of zero marks.

Due Date: 11:50 am , 03/21/2025

Submitting this Assignment

You will submit (upload) this assignment in MS Teams. Name this document as
GLA1_AJPEVEN2025_John_Doe.doc in case your name is John Doe, and this graded lab
assignment is 1 of course whose acronym is AJP, and offered in EVEN 2025. Paste your
code after each question, paste the screenshot of output, save and upload the document.

Grading Scheme: This assignment has 5 marks.

Question 1:
Write the following queries in mysql.
1) Create table- employee (id(primary key), name, city, email, phone, salary
Graded Lab Assignment 2 – CSN205 Database Management System, Even Sem, 2024-2025

Student Name: Sejal chhabra ID: 1000020301


Major:B.Tech “CSE

2) Insert records as--

Id Name City Email phone salary


1 Ravi Delhi [email protected] 985664321 12000
kumar
2 Neha Mumbai [email protected] 987654321 13000
Sharma
3 Rohit Bangalore [email protected] 887694721 8000
Singh
4 Preeti Ahmedabad [email protected] 789012345 10000
Patel
5 Manoj Lucknow [email protected] 988634421 7000
Gupta
6 Aarti Pune [email protected] 25000
Desai 890123456

7 Vivek Chandigarh [email protected] 980154021 20000


Sharma
8 Nisha Noida [email protected] 901234567 17000
Graded Lab Assignment 2 – CSN205 Database Management System, Even Sem, 2024-2025

Student Name: Sejal chhabra ID: 1000020301


Major:B.Tech “CSE

Patel
9 Rajesh Hyderabad [email protected] 917654301 16000
Singh
10 Radha Chennai [email protected] 8500
Iyer 897614321

3) Finding the total number of rows in the employee table.


Graded Lab Assignment 2 – CSN205 Database Management System, Even Sem, 2024-2025

Student Name: Sejal chhabra ID: 1000020301


Major:B.Tech “CSE

4) Return the total number of rows in the employee table where the city is Chennai.

5) Find total salary amount that given employees.

6) Return avg. salary of employees.

Question 2: Explain integrity constraints.


Integrity constraints in sql are rules or conditions applied to columns or tables to ensure
the accuracy and reliability of datain a database. They help mainatin data integrity by en-
suring that the data entered into a database is consistent,valid and adheres to certain rules.
There are several types of integrity constraints:
Primary key constaint:ensures that each record in a table is unique and that no two rows
have same value in the primary key column.
Graded Lab Assignment 2 – CSN205 Database Management System, Even Sem, 2024-2025

Student Name: Sejal chhabra ID: 1000020301


Major:B.Tech “CSE

Foreign key constraint: Ensures that a value in one table corresponds to a valid value in
another table,establishing a relationship between the two tables.The foreign key in the
child table must reference a valid primary key in the parent table.
Unique constraint: Ensures that all values in a column are unique,similar to a
primarykey,but a table can have more than one unique constaint.
Not NULL Constraint:Ensures that a column cannot have a NULL value. This is ued to en-
force that certain fields always have data.
Check Constraint: Ensures that the values in a column meet a specific condition or criteria.
Default Constarint: Provides a deafult value for a column if no value is specified during in-
sertion.

You might also like