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

Assignment 2 Snehal

Assignment

Uploaded by

priyankanarode16
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 views5 pages

Assignment 2 Snehal

Assignment

Uploaded by

priyankanarode16
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/ 5

Assignment 2

Name: Snehal Pradeep Tak

Roll No: TEB70

● Create the database by using your name

MariaDB [(none)]> select current_date();


MariaDB [(none)]> select version();
MariaDB [(none)]> select 8-9+3;
MariaDB [(none)]> create database monikadb;

F
or creating the database use query: create database snehaldb;
For using the database use query: use snehaldb;
For create the table (for ex. Row and column) use query:
MariaDB [snehaldb]> create table book(
-> b_no int(2),
-> b_name varchar(25),
-> b_price int(3),
-> b_author varchar(50));

● Insert Data into Table

For insert the data in table use query: insert into book;
MariaDB [snehaldb]> insert into book values
-> (02,'priyanka',700,'priyanka'),
-> (03,'yashye',560,'yashvanti'),
-> (04,'mayuri',236,'mayuri');

For check the table with data use query: select * from book;

MariaDB [snehaldb]> insert into book values


-> (01,'snehal',400,'snehal');

MariaDB [snehaldb]> describe book;


MariaDB [snehaldb]> create table newbook as select * from book;
MariaDB [snehaldb]> alter table newbook rename new_book;
MariaDB [snehaldb]> select * from book where b_price>=500;
MariaDB [monikadb]> create table newemplyee as select * from employee;

MariaDB [monikadb]> alter table newemplyee rename newemp;

MariaDB [monikadb]> select * from newemp where b_price>=20000;

MariaDB [monikadb]> create table emp20 as


-> select * from newemp where b_price>=20000;
MariaDB [snehaldb]> create table emp20 as

MariaDB [snehaldb]> alter table newemp

MariaDB [snehaldb]> update newemp

-> set type='computer'

-> where b_no=1;

MariaDB [snehaldb]> alter table newemp


-> drop column type;

MariaDB [snehaldb]> alter table newemp


-> modify column b_no integer(4);

MariaDB [snehaldb]> rename table newemp to book_1;

MariaDB [snehaldb]> create table newemp as


-> select * from newemp1;

MariaDB [snehaldb]> drop table book_1;


MariaDB [snehaldb]> delete from newemp
-> where b_no is null;

MariaDB [snehaldb]> delete from newemp


-> where b_name='Ankita';

MariaDB [snehaldb]> create view empview as


-> select newemp.b_name, b_personal.b_address
-> from newemp, b_personal
-> where newemp.b_no=b_personal.b_number;

You might also like