Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
26 views
Worksheet 2 - SQL
Uploaded by
kamalesh.g9a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Worksheet 2 - SQL For Later
Download
Save
Save Worksheet 2 - SQL For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
26 views
Worksheet 2 - SQL
Uploaded by
kamalesh.g9a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Worksheet 2 - SQL For Later
Carousel Previous
Carousel Next
Save
Save Worksheet 2 - SQL For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
ttass sant Munnnpearner aurwriee ieee ‘ SECTION-A 1X5=5 Table :STOCK Table: ITEM. ERASER Write the Query and Output for the following based on the above given tables: 1, CROSS JOIN 2. EQUI JOIN 3. UNION 4, Differentiate between char and Varchar datatype. 5. Differentiate the Primary and unique constraints. SECTION-B 3X2=6 6. Define the terms: a) Database b) DBMS c) Degree d) Cardinality 7. How are SQL Commands classified? 8. What are the different keys in SQL? Explain with example. SECTION-C 2X3=6 9. Consider the following table named “Product”, showing detalls of products being sold in a grocery shop. Table: Product _ _ _ PCode _| PName _| uPrice Manufacturer _| Po. Washing Powder _| 120_ [Surf PO2 Toothpaste 54 Colgate Scanned with CamScannerWrite SQL commands for (a) to (d) and write output for (e). a) Add anew column Discount in the table Product b) Calculate the value of the discount in the table Product as 10 per cent of the UPrice for all ‘those products where the UPrice is more than 100, otherwise the discount will be 0. ©) Increase the price by 12 per cent for all the products manufactured by Dove 4) Display the total number of products manufactured by each manufacturer ) Give the output of the following SQL Statements: i. Select PName, Average(UPrice) from Product GROUP BY PName; li, SELECT DISTINCT Manufacturer FROM Product; ili, SELECT COUNT (DISTINCT PName) FROM Product; iv. SELECT PName, MAX(UPrice), MIN(UPrice) FROM Product GROUP BY PName; 10. Write SQL Queries based on the following tables: Table: Product PID Product Name | Manufacturer_| Price Discount TPO1 Talcum LAK 40 L Powder Fwos Face Wash ABC [45 5 BSO1 Bath Soap ABC 35 SHO6 ‘Shampoo XYZ 120 —_-|10- 7 Fwiz Face Wash. _| XYZ 95 Table: CLIENT CID Client Name City PID 01 Cosmetic Soap Delhi POL | 02 Total Health Mumbai FWOS 3 live Life | Delhi BSO1 04 Pretty Woman Delhi SHO6 fl 05, Dreams Delhi Fwi2 a) Write SL Query to display ProductName and Price for all products whose Price is in the range 50 to 150. b) Write SQL Query to display details of products whose manufacturer is either XYZ or ABC. ) Write SQL Query to display ProductName, Manufacturer and Price for all products that are not giving any discount. d) Write SQL Query to display ProductName and Price for all products whose ProductName ends with ‘h’. e) Write SQL Query to display ClientName, City, P_ID and ProductName for all clients whose city is Delhi. f) Display the count of Products Manufacturer wise. Scanned with CamScanner11.Given the following student relation: SECTION-D [No [Name | Age [Department | Da 7 | Pankaj _| 24 _| Computer 10/01/97 _ Shalini 21 History 24/03/98 Sanjay 2 Hin ~_ | 32/12/96 [Sudha 25 [History _—(| 02/07/99 _ | Rakesh 22 | Hindi _| 05/09/97 jshakeet/30 [History _—| 27/06/98 _ “Tsurya [34 [Computer _[ 25/02/87 8 Shika | 23 [Hindi 31/07/97 Write SQL commands for (a) to (f) and write output for (g)- a) To show all information about b) To list the names of female stu ¢) Tolist names of all students wit d) To display student’s Name, Fee, Age for the students of History department dents who are in Hindi department h their date of admission in ascending order. male Students only e) To count the number of student with Age<23. f) Toinsert anew row inthe student table with the following data: 9,"Zaheer”,36,"Computer”,{12/03/97},230,"M" g) Give the output of the following SQL Statements: iv. 12. Given the Select COUNT(distinct department) from STUDENT; Select MAX(Age) from STUDENT where Sex="F"; Select AVG(Fee) from STUDENT where Dateofadm<{01/01/98}; Select SUM(Fee) from STUDENT where Dateofadm<{01/01/98}; following tables for a database LIBRARY: Table:BOOKS Book Id | Book Name | Author Name |Publishers | Price Type Qty. Fco001 |FastCook | LataKapoor _| EPB 355 Cookery [5 F0001 |The Tears | William First Publ. | 650 Fiction 20 Hopkins T0001 | MyFirstc++ |Brain& Broke _| EPB 350 Text 10 Tooo2 | CH AW.Rossaine | TOH 350 Text 15 Brainworks 0002 | Thunderbolts | Anna Roberts | First Publ. _| 750 Fiction | 50 Table: ISSUED Book_Id ‘Quantity_Issued - 7 Tooo1 4 cooo1 a 5 _ | F000. = 2 Scanned with CamScannerWeite SQt commands for (a) to (1) and write output for (n). 4) To show ook name, author name and Priee of books of Fitst Publ publishers. D) To list the names trom books of Text type, €) To display the names ani 4) To increase the i! price from books in ascending order of their price. ‘0) To display the price of all books of EPB Publishers by 50, Book ld, Book_Name and Quantity. Issued for all hooks which have been issued, j {) To insert a new row in the table Issued having the following data: "F0003", 1 8) Give the output of the following SQL Statements: |, SELECT COUNT(*) FROM Books; li, SELECT MAX(Price) FROM Books WHERE Quantity>=15; iii, SELECT Book_Name. »Author_Name FROM Books WHERE Publishers="EPB”; iv. SELECT COUNT(Distinct Publishers) FROM BOOKS WHERE Price>=400; Scanned with CamScanner
You might also like
Sql problems (1) 1
PDF
No ratings yet
Sql problems (1) 1
23 pages
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
PDF
No ratings yet
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
12 pages
CS Holiday Assignment
PDF
No ratings yet
CS Holiday Assignment
5 pages
12-2324-SHW (Practiacal Work)
PDF
No ratings yet
12-2324-SHW (Practiacal Work)
4 pages
K D Ambani Reliance Foundation School Session 2020-2021 Informatics Practices /computer Science Revision-MYSQL
PDF
No ratings yet
K D Ambani Reliance Foundation School Session 2020-2021 Informatics Practices /computer Science Revision-MYSQL
4 pages
ch1 boookbksolnpdf
PDF
No ratings yet
ch1 boookbksolnpdf
13 pages
SQL Cbse Best
PDF
No ratings yet
SQL Cbse Best
71 pages
Record SQL (1, 2, 3)
PDF
No ratings yet
Record SQL (1, 2, 3)
7 pages
CH1 Book Back
PDF
No ratings yet
CH1 Book Back
7 pages
1436612-XII CS Worksheet7 MYSQL
PDF
No ratings yet
1436612-XII CS Worksheet7 MYSQL
4 pages
Assignment MySQL
PDF
No ratings yet
Assignment MySQL
5 pages
extra qa dbms with solutions
PDF
No ratings yet
extra qa dbms with solutions
10 pages
SQL Programs For Class 12th C++ Practical File
PDF
No ratings yet
SQL Programs For Class 12th C++ Practical File
12 pages
PT TEST-1 A2
PDF
No ratings yet
PT TEST-1 A2
5 pages
Cs Practical Manas New
PDF
No ratings yet
Cs Practical Manas New
58 pages
CS OBS and Guidelines To Project
PDF
No ratings yet
CS OBS and Guidelines To Project
13 pages
DBMSSQL Commands
PDF
No ratings yet
DBMSSQL Commands
5 pages
prac file (hy) sql
PDF
No ratings yet
prac file (hy) sql
14 pages
Mysql 2. Oracle 3. Microsoft SQL Server
PDF
No ratings yet
Mysql 2. Oracle 3. Microsoft SQL Server
11 pages
Gagan Bansal (CS Practical File)
PDF
No ratings yet
Gagan Bansal (CS Practical File)
12 pages
It Practical Papper
PDF
No ratings yet
It Practical Papper
13 pages
Final Practical file of MYSQL for Class XII 2024-25
PDF
No ratings yet
Final Practical file of MYSQL for Class XII 2024-25
39 pages
SQL Queries
PDF
No ratings yet
SQL Queries
6 pages
CS Holiday Work 12
PDF
No ratings yet
CS Holiday Work 12
15 pages
SQLMSQL
PDF
No ratings yet
SQLMSQL
4 pages
DBMS Practice table
PDF
No ratings yet
DBMS Practice table
8 pages
SQL Practicals Class 12
PDF
No ratings yet
SQL Practicals Class 12
6 pages
CS FAQ 1-12
PDF
No ratings yet
CS FAQ 1-12
12 pages
SQL
PDF
No ratings yet
SQL
7 pages
document_1000000562
PDF
No ratings yet
document_1000000562
14 pages
Model-FAT Lab
PDF
No ratings yet
Model-FAT Lab
12 pages
Assignment Chapter 3 PDF
PDF
No ratings yet
Assignment Chapter 3 PDF
2 pages
5. DBMS - Worksheet 1 - 4 Marks
PDF
No ratings yet
5. DBMS - Worksheet 1 - 4 Marks
10 pages
12 Ip Cs Mysql Tables Revisions 23 24 Qp
PDF
No ratings yet
12 Ip Cs Mysql Tables Revisions 23 24 Qp
6 pages
5. DBMS - Worksheet 1 - 5 Marks
PDF
No ratings yet
5. DBMS - Worksheet 1 - 5 Marks
16 pages
QUES BANK_DATABASE AND SQL (SEC-14 INDIRA NAGAR)
PDF
No ratings yet
QUES BANK_DATABASE AND SQL (SEC-14 INDIRA NAGAR)
7 pages
SQL Questions For Practice
PDF
No ratings yet
SQL Questions For Practice
6 pages
Lab Manual For DBMS
PDF
No ratings yet
Lab Manual For DBMS
10 pages
Saraswati Vidya Mandir, Kamla Nagar, Agra Computer Science
PDF
No ratings yet
Saraswati Vidya Mandir, Kamla Nagar, Agra Computer Science
5 pages
MySQL Functions Practical File Questions
PDF
No ratings yet
MySQL Functions Practical File Questions
3 pages
Grade 12 - Practical Program (Term2 - (11-18) )
PDF
No ratings yet
Grade 12 - Practical Program (Term2 - (11-18) )
17 pages
III Sem (CA) RDBMS Lab Qoestion Bank 2019-20
PDF
No ratings yet
III Sem (CA) RDBMS Lab Qoestion Bank 2019-20
5 pages
Mysql Full Notes
PDF
No ratings yet
Mysql Full Notes
41 pages
Answer
PDF
No ratings yet
Answer
9 pages
SQL Basic
PDF
No ratings yet
SQL Basic
33 pages
Query Skills Demo Using Northwind Database
PDF
No ratings yet
Query Skills Demo Using Northwind Database
4 pages
R1C2_Questions (1)
PDF
No ratings yet
R1C2_Questions (1)
5 pages
Practical File Assignment CS Class 12 -2024-2025-Sr
PDF
No ratings yet
Practical File Assignment CS Class 12 -2024-2025-Sr
15 pages
Print
PDF
No ratings yet
Print
39 pages
2023 01 02 110049DBMS - Graded - Assignment
PDF
No ratings yet
2023 01 02 110049DBMS - Graded - Assignment
5 pages
SQL 1
PDF
No ratings yet
SQL 1
5 pages
MODEL PRACTICAL
PDF
No ratings yet
MODEL PRACTICAL
4 pages
SQL Question Paper - 2
PDF
No ratings yet
SQL Question Paper - 2
6 pages
Database Management Systems-Sql Model
PDF
No ratings yet
Database Management Systems-Sql Model
3 pages
sp-1 FINAL
PDF
No ratings yet
sp-1 FINAL
9 pages
XII CS - Term2 - Practicals (2021-22) - Sol
PDF
No ratings yet
XII CS - Term2 - Practicals (2021-22) - Sol
13 pages
Final Cs
PDF
No ratings yet
Final Cs
34 pages
Database Labreport
PDF
No ratings yet
Database Labreport
22 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
Sql problems (1) 1
PDF
Sql problems (1) 1
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
PDF
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
CS Holiday Assignment
PDF
CS Holiday Assignment
12-2324-SHW (Practiacal Work)
PDF
12-2324-SHW (Practiacal Work)
K D Ambani Reliance Foundation School Session 2020-2021 Informatics Practices /computer Science Revision-MYSQL
PDF
K D Ambani Reliance Foundation School Session 2020-2021 Informatics Practices /computer Science Revision-MYSQL
ch1 boookbksolnpdf
PDF
ch1 boookbksolnpdf
SQL Cbse Best
PDF
SQL Cbse Best
Record SQL (1, 2, 3)
PDF
Record SQL (1, 2, 3)
CH1 Book Back
PDF
CH1 Book Back
1436612-XII CS Worksheet7 MYSQL
PDF
1436612-XII CS Worksheet7 MYSQL
Assignment MySQL
PDF
Assignment MySQL
extra qa dbms with solutions
PDF
extra qa dbms with solutions
SQL Programs For Class 12th C++ Practical File
PDF
SQL Programs For Class 12th C++ Practical File
PT TEST-1 A2
PDF
PT TEST-1 A2
Cs Practical Manas New
PDF
Cs Practical Manas New
CS OBS and Guidelines To Project
PDF
CS OBS and Guidelines To Project
DBMSSQL Commands
PDF
DBMSSQL Commands
prac file (hy) sql
PDF
prac file (hy) sql
Mysql 2. Oracle 3. Microsoft SQL Server
PDF
Mysql 2. Oracle 3. Microsoft SQL Server
Gagan Bansal (CS Practical File)
PDF
Gagan Bansal (CS Practical File)
It Practical Papper
PDF
It Practical Papper
Final Practical file of MYSQL for Class XII 2024-25
PDF
Final Practical file of MYSQL for Class XII 2024-25
SQL Queries
PDF
SQL Queries
CS Holiday Work 12
PDF
CS Holiday Work 12
SQLMSQL
PDF
SQLMSQL
DBMS Practice table
PDF
DBMS Practice table
SQL Practicals Class 12
PDF
SQL Practicals Class 12
CS FAQ 1-12
PDF
CS FAQ 1-12
SQL
PDF
SQL
document_1000000562
PDF
document_1000000562
Model-FAT Lab
PDF
Model-FAT Lab
Assignment Chapter 3 PDF
PDF
Assignment Chapter 3 PDF
5. DBMS - Worksheet 1 - 4 Marks
PDF
5. DBMS - Worksheet 1 - 4 Marks
12 Ip Cs Mysql Tables Revisions 23 24 Qp
PDF
12 Ip Cs Mysql Tables Revisions 23 24 Qp
5. DBMS - Worksheet 1 - 5 Marks
PDF
5. DBMS - Worksheet 1 - 5 Marks
QUES BANK_DATABASE AND SQL (SEC-14 INDIRA NAGAR)
PDF
QUES BANK_DATABASE AND SQL (SEC-14 INDIRA NAGAR)
SQL Questions For Practice
PDF
SQL Questions For Practice
Lab Manual For DBMS
PDF
Lab Manual For DBMS
Saraswati Vidya Mandir, Kamla Nagar, Agra Computer Science
PDF
Saraswati Vidya Mandir, Kamla Nagar, Agra Computer Science
MySQL Functions Practical File Questions
PDF
MySQL Functions Practical File Questions
Grade 12 - Practical Program (Term2 - (11-18) )
PDF
Grade 12 - Practical Program (Term2 - (11-18) )
III Sem (CA) RDBMS Lab Qoestion Bank 2019-20
PDF
III Sem (CA) RDBMS Lab Qoestion Bank 2019-20
Mysql Full Notes
PDF
Mysql Full Notes
Answer
PDF
Answer
SQL Basic
PDF
SQL Basic
Query Skills Demo Using Northwind Database
PDF
Query Skills Demo Using Northwind Database
R1C2_Questions (1)
PDF
R1C2_Questions (1)
Practical File Assignment CS Class 12 -2024-2025-Sr
PDF
Practical File Assignment CS Class 12 -2024-2025-Sr
Print
PDF
Print
2023 01 02 110049DBMS - Graded - Assignment
PDF
2023 01 02 110049DBMS - Graded - Assignment
SQL 1
PDF
SQL 1
MODEL PRACTICAL
PDF
MODEL PRACTICAL
SQL Question Paper - 2
PDF
SQL Question Paper - 2
Database Management Systems-Sql Model
PDF
Database Management Systems-Sql Model
sp-1 FINAL
PDF
sp-1 FINAL
XII CS - Term2 - Practicals (2021-22) - Sol
PDF
XII CS - Term2 - Practicals (2021-22) - Sol
Final Cs
PDF
Final Cs
Database Labreport
PDF
Database Labreport