0% found this document useful (0 votes)
38 views3 pages

Roll No-24

The document shows the SQL commands used to create a database called "apple" and a table called "stud" within that database. Several rows are then inserted into the "stud" table with student IDs, names, and cities. One row is deleted and the table is queried to show the final results.

Uploaded by

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

Roll No-24

The document shows the SQL commands used to create a database called "apple" and a table called "stud" within that database. Several rows are then inserted into the "stud" table with student IDs, names, and cities. One row is deleted and the table is queried to show the final results.

Uploaded by

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

mysql> show databases;

+--------------------+
| Database |
+--------------------+
| a1 |
| a2 |
| a5 |
| abc |
| ak |
| ask |
| c4 |
| choclate |
| d4 |
| d9 |
| information_schema |
| kadhus |
| khdhus |
| kk |
| mango |
| mydata |
| mysql |
| panu |
| performance_schema |
| priya |
| q2 |
| ram |
| riya |
| sai |
| sanika |
| siddhu |
| stud |
| studen |
| student |
| suhani |
| svit |
| syco |
| syco1 |
| syco2 |
| sycobc2 |
| u3 |
+--------------------+
36 rows in set (0.00 sec)

mysql> create database apple;


Query OK, 1 row affected (0.06 sec)

mysql> use apple;


Database changed
mysql> create table stud(s_id int,name varchar(20),city varchar(20));
Query OK, 0 rows affected (0.15 sec)

mysql> show columns from stud;


+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| s_id | int | YES | | NULL | |
| name | varchar(20) | YES | | NULL | |
| city | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> insert into stud value(1,'shital','akluj');


Query OK, 1 row affected (0.07 sec)

mysql> insert into stud value(2,'puja','solapur');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(3,'pratiksha','baramati');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(4,'arti','aran');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(5,'sartak','modnimb');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(6,'pradip','nagar');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value


-> \c
mysql> insert into stud value(7,'anil','varvade');
Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(8,'sunil','tembhurni');


Query OK, 1 row affected (0.07 sec)

mysql> insert into stud value(9,'shankar','pune');


Query OK, 1 row affected (0.08 sec)

mysql> insert into stud value(10,'shubham','pandharpur');


Query OK, 1 row affected (0.05 sec)

mysql> insert into stud value(11,'rupali','sangam');


Query OK, 1 row affected (0.08 sec)

mysql> insert into stud value(12,'dipali','giravi');


Query OK, 1 row affected (0.05 sec)

mysql> select*from stud;


+------+-----------+------------+
| s_id | name | city |
+------+-----------+------------+
| 1 | shital | akluj |
| 2 | puja | solapur |
| 3 | pratiksha | baramati |
| 4 | arti | aran |
| 5 | sarthak | modnimb |
| 6 | pradip | nagar |
| 7 | anil | varvade |
| 8 | sunil | tembhurni |
| 9 | shankar | pune |
| 10 | shubham | pandharpur |
| 11 | rupali | sangam |
| 12 | dipali | giravi |
+------+-----------+------------+
12 rows in set (0.00 sec)
mysql> delete from stud where s_id='4';
Query OK, 1 row affected (0.07 sec)

mysql> select*from stud;


+------+-----------+------------+
| s_id | name | city |
+------+-----------+------------+
| 1 | shital | akluj |
| 2 | puja | solapur |
| 3 | pratiksha | baramati |
| 5 | sarthak | modnimb |
| 6 | pradip | nagar |
| 7 | anil | varvade |
| 8 | sunil | tembhurni |
| 9 | shankar | pune |
| 10 | shubham | pandharpur |
| 11 | rupali | sangam |
| 12 | dipali | giravi |
+------+-----------+------------+
11 rows in set (0.00 sec)

mysql>

You might also like