0% found this document useful (0 votes)
4 views

MySQL Record PT 1

mysql

Uploaded by

chanikran404
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

MySQL Record PT 1

mysql

Uploaded by

chanikran404
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

BASIC COMMANDS IN My SQL

EXP.NO: 01

DATE:

AIM: To execute basic commands in My SQL.

PROGRAM:

1) Write a command to create a student _12A database.

2) Write a command to display all the databases

3) Write a command for using the database.

4) Create a table s1 with rno, s_name, age , dob,stream, fees

5) Write a command to show structure of the table.

6) Write a command to insert 5 rows in a table.

7) Write a command to view contents of the table.


8) Write a command to retrieve rno,s_name and stream from the relation s1.

9) Write a command to display stream of the students in a distinct manner.

10) Write a command to display s_name and stream of the students whose stream is equal
to cs.

11) Write a command to display name and stream in the ascending order of name.

12) Write a command to display name and stream in the descending order of name.

13) Write a command to add new column marks to the table s1.
14) Write a command to display name, stream and marks of the students who are in stream
cs and have marks greater than 90.

15) Write a command to make rno as primary key.

16) Write a command to increase cs student’s marks by 10.

17) Write a query to display the name of the students whose name is starting with ‘A’

18) Write a query to delete the details of rno is 5

19) Write a query to display name of all students whose fees contains null
20) Write a query to display
max,min,sum,avg,count(*),count(marks),count(distinct(marks)) of each stream

21) Write a query to display stream where the number of students is more than 2.

22) Write a query to display rno, s_name, address and phone_no of tables s1 and s2.

23) Write a query to delete marks column from the table.

24) Write a query to delete the table

25) Write a query to delete the database

You might also like