worksheet on MYSQL - 2
worksheet on MYSQL - 2
worksheet on MYSQL - 2
(i) To display the details of all the models in the Model table in year 2012.
(ii) To display the details of those models whose Cost is below 2000.
(iii) To decrease the cost of all the models in Model table by 15%.
(ii) To display details of those Items in Stock table whose Dealer Code(Dcode) is 102.
(iii) To display details of those Items in Stock table whose (Qty) is more than 100.
(iii) To display the charges at which a vehicle can be hired from CARDEN.
Q.5 Write the SQL commands for (a) to (d) and output for (e):
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend
(c) To insert a new row in the GRADUATE table: 11,“KAJOL”, 300, “computer sc”,
75, 1
Q.6 Write SQL commands for (i) to (vi) and write output for (vii) on the basis of PRODUCTS
(ii) To list the company which gives warranty of more than 2 years.
(iii) To show the PRODUCT name of the products which are within warranty as on date.
Q.7 Write SQL Commands for (i) to (v) and write the outputs for (vi) to (viii) on the basis of
(i) To list the details of furniture whose price is more than 10000.
Ii Give commission of Rs. 500 to all employees who joined in year 1982 (table Emp).
Iii Allocate the department situated in BOSTON to employee with employee number 7500
(tables EMPL, Dept)
Iv Modify table Emp, add another column called Grade of VARCHAR type, size 1 into it.
v Insert a record of your choice in table Empl. Make sure not to enter Grade.
Q.9 A departmental store MyStore is considering to maintain their inventory using SQL to
store the data. As a database administer, Abhay has decided that :
• Name of the database - mystore
• Name of the table - STORE
• The attributes of STORE are as follows:
ItemNo - numeric
ItemName – character of size 20
Scode - numeric
Quantity – numeric
A Identify the attribute best suitable to be declared as a primary key,
C Insert the following data into the attributes ItemNo, ItemName and SCode respectively
in the given table STORE.
ItemNo = 2010, ItemName = “Note Book” and Scode =25
D Abhay want to remove the table STORE from the database MyStore. Which command
will he use from the following:
Q.11
a) Create the table Employee based on the following table instance chart.
Add one column Email of data type VARCHAR and size 30 to the table Customer.
d)
e)
Add one more column CustomerincomeGroup of datatype VARCHAR(10).
f)
Insert few records with relevant information, in the table.
Q12 Q. Consider the following MOVIE database and answer the SQL queries based on it.
BusinessCost.
d) Find the net profit of each movie showing its ID, Name and Net Profit.
Make sure that the new column name is labelled as NetProfit. Is this column now a part
of the MOVIE relation. If no, then what name is coined for such columns?
i) List all movies whose production cost fall in the range 30500 to 100000.