Graded
Graded
Instructions
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.
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
Patel
9 Rajesh Hyderabad [email protected] 917654301 16000
Singh
10 Radha Chennai [email protected] 8500
Iyer 897614321
4) Return the total number of rows in the employee table where the city is Chennai.
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.