Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views4 pages

SQL 2

The document outlines a series of SQL commands to manage a 'student' database. It includes instructions for creating a database and table, inserting records, displaying records with specific criteria, updating and deleting records, and altering the table structure. The tasks cover various SQL operations such as SELECT, INSERT, UPDATE, DELETE, and ALTER commands.

Uploaded by

aadityapun432
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)
5 views4 pages

SQL 2

The document outlines a series of SQL commands to manage a 'student' database. It includes instructions for creating a database and table, inserting records, displaying records with specific criteria, updating and deleting records, and altering the table structure. The tasks cover various SQL operations such as SELECT, INSERT, UPDATE, DELETE, and ALTER commands.

Uploaded by

aadityapun432
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/ 4

2

a. Create a database named ‘student’.

b. Create a table ‘student’ with following fields.

Student_id integer not null primary key auto increment

Student_name varchar(100)

Student_address varchar(100)

Student_grade integer(int)

c. Insert any 6 records using ‘insert’ and ‘values’ command.

d. Display all the records of all fields.(Use select *)


e. Display all the records of fields’ student_id and student_name.

f. Display records of students whose name starts with letter ‘a’.

g. Display records of students whose name ends at letter ‘h’.


h. Display all the records of students whose grade is 12. Use ‘where’ command.

i. Display all the records of students whose grade is 12 and who are from address
“Kathmandu”. Use ‘and’ operator.

j. Update the student name with any other name who has id 1.

k. Delete the record of student whose id is 3.


l. Display the records of students in sorted order using field ‘student_name’. Use ‘order by
field name asc/desc’.

m. Alter the table with following fields.

Add one more field student_section--- varchar(100). [Use alter and add command]

Change the size of field student_address-- 200 [Use alter and modify command]

You might also like