Professional Documents
Culture Documents
Assignment 1
Date: 14-09-2022
Syntax
Create table < Table_Name >(
<Column Name 1> <Data type>(size),
.
.
1
Hemang Goel 02361188820
Syntax
Insert into table_name(column1, column2, ………)
Values (value1, value2, ............ );
2
Hemang Goel 02361188820
3
Hemang Goel 02361188820
DESCRIPTION command
It is used to know the description of the data table.
Syntax
Desc <Table_Name>;
4
Hemang Goel 02361188820
Assignment 2
Date: 27-09-2022
5
Hemang Goel 02361188820
6
Hemang Goel 02361188820
7
Hemang Goel 02361188820
8
Hemang Goel 02361188820
9
Hemang Goel 02361188820
10
Hemang Goel 02361188820
11
Hemang Goel 02361188820
Question 6: Display the Client_No and name whose baldue is greater than ‘5000’.
Question 7: Display the client_no , city and pin code who belongs to Delhi.
12
Hemang Goel 02361188820
Question 8: Display the name and baldue of those clients who belongs to Rajasthan.
13
Hemang Goel 02361188820
Assignment 3
Date:27-09-2022
a. Client_no
b. Name
c. Address
d. City
e. Pincode
f. State
g. Bal_due
14
Hemang Goel 02361188820
15
Hemang Goel 02361188820
16
Hemang Goel 02361188820
Question 3: Display all the records from client_master table who belongs to Delhi and the
baldue is less than 5000.
17
Hemang Goel 02361188820
Question 4: Display all the records from client_master table where city= Delhi or Gurugram.
Question 5 : Display all those records from client_master table whose state is Uttar Pradesh
and city must be Noida or Ghaziabad.
18
Hemang Goel 02361188820
Question 6: Display all the records from client_master table who don’t belong to Delhi.
OR
19
Hemang Goel 02361188820
Assignment 4
Date: 27-09-2022
Syntax
Delete from <Table Name>
Where < Condition>;
Question 1: Delete the record for those Client whose belong to Delhi.
DISTINCT command
The SELECT DISTINCT statement is used to return only distinct (different) values.
Syntax
Select distinct <column_name> From table_name;
20
Hemang Goel 02361188820
SELECT command
The SELECT statement is used to select data from a database. The data returned is stored in a
result table, called the result-set.
Syntax
21
Hemang Goel 02361188820
22
Hemang Goel 02361188820
Question 6: Delete the record from Client_Master_5B table where Column State holds the
value Tamil Nadu.
23
Hemang Goel 02361188820
24
Hemang Goel 02361188820
Question 8: Delete the record from Client_Master_5B where balance due is less than 10000.
25
Hemang Goel 02361188820
Assignment 5
Date: 27-09-2022
Primary Key
The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must
contain UNIQUE values and cannot contain NULL values. A table can have only ONE
primary key; and in the table, this primary key can consist of single or multiple columns
(fields).
Foreign Key
The FOREIGN KEY constraint is used to prevent actions that would destroy links between
tables.
A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY
KEY in another table.
The table with the foreign key is called the child table, and the table with the primary key is
called the referenced or parent table.
Syntax
create table ABC (
………);
26
Hemang Goel 02361188820
Question 1: Create the table name student_5B or student_5bb with the column names
Enrollment_No with primary key, Name, Email_ID, Address, Mobile, DOB, Marks with
appropriate data type.
27
Hemang Goel 02361188820
28
Hemang Goel 02361188820
29
Hemang Goel 02361188820
Syntax
Select column 1, column 2,……
From table_name,
Where condition
Question 4: To show all the records from Client_Master_5bb table in descending order of
City name.
30
Hemang Goel 02361188820
31
Hemang Goel 02361188820
Assignment 6
Date: 03-10-2022
Syntax
Update table_name
Question 1: Update the city to Noida of those client whose balance is greater than 5000.
32
Hemang Goel 02361188820
33
Hemang Goel 02361188820
Question 3: Update the customer’s name Vijay and City to Kanpur where personal ID is 105.
34
Hemang Goel 02361188820
35
Hemang Goel 02361188820
Question 5: Delete the record from table where City is Noida, State is UP and Client Number
is 101 or 102. OR as per your client_no.
36
Hemang Goel 02361188820
37
Hemang Goel 02361188820
Assignment 7
Date: 06-10-2022
Syntax
Select column1, column2,..
From table_name
Question 1: To display the name of client whose name start with character A.
38
Hemang Goel 02361188820
Question 2: Display the name of client whose name second character is ‘h’.
Question 3: Find the name of client whose name end with “a”.
39
Hemang Goel 02361188820
Question 4: Find the name of client that have “or” in any position.
Question 5: Find the name of client whose name 4th character is “r”.
40
Hemang Goel 02361188820
Question 6: Find the name of client whose name start with “A” and have at least 4 characters
in length.
Question 7: Find the names of client whose name start with “A” and end with “o”.
41
Hemang Goel 02361188820
Assignment 8
Date: 06-10-2022
Syntax
Select column_names
From table_names
Where column_names IN (Value 1, Value 2, …..);
Question 1: Select details of all customers that are located in Delhi, Noida, Ghaziabad.
42
Hemang Goel 02361188820
Question 2: Select details of all customers that are not located in Delhi, Noida, Ghaziabad.
The BETWEEN operators is uses ‘begining and end value’ are included.
Syntax
Select column_names
From table_names
43
Hemang Goel 02361188820
Question 3: To show the details of all clients whose balance whose balance due between
1000 & 6000.
Question 4: To show the details of all clients whose balance whose balance not due between
1000 & 6000
44
Hemang Goel 02361188820
Question 5: Select all clients with Balance due between 1000& 5000 in addition don’t show
with the city name Noida and Ghaziabad.
45
Hemang Goel 02361188820
Assignment 9
Date: 10-10-2022
Syntax
Alter table<table_name>
Add<column_name><Data types>;
Question 1: To add a new column mobile number into the table Client_Master.
46
Hemang Goel 02361188820
Question 2: Update mobile number for all existing client number into the Client_Master
table.
47
Hemang Goel 02361188820
48
Hemang Goel 02361188820
49
Hemang Goel 02361188820
50
Hemang Goel 02361188820
51
Hemang Goel 02361188820
Question 3: To show the details of all client whose name second character is p and who
belongs to Delhi or Noida, where balance due is greater than 500.
52
Hemang Goel 02361188820
Syntax
Alter table<table_name>
Drop column<column_name>;
53
Hemang Goel 02361188820
54
Hemang Goel 02361188820
55
Hemang Goel 02361188820
56
Hemang Goel 02361188820
57
Hemang Goel 02361188820
58
Hemang Goel 02361188820
59