0% found this document useful (0 votes)
8 views

File Assignment 5

The document outlines an assignment to create a database table named GARMENT with specific columns and constraints. It includes a sample data set for the GARMENT table and provides a series of SQL command tasks (a to m) to manipulate and query the data. The tasks involve inserting data, displaying specific rows based on conditions, and performing calculations on the data.

Uploaded by

chhatwanireena
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

File Assignment 5

The document outlines an assignment to create a database table named GARMENT with specific columns and constraints. It includes a sample data set for the GARMENT table and provides a series of SQL command tasks (a to m) to manipulate and query the data. The tasks involve inserting data, displaying specific rows based on conditions, and performing calculations on the data.

Uploaded by

chhatwanireena
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT 5

Q.1 Create the table GARMENT as per the given specifications:

Table: GARMENT - Specifications

Column Name Datatype and Size Constraint


Gcode Integer(5) Primary key
Description Varchar(20)
Price Decimal(8,2)
FCODE Char(3) (F01,F02,F03,F04)
Readydate Date Not null

Q.2 On the basis of the given sample data of table GARMENT, write the
SQL commands for the questions (a to m)

Table : GARMENT – Sample Data

GCODE Description Price FCODE READYDATE


1023 Pencil Skirt 1150 F03 2008-12-19
1001 Formal Shirt 1250 F01 2008-01-12
1012 Informal Shirt NULL F02 2008-06-06
1024 Baby Top 750 F03 2007-04-07
1090 Tulip Skirt 850 F02 2007-03-31
1019 Evening Gown 850 F03 2008-06-06
1009 Informal Pant 1500 F02 2008-10-20
1017 Formal Pant 1350 F01 2008-03-31
1020 Frock 850 F04 2007-09-09
1089 Slacks 750 F03 2008-10-31
a. To insert the third row of the table.
b. To display all the rows.
c. To display the rows that have price =850.
d. To display the rows that have FCODE as F03 or F02.
e. To display the GCODEs that have price in the range 900 to 1200.
f. To display the Description and Readydates of the garments that have the
word ‘Skirt’ in their description.
g. To display the GCODE and FCODE of garments that were finished before
2007-03-31.
h. To display the available FCODEs. (no repeated values)
i. To display the rows where price is NULL.
j. To display the rows that have GCODE as one of these...
1023,1089,1024,1017
k. To display the GCODE, Price and Price of a dozen pieces of each garment as
DOZEN_PRICE.
l. To display the GCODE, Price, and Price*0.5 and arrange the records on the
basis of increasing order of Description
m. To display the rows on the basis of FCODE ascending and Price descending

__________________________________________________

You might also like