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

Database Prac 01

The document contains SQL commands to create and populate three tables: TEACHER, Garment, and BOOKS, along with an ISSUED table for tracking book issues. Each table includes various fields such as IDs, names, descriptions, prices, and other relevant attributes. The INSERT statements provide sample data for each table, although some entries have syntax errors that need correction.
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

Database Prac 01

The document contains SQL commands to create and populate three tables: TEACHER, Garment, and BOOKS, along with an ISSUED table for tracking book issues. Each table includes various fields such as IDs, names, descriptions, prices, and other relevant attributes. The INSERT statements provide sample data for each table, although some entries have syntax errors that need correction.
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

QUESTION 01

CREATE TABLE `TEACHER` (


`T_ID` INT NULL,
`NAME` TEXT NULL,
`AGE` INT NULL DEFAULT NULL,
`DEPARTMENT` TEXT NULL,
`DATE_OF_JOIN` TEXT NULL,
`SALARY` INT NULL DEFAULT NULL,
`GENDER` TEXT NULL
);

INSERT INTO `db admini`.`teacher` (`T_ID`, `NAME`, `AGE`, `DEPARTMENT`,


`DATE_OF_JOIN`, `SALARY`, `GENDER`)
VALUES (1, 'JUGAL', 34, 'COMPUTER SC', '10/01/2017', 12000, 'M'
2, 'SHAMILA', 31, 'HISTORY', '24/03.2008', 20000, 'F'
3, 'SANDEEP', 32, 'MATHEMATICS', '12/12/2016', 30000, 'M'
4, 'SANGEETA', 35, 'HISTORY', '01/07/2015', 40000, 'F'
5, 'RAKESH', 42, 'MATHEMATICS', '05/09/3007', 25000, 'M
6, 'SHYAN', 50, 'HISTORY', '27/06/2008', 30000, 'M'
7, 'SHIV OM', 44, 'COMPUTER SC', '25/02/2017', 21000, 'M'
8, 'SHALAKHA', 33, 'MATHEMATICS', '31/07/2018', 20000, 'F'
);
QUESTION 02

CREATE TABLE `Garment` (


`GCODE` INT (50),
`DESCRIPTION` TEXT ,
`PRICE` INT (10),
`FCODE` TEXT ,
`READYDATE` DATE);

INSERT INTO `mvundura`.`garment` (`GCODE`, `DESCRIPTION`, `PRICE`, `FCODE`,


`READYDATE`)
VALUES (10023, 'PENCIL SKIRT', 1150, 'F03', '19-DEC-08'
10001, 'FORMAL SHIRT', 1250, 'F01', '12-JAN-08'
10012, 'INFORMAL SHIRT', 1550, 'F02', '06-JUN-08'
10024, 'BABY TOP', 750, 'F03', '07-APR-07'
10090, 'TULIP SKIRT', 850, 'F02'
10019, 'GOWN', 850, 'F03', '06-JUN-08'
10009, 'INFORMAL PANT', 1500, 'F02', '20-OCT--8'
10017, 'FORMAL PANT', 1350, 'F01', '09-MAR-08'
10020, 'FROCK', 850, 'F04', '09-SEP-07'
10089, 'SLACKS', 750, 'F03', '31-OCT-08'
);
QUESTION 2
CREATE TABLE `BOOKS` (
`BOOK_ID` TEXT,
`BOOK_NAME` TEXT,
`AUTHOR_NAME` TEXT,
`PUBLISHERS` TEXT,
`PRICE` INT,
`TYPE` TEXT,
`QTY` INT
);
NSERT INTO `db admini`.`books` (`BOOK_ID`, `BOOK_NAME`, `AUTHOR_NAME`,
`PUBLISHERS`, `PRICE`, `TYPE`, `QTY`)
VALUES ('C0001', 'FAST COOK', 'LATA KAPOOT', 'EPB', 255, 'COOKERY', 5
'F001', 'THE TEARS', 'WILLIAM HOPKINS', 'FIRST PUBL', 650, 'FICTION', 20
'T001', 'MY FIRST C-', 'BIAN AND BROOKE', 'EPB', 350, 'TEXT', 10
'T0002', 'C-BRANWORKS', 'A W ROSSAINE', 'TDH', 350, 'TEXT', 15
'F0002', 'THUNDERBOLTS', 'ANNA ROBERTS', 'FIRST PUBL', 750, 'FICTION', 50
);

CREATE TABLE `ISSUED` (


`BOOK_ID` TEXT NULL,
`QUANTITY_ISSUED` INT NULL DEFAULT NULL
);
INSERT INTO `db admini`.`issued` (`BOOK_ID`, `QUANTITY_ISSUED`) VALUES
('T0001', 4
'C0001', 5
'F0001', 2
);

You might also like