0% found this document useful (0 votes)
6 views2 pages

SQL Practical 1-3

A database named 'library' was created, and a table 'LIBRARYBOOKS' was defined with fields for book details including accession number, title, author, department, date of publication, and price. Five entries were successfully inserted into the 'LIBRARYBOOKS' table. The current contents of the table were displayed, showing details of the five books added.

Uploaded by

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

SQL Practical 1-3

A database named 'library' was created, and a table 'LIBRARYBOOKS' was defined with fields for book details including accession number, title, author, department, date of publication, and price. Five entries were successfully inserted into the 'LIBRARYBOOKS' table. The current contents of the table were displayed, showing details of the five books added.

Uploaded by

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

create database library;

Query OK, 1 row affected (0.00 sec)

use library;
Database changed

create table LIBRARYBOOKS


-> (
-> Accession_no int(20) PRIMARY KEY,
-> Title varchar(20),
-> Author varchar(20),
-> Department varchar(20),
-> DOP date,
-> Price int(10)
-> );

mysql> desc LIBRARYBOOKS;


+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| Accession_no | int(20) | NO | PRI | NULL | |
| Title | varchar(20) | YES | | NULL | |
| Author | varchar(20) | YES | | NULL | |
| Department | varchar(20) | YES | | NULL | |
| DOP | date | YES | | NULL | |
| Price | int(10) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
6 rows in set (0.05 sec)

mysql> insert into LIBRARYBOOKS values(1001,'MULTIMEDIA','Tay


Vaugan','Mathematics','2000-09-20',300);
Query OK, 1 row affected (0.01 sec)

mysql> insert into LIBRARYBOOKS


values(1002,'ALGEBRA','R.Kumar','Mathematics','2004-05-13',180);
Query OK, 1 row affected (0.22 sec)

mysql> insert into LIBRARYBOOKS values(1003,'Micro


Economics','Forte','Economics','2004-10-14',500);
Query OK, 1 row affected (0.00 sec)

mysql> insert into LIBRARYBOOKS values(1004,'Our


Surrounding','A.Kaushik','EVS','2006-05-25',300);
Query OK, 1 row affected (0.01 sec)

mysql> insert into LIBRARYBOOKS values(1005,'Hindi Bhasha B','Dr. Mohm.


Shabbir','Hindi','1997-02-03',150);
Query OK, 1 row affected (0.00 sec)

mysql> select * from LIBRARYBOOKS;


+--------------+-----------------+-------------------+-------------+------------
+-------+
| Accession_no | Title | Author | Department | DOP |
Price |
+--------------+-----------------+-------------------+-------------+------------
+-------+
| 1001 | MULTIMEDIA | Tay Vaugan | Mathematics | 2000-09-20 |
300 |
| 1002 | ALGEBRA | R.Kumar | Mathematics | 2004-05-13 |
180 |
| 1003 | Micro Economics | Forte | Economics | 2004-10-14 |
500 |
| 1004 | Our Surrounding | A.Kaushik | EVS | 2006-05-25 |
300 |
| 1005 | Hindi Bhasha B | Dr. Mohm. Shabbir | Hindi | 1997-02-03 |
150 |
+--------------+-----------------+-------------------+-------------+------------
+-------+
5 rows in set (0.00 sec)

You might also like