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

A Library Table Contains The Following Structure As Shown Below Table:-Library

The document provides the structures of two tables, Library and EMPLOYEE, and asks to write SQL commands to create the tables, display records, add/modify columns, sort data, and delete rows. It also provides the structure of a third table, SHOP, and asks for the same SQL commands.

Uploaded by

Hemlata
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)
35 views2 pages

A Library Table Contains The Following Structure As Shown Below Table:-Library

The document provides the structures of two tables, Library and EMPLOYEE, and asks to write SQL commands to create the tables, display records, add/modify columns, sort data, and delete rows. It also provides the structure of a third table, SHOP, and asks for the same SQL commands.

Uploaded by

Hemlata
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/ 2

A library table contains the following structure as shown below

Table:- Library.
Book_no Integer(4) Primary key
Book_name Character(20) Not null
Author Character(20) Not null
Price Integer(4) Default 0

Write SQL commands for the following:


a) To create table.
b) To show all records.
c) To add one more column named Quantity of type integer (5).
d) To list Book name in the descending order of price
e) To delete all the rows of the table.

Consider the following table EMPLOYEE


Name of column Datatype & size Constraint
Emp_ID Integer(4) Primary key
First_Name Variable Character(20) Not Null
Last_Name Variable character (20) Not Null
Email_ID Variable character(20)

Write SQL commands for the following:


a) To create table.

b) To show all records.

c) To display Email_ID and FirstName of those Employee that have their Names starting with
“L”.
d) To change the data type of a column First_Name to char with size 35.

e) To delete all the rows of the table.

Write MySql command to create the table SHOP with given structure and constraint
Table: SHOP
COLUMN_NAME DATATYPE(SIZE) CONSTRAINT
Fno Int(10) Primary Key
Fname Varchar(15)
Type Char(3)
Stock Int(3)
Price Decimal(8,2)
Write SQL commands for the following:
a) To create table.

b) To show all records.

c) To add one more column named Quantity of type integer (5).

d) To list Fname in the descending order of price


e) To delete all the rows of the table.

You might also like